Comments (11)
Hi @mortdiggiddy,
I'm not getting much time to work on amqplib features at the moment, but if you or anyone else wanted to give it a go, the best starting place would be to familiarise yourself with how amqplib generates the RabbitMQ operation definitions.
There's a script called generate-defs which is called from the makefile. This downloads an old version of the RabbitMQ code generation spec from before update-secret was added.
You could try updating the makefile to download the latest spec is here and see if the tests still pass, then work out how to add the updateSecret method to the callback model and channel model. The RabbitMQ spec says update-secret returns a confirmation, so it should expect a reply.
from amqplib.
Hi @mortdiggiddy,
I've added an updateSecret method to both the callback and promise apis on this branch. Are you able to checkout the brandh and confirm everything works as you expect please?
await connection.updateSecret(Buffer.from('new secret'), 'some reason');
Because update-secret is a RabbitMQ extension you don't WireShark decodes both the operation and reply as Connection.Unknown
from amqplib.
I will be testing locally here in the next few days. Just adding this comment here for traceability.
The test will involve periodic OAUTH OpenID Connect token fetch from an IAM server, which dumps it into a running Rabbit MQ 3.12 Docker container instance equipped with the rabbitmq_auth_backend_oauth2 plugin.
Under normal conditions when this plugin is enabled and an RPC publish, send_to_queue, etc is invoked on AmqpConnectionManager from amqp-connection-manager (which delegates to amqplib) a 403 ACCESS_REFUSED error is thrown. This is one of the critical errors, which requires a closure of the client and all channels attached to it. A new client and channel must be created.
If this update is working, we can update the access token before expiration, and all is well.
It will be up to developers to integrate some type of automatic refresh mechanism that periodically checks for tokens approaching expiration, so that the update-secret method can be invoked before it expires with a new token. If operating entirely on the backend, this can be handled by REDIS using keyspace notifications, and using a SETEX to automatically expire a token when it reaches about 80% of its TTL (safety factor). Once the token is gone from REDIS, a notification can be sent to trigger the refresh.
from amqplib.
Any luck with the testing @mortdiggiddy?
from amqplib.
So far so good, a few more test and I will update this.
from amqplib.
Related Issues (20)
- no error event on createChannel since V10.0.0 HOT 1
- Consider removing `readable-stream`? HOT 1
- Fanout delivery acknowledgement on channel 1 timed out HOT 6
- Set a custom header before nack-ing a message HOT 5
- No Error emitted when Queue disappears or is deleted HOT 2
- SDK connecting without errors after RabbitMQ service is shut down HOT 9
- Error emitted before handler is attached causes "Unhandled 'error' event" HOT 3
- consume does not respect promises? HOT 5
- Trailing dot in URL causes TLS failure HOT 2
- docs: channel api github page has broken top links HOT 2
- docs: confusing and inconsistent usage of terms "bork", "splode", "close" HOT 7
- global prefetch become 0 if per-consume prefetch set HOT 2
- ERR_SSL_EMS_NOT_ENABLED HOT 6
- How to determine if channel.ack() is successful? HOT 2
- CPU intensive controller prevents AMQP connection from receiving heartbeat, hence connections gets closed. HOT 2
- How to know if message is published ? HOT 6
- Aborting a Message Processing when RMQ Channel Closes HOT 8
- I'm encountering an "Unexpected close" error HOT 2
- Module not found: Can't resolve 'querystring' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amqplib.