v2.0.0
Rewrite using Rascal as our underlying driver
Breaking Changes
- Underlying driver has changed from forked-version of postwait's
amqpto rascal/amqplib - Queue configuration has changed, see rascal's configuration scheme
- QueueService
* constructor no longer takesqueuesparam, this is setup in the rascal config
*queuesproperty has been removed
*connectis now an async function (no more callback)
* many internal member functions have been removed - QueueWorker
* constructor optionqueueNameis nowsubscriptionName
* constructor requires optionservice(instance of QueueService)
* many internal members have been removed
*initis now an async function (no more callback)
*subscribeis now an async function (no more callback)
*onReadyhas been removed
*onSubscribedno longer has arguments
*onUnsubscribedno longer has arguments
*onMessagesignature has changed to(message, content, ackOrNack)
*onMessageHandledhas been removed
*handleMessagesignature has changed to(message, content, ackOrNack)
*onServiceErrorhas been removed - BatchQueueWorker
* optionbatchSizenow translates to a prefetch of (batchSize * 2), so Async.Cargo can optimally deliver the desired batch size to the app.
*handleMessageBatchhas changed signature to (messages, defaultAckOrNack)
* Messages are wrapped, and can be individually acknowledged viamessages[i].ackOrNack(...). Likewise,defaultAckOrNAck(...)will handle the remaining messages in the batch.
*onMessagesignature has changed to(message, content, ackOrNack)
*onMessageHandledhas been removed
*prepareForShutdownoverride has been removed
Other notable changes:
- QueueService
* Vastly simplified logic, 40% reduction in code thanks to Rascal taking on error handling and recovery
*publishreturns a promise, callback is optional.
* AddedQueueService.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 optionskipInit:trueto not start subscribing upon construction - Updated example app
- Rewrote tests from scratch
- Updated docs