Maybe the title is not very descriptive.
The case is the following, there’s a system with one server, one producer and 1..n consumers.
Messages will be sent either directly to one consumer or to a broadcast so every consumer receives the message.
I’m actually thinking of creating one queue for each consumer for direct communication and then another queue for the broadcast messages. This way consumers should poll two queues for messages: it’s own and the broadcast one.
The actual question is: is there a way of doing this without the broadcast queue (so the consumers will only poll one queue)?
I actually solved this using diverts on runtime.
I’m not sure what you’re asking. But you don’t send to a queue, you send to an Address:
In hornetq-core terms:
The producer will send to an Address, and you can create one or many queues on that address
In JMS Terms, you could create either a JMS Queue or a JMS Topic, and you could create message subscription.
also… there’s a feature on hornetq about Topics Hierarchy where you can create queues with Wildcards. Maybe that will help you achieve what you needed.
I can improve this answer if you provide me a little bit more context.
You can also look on Diverts. Look at the HornetQ Documentation for more details.