-
Notifications
You must be signed in to change notification settings - Fork 25
2.1.0 migration guide
Changes introduced in 2.1.0
related to dead-lettering have updated the way queues are declared. In order to make this change backwards compatible without the need to reconfigure or update your code and avoid AMQP precondition errors on queue declaration, we have changed the default name prefix of listener queues from seneca.
to seneca.add
.
If you are upgrading from an older version and you weren't using default values for transport configuration, you may encounter an error similar to this when starting your microservice:
Error: Channel closed by server: 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - inequivalent arg 'x-message-ttl' for queue 'seneca.cmd:foo.level:bar' in vhost 'oxvvarjc': received the value '60000' of type 'signedint' but current is none"
This is due to new Dead Letter exchange configuration using arguments being set up by default. To mitigate the problem, you got one of three options:
- (recommended) Redeclare your queues. Just delete all your local listener queues and fire up the microservice again. The transport will set everything up for you.
Warning: This is a destructive action. Make sure there are no remaining messages in the queues you delete or that you don't care about them.
-
Rename your queues. If you were manually assigning a name to a listener queue (either via
"listen.queues.prefix"
or thename
option), change it to something else - or don't anymore to let the transport generate one for you. -
Change queue arguments to
null
. If you don't care about dead lettering and want to keep everything as it was before the upgrade, set"*.queues.options.arguments"
tonull
on transport initialization.
require('seneca')()
.use('seneca-amqp-transport', {
amqp: {
listen: {
queues: {
options: {
arguments: null
}
}
},
client: {
queues: {
options: {
arguments: null
}
}
}
}
})
This last option is discouraged.
If you weren't affected by these changes and your microservice works as expected, you may still want to delete old remaining queues (those that start with seneca.
, but not seneca.add
).