0

I am using ServiceMix alongside Apache camel and Qpid libraries to connect to a remote node to fetch JMS queues.

My Bean config is ::

  <bean id="amqp" class="org.apache.camel.component.amqp.AMQPComponent">
    <property name="connectionFactory">
       <bean class="org.apache.qpid.jms.JmsConnectionFactory">
          <property name="remoteURI" value="amqp://esesslxjks.se:9443" />
       </bean>
    </property>
  </bean>

 <camelContext xmlns="http://camel.apache.org/schema/blueprint">
    <!-- Master Data Queue -->
    <route>
      <from uri="amqp:queue:///CS_output" />
      <log message="Copying o the output directory"/>
      <to uri="amqp:queue:///CS_input" />
    </route>

Using this bean I start my application and see some positive response ::

| DEBUG | mix-7.0.0/deploy | JmsProducer                      | 43 - org.apache.camel.camel-core - 2.16.4 | Starting producer: Producer[amqp://queue:///CSDP_input]
| DEBUG | mix-7.0.0/deploy | JmsConsumer                      | 43 - org.apache.camel.camel-core - 2.16.4 | Starting consumer: Consumer[amqp://queue:///CSDP_output]
| DEBUG | mix-7.0.0/deploy | BlueprintCamelContext            | 43 - org.apache.camel.camel-core - 2.16.4 | Route: route1 >>> EventDrivenConsumerRoute[Endpoint[amqp://queue:///CS_output] -> Pipeline[[Channel[Log(route1)[Copying o the output directory]], Channel[sendTo(Endpoint[amqp://queue:///CS_input])]]]]
| DEBUG | mix-7.0.0/deploy | faultJmsMessageListenerContainer | 154 - org.apache.servicemix.bundles.spring-jms - 3.2.17.RELEASE_1 | Established shared JMS Connection

But then I get the below ERROR ::

| DEBUG | esesslxjks.se:9443] | AmqpProvider                     | 226 - qpid-jms-client.jar - 0.0.0 | Transport connection remotely closed
| DEBUG | esesslxjks.se:9443] | JmsConnection                    | 226 - qpid-jms-client.jar - 0.0.0 | Async exception with no exception listener: java.io.IOException: Connection remotely closed.
java.io.IOException: Connection remotely closed.
     at org.apache.qpid.jms.provider.amqp.AmqpProvider$18.run(AmqpProvider.java:727)[226:qpid-jms-client.jar:0.0.0]
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
     at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121]
     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_121]
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
     at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

I am currently clueless as to why this would happen ? What other possible debugging can I do ? Any pointers would be highly recommended.

рüффп
  • 5,172
  • 34
  • 67
  • 113

2 Answers2

0

I don't have your use case with your spring camel running like in your example. But I ran into this same exact stack trace you were having during one of my unit tests. What I found out was that after I would explicitly try to close my broker instance then my qpid jms client would also try to close the connection. Thus throwing that exception. I know my use case isn't exactly like yours, but I hope this helps a little bit. Good Luck.

Bandit
  • 31
  • 7
0

On your remoteURI property use amqps protocol instead of amqp.

ServiceBus will be rejecting it because it is using an unsupported protocol.

  <bean id="amqp" class="org.apache.camel.component.amqp.AMQPComponent">
    <property name="connectionFactory">
       <bean class="org.apache.qpid.jms.JmsConnectionFactory">
          <property name="remoteURI" value="amqps://esesslxjks.se:9443" />
       </bean>
    </property>
  </bean>
sweetfa
  • 5,457
  • 2
  • 48
  • 62