Skip to content

Auto reconnect producer after connection errors #9

@7underlines

Description

@7underlines

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions