Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite using Rascal as our underlying driver
# Breaking Changes * Underlying driver has changed from forked-version of postwait's `amqp` to rascal/amqplib * Queue configuration has changed, see rascal's configuration scheme * QueueService * constructor no longer takes `queues` param, this is setup in the rascal config * `queues` property has been removed * `connect` is now an async function (no more callback) * many internal member functions have been removed * QueueWorker * constructor option `queueName` is now `subscriptionName` * constructor requires option `service` (instance of QueueService) * many internal members have been removed * `init` is now an async function (no more callback) * `subscribe` is now an async function (no more callback) * `onReady` has been removed * `onSubscribed` no longer has arguments * `onUnsubscribed` no longer has arguments * `onMessage` signature has changed to `(message, content, ackOrNack)` * `onMessageHandled` has been removed * `handleMessage` signature has changed to `(message, content, ackOrNack)` * `onServiceError` has been removed * BatchQueueWorker * option `batchSize` now translates to a prefetch of (batchSize * 2), so Async.Cargo can optimally deliver the desired batch size to the app. * `handleMessageBatch` has changed signature to (messages, defaultAckOrNack) * Messages are wrapped, and can be individually acknowledged via `messages[i].ackOrNack(...)`. Likewise, `defaultAckOrNAck(...)` will handle the remaining messages in the batch. * `onMessage` signature has changed to `(message, content, ackOrNack)` * `onMessageHandled` has been removed * `prepareForShutdown` override has been removed Other notable changes: * QueueService * Vastly simplified logic, 40% reduction in code thanks to Rascal taking on error handling and recovery * `publish` returns a promise, callback is optional. * Added `QueueService.generateConfigFromQueueNames(queueNames, config)` helper to generate Rascal vhost config given array of queue names. * QueueWorker * Vastly simplified logic, 35% reduction in code thanks to Rascal taking on the complexities * BatchQueueWorker * Simplified logic, 30% reduction in code thanks to Rascal * constructor now takes option `skipInit:true` to not start subscribing upon construction * Updated example app * Rewrote tests from scratch * Updated docs
- Loading branch information
1 parent
5989940
commit 2b42704
Showing
18 changed files
with
1,532 additions
and
3,458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.