Skip to content

Commit 99202b2

Browse files
authored
Fix Illegal to use destination for jms producer (#25886)
1 parent 43b3f88 commit 99202b2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • sdks/java/io/jms/src/main/java/org/apache/beam/sdk/io/jms

sdks/java/io/jms/src/main/java/org/apache/beam/sdk/io/jms/JmsIO.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,8 @@ public void start() throws JMSException {
10201020
} else if (spec.getTopic() != null) {
10211021
this.destination = session.createTopic(spec.getTopic());
10221022
}
1023-
this.producer = this.session.createProducer(this.destination);
1023+
// Create producer with null destination. Destination will be set with producer.send().
1024+
this.producer = this.session.createProducer(null);
10241025
this.isProducerNeedsToBeCreated = false;
10251026
}
10261027
}

0 commit comments

Comments
 (0)