You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using the RabbitMQ OAuth 2.0 authentication backend, and therefore connecting to the broker with access tokens. These tokens can expire, so I have a wrapper around the publishing function that looks somewhat like this:
The issue is that when calling func after updating the secret, a ChannelInvalidStateError is raised, since the channel was closed. Adding await asyncio.sleep(0.01) before trying to call func again fixes the issue, but seems a bit hacky. Is there some mechanism for waiting until the channel is open again?
The text was updated successfully, but these errors were encountered:
You should know that every error that is occurring in an AMQP connection will force the connection to be closed. Thus it is normal, that the robust connection will try to establish another connection again after the current one has been closed due to this error.
We are using the OAuth2 backend as well, but have slightly different approach. Since the access token normally includes information about its own expiration one can easily calculate the absolute expiry in time themselves and check for this condition to renew the token BEFORE any subsequent operation is executed in the AMQP connection.
Thus you can always be sure that you have a fresh token before triggering an AMQP operation.
Hi, I'm using the RabbitMQ OAuth 2.0 authentication backend, and therefore connecting to the broker with access tokens. These tokens can expire, so I have a wrapper around the publishing function that looks somewhat like this:
The issue is that when calling
func
after updating the secret, aChannelInvalidStateError
is raised, since the channel was closed. Addingawait asyncio.sleep(0.01)
before trying to callfunc
again fixes the issue, but seems a bit hacky. Is there some mechanism for waiting until the channel is open again?The text was updated successfully, but these errors were encountered: