amqpcat
amqpcat copied to clipboard
Auto reconnect producer after connection errors
I'm running a producer. After about 10 to 20 minutes I always receive an EOF from server error. Can we somehow get the producer to automatically reconnect?
amqpcat -P -u amqp://user:pass@host:port/vhost -r new.contact -e synchronizer
test1
test2
ERROR - amqp.client.connection: connection closed unexpectedly: End of file reached
End of file reached (IO::EOFError)
from /usr/share/crystal/src/gc/boehm.cr:129:5 in 'read_loop'
from /usr/share/crystal/src/fiber.cr:146:11 in 'run'
from ???
test3
^C
amqpcat -P -u amqp://user:pass@host:port/vhost -r new.contact -e synchronizer
test4
test5
I'm also running a consumer. Here I also get the EOF from server error, but I still get new messages after that so it's not an issue.
amqpcat -C -u amqp://user:pass@host:port/vhost -r new.contact -e synchronizer
test1
test2
ERROR - amqp.client.connection: connection closed unexpectedly: End of file reached
End of file reached (IO::EOFError)
from /usr/share/crystal/src/gc/boehm.cr:129:5 in 'read_loop'
from /usr/share/crystal/src/fiber.cr:146:11 in 'run'
from ???
test4
test5
As you can see test3 is missing in the consumer output.

Are we not implementing heartbeats maybe?