0

I have a scenario,

I have the same queue configured for SMS and EMAILS.

I want the ActiveMQ to route the message to specific consumer pool i.e. if it is an SMS, then it must be routed to a pool of worker threads for SMS.

So, If I need to scale up the number of SMSs, then I just need to increase the pool size of SMS Worker Pool and not for EMAIL worker pool.

Can I use Apache Camel to implement the routing logic for my requirement???

Sabya
  • 197
  • 4
  • 17
  • Can refer documentation - http://camel.apache.org/message-router.html , http://camel.apache.org/content-based-router.html – Nayan Wadekar Jan 16 '17 at 07:04

1 Answers1

0

There are a number of options to support this:

  1. Set a header on each message so the consumers can use JMS selectors to filter the messages.

  2. Use a virtual destination within the ActiveMQ broker (the broker can filter based on message header value): http://activemq.apache.org/virtual-destinations.html

  3. Use a Camel broker component to write a custom interceptor handler: http://activemq.apache.org/broker-camel-component.html

  4. Use a Camel message router or content-based-router as Nayan suggested

  5. Use separate queues per message type (i.e. queue://OUTBOUND.SMS, queue://OUTBOUND.EMAIL..)

Each has benefits and trade-offs. #1, #4 and #5 do not require any server-side configuration, which is handy for keeping the broker maintenance as low as possible.

Matt Pavlovich
  • 4,087
  • 1
  • 9
  • 17