SpinGo / op-rabbit

The Opinionated RabbitMQ Library for Scala and Akka
Other
232 stars 73 forks source link

Rabbitmq connection setup callback #190

Open livius-ungureanu opened 4 years ago

livius-ungureanu commented 4 years ago

Problem:

The ConnectionActor of the rabbitmq-client library offers the possibility to register a connectionSetup callback that is called every time it manages to connect to RabbitMQ. But op-rabbit currently does not expose such a connectionSetup callback in the RabbitControl constructor so it should as user's of op-rabbit should be allowed to register a connectionSetup callback in order to know when a connection goes up or down.

timcharper commented 4 years ago

Does using GetConnectionActor not solve the problem for you?

livius-ungureanu commented 4 years ago

As op-rabbit user I am interested for example on logging an alarm instantly and asynchronously when the RabbitMQ connection goes down(and this can be achieved only by registering the connectionSetup callback as the connectionSetup registering is propagated into the amqp driver).

Using GetConnectionActor , the user would be forced to regularly query the ConnectionActor state which is not acceptable.