I have an application that produces messages for 1000 client applications. Each client will poll this ActiveMQ and lookup his messages.
- Should I implement one queue for every client?
- Would it be better to use one queue for all clients and diffirentiate the messages with JMS properities?
Example code with JMS properties
Producer:
Message message = context.createTextMessage(text);
message.setStringProperty("Client", client);
context.createProducer().send(queue, message);
Consumer:
String messageSelector = "Client = '" + client + "'";
JMSConsumer receiver = context.createConsumer(queue, messageSelector);
The 'client' will then be my unique client identifier. Ex: client-1; client-2; ... or a GUID.