Posts Tagged amqp

spring amqp tuning

It looked like the spring amqp listenerr wass about 4x slower than a simple client!

sending messages 100000 messages
sent messages
13:{"spring":{"bytes":91479,"messages":4450,"rate":342},"raw":{"bytes":2188890,"messages":100000,"rate":7692}}
23:{"spring":{"bytes":808060,"messages":37236,"rate":1618},"raw":{"bytes":2188890,"messages":100000,"rate":7692}}
34:{"spring":{"bytes":1559932,"messages":71411,"rate":2100},"raw":{"bytes":2188890,"messages":100000,"rate":7692}}
44:{"spring":{"bytes":2188890,"messages":100000,"rate":2380},"raw":{"bytes":2188890,"messages":100000,"rate":7692}}

That’s spring: 2380/s versus raw 7692/s

The amqp SimpleMessageListenerContainer versus a simplistic client with com.rabbitmq.client.QueueingConsumer using com.rabbitmq.client.Channel.basicConsume

Using spring-integration-amqp 2.2.1.RELEASE and rabbitmq amqp-client 3.0.2

I randomly bumped up some settings like so:

<rabbit:listener-container 
    connection-factory="rabbitConnectionFactory" 
    prefetch="500" 
    transaction-size="250"
>

This brought things much more in bounds:

20:{"spring":{"bytes":2188890,"messages":100000,"rate":6250},"raw":{"bytes":2188890,"messages":100000,"rate":7142}}

That’s spring: 6250/s versus raw 7142/s, which is much more reasonable.

CAVEAT: I tried turning up “concurrency” from 1 to 2 and some messages went missing… so… dunna do it!

Leave a Comment