Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Illegal to use destination for this producer while using the jmsIO.write with 2.46.0 version #25849

Closed
3 of 15 tasks
sriram23kmm opened this issue Mar 15, 2023 · 4 comments · Fixed by #25886
Closed
3 of 15 tasks

Comments

@sriram23kmm
Copy link

What happened?

When we upgraded the Beam version to 2.46.0 to use the Retryconfiguration we faced this issue:

JmsIO.Write sink = JmsIO.write()
.withConnectionFactory(ConnectionsFactoryObject)
.withValueMapper(new TextMessageMapper())
.withRetryConfiguration(RetryConfiguration.create(5))
.withQueue("testQueqe");

Here we used the TIBCO for jms

Issue Priority

Priority: 0 (outage / urgent vulnerability)

Issue Components

  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Samza Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner
@Abacn
Copy link
Contributor

Abacn commented Mar 15, 2023

Thanks for reporting. RetryConfiguration is recently added in #24973. Could you please provide the full exception stacktrace?

we reserve P0 to outage so move the priority for now

@Abacn Abacn added P2 and removed P0 labels Mar 15, 2023
@sriram23kmm
Copy link
Author

sriram23kmm commented Mar 16, 2023

Here is the trace for this issue:

java.lang.UnsupportedOperationException: Illegal to use destination for this producer
at com.tibco.tibjms.TibjmsMessageProducer._publish(TibjmsMessageProducer.java:198)
at com.tibco.tibjms.TibjmsMessageProducer.send(TibjmsMessageProducer.java:573)
at org.apache.beam.sdk.io.jms.JmsIO$Writer$JmsConnection.publishMessage(JmsIO.java:1035)
at org.apache.beam.sdk.io.jms.JmsIO$Writer$JmsIOProducerFn.publishMessage(JmsIO.java:1118)
at org.apache.beam.sdk.io.jms.JmsIO$Writer$JmsIOProducerFn.processElement(JmsIO.java:1102)

TibjmsMessage _publish this was the code TibjmsMessageProducer.java class

      if (this._destination != null) {
        throw new UnsupportedOperationException("Illegal to use destination for this producer");
      }

@sriram23kmm
Copy link
Author

sriram23kmm commented Mar 24, 2023

@Abacn we are Getting Error closing Connection with jmsIO.read with IBM MQ as jms Queqe

com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0008: This connection is closed.
An application called a method that must not be used after the connection is closed.
Ensure that the connection is not closed before calling the method.

	at jdk.internal.reflect.GeneratedConstructorAccessor97.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)
	at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:226)
	at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:126)
	at com.ibm.msg.client.jms.internal.State.checkNotClosed(State.java:142)
	at com.ibm.msg.client.jms.internal.JmsConnectionImpl.getMetaData(JmsConnectionImpl.java:950)
	at com.ibm.msg.client.jms.internal.JmsConnectionImpl.stop(JmsConnectionImpl.java:1163)
	at com.ibm.mq.jms.MQConnection.stop(MQConnection.java:473)
	at org.apache.beam.sdk.io.jms.JmsIO$UnboundedJmsReader.closeConnection(JmsIO.java:648)
	at org.apache.beam.sdk.io.jms.JmsIO$UnboundedJmsReader.lambda$doClose$0(JmsIO.java:635)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.beam.sdk.util.UnboundedScheduledExecutorService$ScheduledFutureTask.run(UnboundedScheduledExecutorService.java:163)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

@Abacn
Copy link
Contributor

Abacn commented Mar 24, 2023

@sriram23kmm This error is handled and suppressed:

LOG.error("Error closing connection", e);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants