1
votes

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.

1

1 Answers

0
votes

How many messages per second per client do you expect? All 1000 clients getting messages and that too with message selection will bring down through put. It would be a good idea to split clients across manageable number of queues.