Steve Huston
Steve Huston

Reputation: 1610

Camel route with AMQP consumer runs ok in Eclipse, hangs in karaf

I am using Camel 2.17.3 and karaf 4.0.7 (also tried 4.0.1).

I have a Camel route that runs fine in Eclipse when a junit test starts it, but hangs when deployed to karaf. If I change the amqp: 'from' component to timer: the route runs fine in karaf.

My AMQP setup in the routebuilder is:

   @Override
    public void configure() throws Exception {

        getContext().addComponent("amqp", AMQPComponent.amqpComponent(String.format("amqp://%s:%s?amqp.saslMechanisms=ANONYMOUS", AMQP_SERVICE_HOST, AMQP_SERVICE_PORT)));

Even this route will hang karaf, and run fine in Eclipse:

 from("amqp:queue:myqueue").routeId("myRoute")
 .log("temp")

In Karaf, when I say "hang", I observe these things:

2016-10-08 23:46:00,593 | INFO | nsole user karaf | bundle
| 90 - org.apache.aries.spifly.dynamic.bundle - 1.0.1 | Bundle Considered for SPI providers: mis-routes 2016-10-08 23:46:00,593 | INFO | nsole user karaf | bundle | 90 - org.apache.aries.spifly.dynamic.bundle - 1.0.1 | No 'SPI-Provider' Manifest header. Skipping bundle: mis-routes 2016-10-08 23:46:05,595 | INFO | ool-130-thread-1 | OsgiDefaultCamelContext | 56 - org.apache.camel.camel-core - 2.17.3 | Apache Camel 2.17.3 (CamelContext: mis-routes) is starting 2016-10-08 23:46:05,599 | INFO | ool-130-thread-1 | OsgiDefaultCamelContext | 56 - org.apache.camel.camel-core - 2.17.3 | MDC logging is enabled on CamelContext: mis-routes 2016-10-08 23:46:05,601 | INFO | ool-130-thread-1 | ManagedManagementStrategy | 56 - org.apache.camel.camel-core - 2.17.3 | JMX is enabled 2016-10-08 23:46:05,708 | INFO | ool-130-thread-1 | DefaultRuntimeEndpointRegistry | 56 - org.apache.camel.camel-core - 2.17.3 | Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000) 2016-10-08 23:46:05,804 | INFO | ool-130-thread-1 | OsgiDefaultCamelContext | 56 - org.apache.camel.camel-core - 2.17.3 | AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance. 2016-10-08 23:46:05,805 | INFO | ool-130-thread-1 | OsgiDefaultCamelContext | 56 - org.apache.camel.camel-core - 2.17.3 | StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html

Any help would be hugely appreciated. Thanks!

Upvotes: 0

Views: 384

Answers (1)

Oscerd
Oscerd

Reputation: 1656

The reason should be related to this issue in Camel JIRA: https://issues.apache.org/jira/browse/CAMEL-10278

The main problem is proton-j 0.10 is incompatible with qpid-jms-client version 0.8. We upgraded the dependency to proton-j 0.12.0 and the fix will be available in the Camel 2.17.4 release.

For the moment you can use Camel 2.17.4-SNAPSHOT or upgrade the dependency in the Camel-Amqp Karaf feature.

Upvotes: 1

Related Questions