Best practice for synchronouse request response with 5000 consumers

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Best practice for synchronouse request response with 5000 consumers


I am working on a scenario where there is a single broker (configured as
master/slave) and two types of clients, a web application (producer) which
send requests and waits for responses and about 5000 java client
applications (consumer) which receive requests and send back responses.
Every java client app creates its own queue and web application send request
for a java client to its queue and receives the response in a temp queue
(synchronous request response, as described in activemq documentation

Now I have a few questions:

1- I use a single shared connection in web application among multiple
threads as the connection object is thread safe. Is a single connection
sufficient or should I use connection pool?

2- Suppose 4 thread in web application simultaneously send request to each
java client. In this way we will have 5000 queue for requests (which is
fixed number, one for each java client) and 4 temp queue for responses,
namely 20000 temp queue. Could activemq handle this load? (this situation
will not occur but I am considering the worst case )

3- If the answer to the second question is no, what is the best practice for
this situation? Should I use a single queue for requests which all 5000 java
client subscribe to and use message selectors to dispatch each request to
appropriate java client And use temp queues for responses as before?

I am using apache-activemq-5.15.9 for broker, activemq-all-5.10.2 java
client library in web application side (I can’t upgrade it at this time),
and activemq-all-5.15.9 java client library in java clients side.


Sent from: