I'm using activemq (pretty new to me) and I have one producer and several consumers.
Thing is, I want to address messages for specific consumers. I read about selectors but also read that it is a bad practice to use and also read about some alternatives.
The alternative sounds good for me, but I'm not sure how I can create these queues for each and every one of my slaves. Each of my slaves has an ID (uuid) that I can use when I'm creating the listener - like this:
<jms:listener-container
container-type="default"
connection-factory="jmsConnectionFactory"
acknowledge="auto">
<jms:listener destination="slave.tasks.${slave.id}" ref="jmsActivityListener" method="onMessage" />
</jms:listener-container>
This requires the slave.properties file to contain the following entry:
slave.id=XXXXXXX
My questions are:
1) Is that the way to do it (defining a queue per consumer)?
2) How can I generate this salve.id value (I don't want the user to fill it as it has to be unique)?
Thanks