MuleESB / Apache Camel Interview Questions
How does the Camel JMS/ActiveMQ component work?
The camel-jms component wraps the Spring JMS template and listener container, providing JMS connectivity via the standard javax.jms API. It supports queues and topics, durable subscriptions, message selectors, and transacted sessions. camel-activemq extends camel-jms with ActiveMQ-specific optimisations including in-JVM broker embedding.
// Spring Boot configuration:
spring.activemq.broker-url=tcp://localhost:61616
spring.activemq.user=admin
spring.activemq.password=admin
// Route: consume with JMS transactions:
from("jms:queue:orders?transacted=true&concurrentConsumers=5")
.process(new OrderProcessor())
.to("jms:topic:order-events");
// Request-reply over JMS (InOut pattern):
from("direct:calcPrice")
.to("jms:queue:pricing-service?exchangePattern=InOut&replyTo=pricing-replies");
// Durable topic subscription:
from("jms:topic:product-updates?subscriptionDurable=true&clientId=app1&durableSubscriptionName=app1-sub")
.to("direct:handleUpdate");Key options: transacted=true wraps the consumer in a JMS local transaction (rolled back on route exception), concurrentConsumers sets the thread pool size, acknowledgementModeName controls ack mode. For request-reply, exchangePattern=InOut blocks until a reply arrives on the replyTo queue. camel-activemq can embed a broker in-process using the vm://localhost transport, which is invaluable for testing.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
