amqpcat icon indicating copy to clipboard operation
amqpcat copied to clipboard

Auto reconnect producer after connection errors

Open 7underlines opened this issue 3 years ago • 1 comments

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.

Bildschirmfoto vom 2022-11-29 10-24-18

7underlines avatar Nov 29 '22 09:11 7underlines

Are we not implementing heartbeats maybe?

carlhoerberg avatar Jun 10 '25 22:06 carlhoerberg