Reputation: 1657
I have been looking for documentation on this;
I have configured my connectionfactory w/ requestedHeartbeat property, but is there anyway for me to verify the heartbeat is actually being sent short of altering the class to add logging?
Any information appreciated, thanks.
Upvotes: 1
Views: 666
Reputation: 15296
The quick and dirty way I would probably use to verify this is temporarily add code to have the consumer worker deliberately block for longer than the heartbeat interval, i.e. via a Thread.sleep
call, and verify that the RabbitMQ server doesn't whack the connection. Then let it continue and make sure that it is actually able to continue as expected (i.e. process the message as usual and then ack it).
i.e. if you set a 10 sec heartbeat, have the consumer worker sleep for a minute. The connection should remain active, as the Java rabbitmq client should respect the heartbeat setting and be sending out the heartbeat at the specified interval.
Upvotes: 2