简体   繁体   中英

How and where to check certain Apache Camel settings

I have a Camel-based app that publishes/subscribes messages to/from an ActiveMQ instance with routes like:

<from uri="activemq:myQueue" />

or:

<to uri="activemq:someOtherQueue" />

I'm trying to determine if I've inadvertently set my app up in "synchronous mode", which happens when either:

  • ActiveMQConnectionFactory#setAlwaysSyncSend is true; or
  • The " MessageProducer " is set to "Persistent"

I believe that, sans Camel, I would ordinarily be setting these properties manually. Introducing Camel as the ActiveMQ client here, not sure how/where to go to find what the value of these properties are. Any ideas? Thanks in advance.

You configure these values when you add the component by setting them on the connection URI that is passed to the ActiveMQ component. This documentation on the Camel website shows you how its done.

The ActiveMQ client does some of its own optimizations to improve performance on sends by choosing to use async over sync in some cases. This is documented here and is worth a read.

So you would configure the component when you add it via code like this:

camelContext.addComponent("activemq", activeMQComponent("tcp://localhost:61616?jms.alwaysSyncSend=true"));

The ActiveMQConnectionFactory configuration options are documented in detail here and the options applicable to Transports are here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM