Closed gnuletik closed 1 year ago
I understand why exposing the channelManager is undesirable, as it might make others depend on a specific private implementation which might change in the future. It might be better to add a connection that supports exposing the actual amqp library for exceptional cases such as only declaring an exchange or something like it. This way it is possible to manage access to them in a unified manner.
Check out the updated API on the main branch. The Conn
is new a separate public struct
Thanks for the change @wagslane !
However, the public Conn
struct does not let me access the underlying amqp.Channel
(which is now stored in github.com/wagslane/go-rabbitmq/internal/connectionmanager.ConnectionManager.channel
).
My usecase for this issue is to let me call QueueDeclare
, ExchangeDeclare
and QueueBind
.
These calls are available in ConnectionManager.QueueBindSafe()
and related funcs.
What would work for my usecase would be to:
internal
to pkg
NewConnFromConnectionManager
with the following signature:
NewConnFromConnectionManager(cm *connectionmanager.NewConnectionManager) (*Conn, error)
For the reference, here is the related commit: https://github.com/wagslane/go-rabbitmq/commit/0df88ac7e9af0ee5cd217e1c3a04729b02b8322c
@wagslane Should I create a new issue for this? Thanks !
Sorry, I think this is something you should just use AMQP for @gnuletik
I did a copy of ConnectionManager
and ChannelManager
in my repo and that works well.
This does exactly what I need.
So, I think that could be quite useful to export these symbols to import these instead of copying.
I did a copy of
ConnectionManager
andChannelManager
in my repo and that works well. This does exactly what I need. So, I think that could be quite useful to export these symbols to import these instead of copying.
I Need to visit QueueDeclare
too. Becase this package cannot declare queue if I want to use default exchange.
Hi !
Thanks for this useful lib! I'm wondering if the
channelManager
struct could be exposed (renamed toChannelManager
) to be imported. It could also be useful to expose the channelManager struct values of Consumer / Publisher.My use case is that I'd like to do manual creation of exchange and queues. I can create a new new AMQP channel but I'd lose the auto reconnect handling of the channelManager.
Thanks!