- mitigate degraded performance as a result of refactoring consumer tag uniqueness
- calling
queue.consume(onMessage, {consumerTag})with existing consumer tag throwsSmqpError. The previous behaviour effectively bypassed the unique consumer tag check leaving a lingering consumer munching messages.
- prove provenance and get green-outlined-cake-checkbox-badge by publishing with github actions
Belt and suspenders release.
- allow recover messages without properties
- make sure recovered message without fields is ok
- small breaking change when it comes to instantiate a new message - fields object is required
- use optional chaining (?) and nullish coalescing (??) where feasible since it's widely available, in nodejs since v14
- shovel on event listener function takes consumer options
- export Message type as class
- export Consumer type as class
- document shovel
- some ticks saved by letting the queue queue a published message rather than handing it over to internal
exchange._publishToQueueto queue the published message - es5 trailing commas touched all files
- get returns false if there is no consumable message on queue, as stated in doc
- make sure api is exposed as expected
- export MessageMessage and ShovelOptions from fussy type declarations
- attempt to fix whiny type declarations
- no need to sort single binding or consumer by priority or if priority is not supplied
- stop emitting queue
messageevent when message is queued, no listeners AFAIK
- exchange-, shovel-, and queue name are read-only
- stop emitting exchange
bindandunbindevents, no listeners AFAIK broker.getConsumer(consumerTag)requires consumer tag to be a string
- replace entities arrays with
new Map()to gain some performance - fix API.md
getRoutingKeyPatternexample, destructing a method from an prototyped instance doesn't work - run through markdown examples with texample
- using prettier for formatting rules was mistakenly considered a production dependency. Now it is back where it belong.
- major update of eslint
- use prettier for formatting rules, touched basically ALL files
broker.getConsumers()now also returns if the consumer is ready or not. Cannot remember why, but the info is there
- export Message, Queue, Consumer, and Exchange
- allow queue event options
queue.on(event, handler[, options]) - cancelling a consumer returns true if consumer was found and false if not
broker.get(queueName, { noAck: true })not only dequeues message it also marks the actual message as consumed on the, until now, undocumentedmessage.pendingflag- fix other inconsistent message pending stuff
- introduce
SmqpError(message, code)inherited from Error, it is thrown when package specific errors occur. It is also exported so that instance can be checked - no more general errors, either it is a
TypeErrororSmqpError - fix inconsistent cancel consumer implementations in queue, add requeue argument when applicable
- noAck consumer continues consuming if error is thrown in message callback, the error is, hopefully, caught somewhere else
- ack consumer continues consuming if error is thrown in message callback after message was acked
- add some Broker, Queue, Exchange, Shovel, and Consumer argument constraints
- fix exchange to exchange binding type
- shovel ignores shoveling if destination exchange lacks bindings, could be breaking if cloneMessage function option was used to make things happen
- abide to new lint rules
- bump all dev dependencies
- type declare broker state from
getState()
- no need to type declare that a function can return undefined, prevents assigning a typed variable
- return undefined instead of false if deleting non-existing queue
- return undefined instead of false if no message on queue.get
- Fix queue recover not returning instance of Queue when recovering without state
- and some typing blunders
- Fix type declaration forbidden override and boolean typo. Introduce circular type import in Shovel, which apparently is ok!?
- Add type declarations
- Turn into module with exports for node
- Rename symbol declarations for no reason at all
- Minor performance tweek by prototyping routing key patterns
- Stop building node 12
- Lint some
- Message functions
ack,nack, andreject, if deconstructed, must be called with call or apply since they are no longer bound to instance. Sacrificed in the name of performance, sorry about that - Internal Message function
consumeis renamed to_consume - Internal and/or undocumented functions are renamed and decorated with underscore, some where even - highly unnecessary - Symbols
exchange.bindrenamed toexchange.bindQueueto mitigate JavaScript confusion- consequentely the
exchange.unbindfunction is renamed toexchange.unbindQueue broker.cancel(consumerTag)signature changed tobroker.cancel(consumerTag[, requeue = true]). This breaks current behaviour for ack consumers, i.e. messages waiting for ack will be requeued by default if the consumer is cancelled. For some reason they were requeued in the previous version, even though nackAll was called? For no-ack consumers this won't have an affect at all
*.get()returnsfalseif no message was retrieved
- Fix inconsistent cancel consumer behaviour between broker, queue, and consumer
- minor, probably futile, tweaks
- give a hint of which Queue throws circular JSON when getting state
- no side effects
Slimmer state
- Add argument to
getStatethat tells the broker to only return stuff that actually has content, i.e. messages and undelivered exchange messages
Attempt to tweak performance by removing stuff. Consequently some things broke.
- Remove support for node 10 (mochas fault)
- Message property
consumerTagis removed, can be found bymessage.fields.consumerTag - Message property
messageIdis removed, can be found bymessage.properties.messageId - Remove
onMessageQueuedargument fromqueue.queueMessagefunction - Remove
queue.dequeueMessage(message)function - Change routing key pattern hash (#) handling to
/.*?/from/.+?/
- Fix pattern matching bug if more than one wildcard
For performance reasons the Broker has been prototyped. Thank you @roberto-naharro and co for discovering and resolving this (#5). This means that functions cannot be deconstructed and called without binding or using call/apply.
Slimmer and swifter state.
getState: Only use JSON-fns when really necessary (= messages)- Stop dead lettering messages when queue is deleted. Did some deep forrest coverage hunting and found no scenario when this has ever worked, maybe since it isn't part of RabbitMQ behaviour
Coverage hunting.
- Stop consumers when queue is stopped
- Remove setter for message consumerTag
- Sometimes you need the name of the event, especially if you listen with wildcards. The name is an exact match of the emitted message routing key.
Confirm messages and node 10 and above.
- Drop nodejs 8 support, or at least for tests due to mocha
- New message confirm option, will emit
message.nack,message.ack, ormessage.undeliveredon broker - Support offing broker events by consumerTag
- Support offing exchange events by consumerTag
- Add broker function
getConsumers()to get the list of consumer properties
- Ignore published message if no one is listening, unless it is mandatory
- Support changing destination exchange key in shovel
- Support overwriting shoveled message properties
- Support passing source binding priority to shovel or bound exchange
createShovelhas changed signature: last argumentcloneMessageis converted to anargsobject, andcloneMessagemoved to a property ofargs
- Introduce e2e by
bindExchangeand consequentalyunbindExchange, shoveling messages between exchanges
- Fix consumer eventlistener not working at all due to messed up binary code
- Close shovel if source consumer is closed
- Introduce shovel, shoveling messages between brokers
- Support message expiration and queue
messageTtl
- Acked messages were sent to dead letter exchange, they shouldn't, and are not anymore
- Add ability to reset everything, i.e. queues, exchanges, consumers you name it
- Support turning off queue event listener -
queue.off(eventName, handler)
subscribeOncealso takes priority option, as it should've from the beginning
- Support turning off event listener with
off(eventName, handler)
- Non-persistent message, message option
persistent = false, will not be recovered when recovering from state
- A recovered queue with messages always considers messages redelivered, regardless if queue was stopped or not
- Export
getRoutingKeyPattern
- Expose broker owner
sendToQueuehas changed signature: argumentroutingKeyis omitted, since it had nothing to do there anyhow- Message in message callback has changed:
- introduced new property named
fields .routingKeyis moved tofields.routingKeyalong with new and freshexchangeandconsumerTagproperties.optionsis renamed to.properties
- introduced new property named