Implementing Virtual Topics on other JMS providers
Most folks want Queue semantics when consuming messages; so that you can support Competing Consumers for load balancing along with things like Message Groups and Exclusive Consumers to preserve ordering or partition the queue across consumers.
However if you are using another JMS provider you can implement Virtual Topics by switching to ActiveMQ or you can use the following Camel pattern.
First here's the ActiveMQ approach.
- send to activemq:topic:VirtualTopic.Orders
- for consumer A consume from activemq:Consumer.A.VirtualTopic.Orders
When using another message broker use the following pattern
- send to jms:Orders
- add this route with a to() for each logical durable topic subscriber
- for consumer A consume from jms:Consumer.A