<div dir="ltr"><div>Hi�</div><div>We are beginners in rabbitmq. We use rabbitmq 3.2.2. I recently observed an issue with multiple listeners on the same reply queue when performance testing�</div><div>our application written in Java.</div>
<div><br></div><div>Here is the test scenario:</div><div>50 Concurrent users post a request to Service F to create an entity A. The message contains a user id and a timestamp. Each concurrent user posts roughly two messages per second.</div>
<div><br></div><div>F publishes this message to a non-durable queue via a topic exchange (using convertSendAndReceive) and waits for the response on a fixed reply queue ReplyQ1.</div><div><br></div><div>Service A picks up this message and creates this entity (basically an entry in a table) after</div>
<div>validating that the user id wihin that message is valid.</div><div><br></div><div>For the validation, Service A sends this message to another non-durable queue via a topic exchange (convertSendAndReceive) and waits for a response on�</div>
<div>another fixed reply queue, ReplyQ2.�</div><div><br></div><div>A validating service V picks up this user id, validates it (basically a select from a db table) and then sends the response back to ReplyQ2.</div><div>Service A picks this up, based on the message, creates the entity and then sends response to ReplyQ1.�</div>
<div><br></div><div>CreateEntity A Request -> Service F -> Q1 -> Service A -> Q2 - Service V</div><div>Service V-> ReplyQ2 -> Service A (creates entity A if user valid) -> ReplyQ1 -> Service F</div>
<div><br></div><div>F, A and V all live within the same tomcat instance. When a second tomcat instance was started with service A and V, I started to notice warning messages in tomcat logs:</div><div><br></div><div>WARN : org.springframework.amqp.rabbit.core.RabbitTemplate - Reply received after timeout for b3fd4f57-0403-4704-8f16-8c3055ca0cd9</div>
<div><br></div><div>It looked like messages were not picked up by the correct listener from the validation response queues.</div><div><br></div><div>Response times were high for this create Entity A request (10 seconds) and only about 5 transactions were processed per second. Tests were run in AWS on m1.large instances.</div>
<div>High response time was not caused by network latency. network latency was really small�</div><div><br></div><div>On testing with separate reply queues for the user id validation response,�</div><div>(ReplyQ21 and ReplyQ22 instead of ReplyQ2), response times improved (1 second) and more transactions (roughly 70) were processed per second.�</div>
<div><br></div><div>Is this a good design approach for this scenario? Or is there a better way to handle this ?</div><div><br></div><div>All messages are non-persistent. No concurrency or prefetch settings configured on the listeners. Please let me know if you need any other information.</div>
<div><br></div><div>Thanks.</div></div>