Skip to content

2.1.0 migration guide

Nicolás Fantone edited this page Oct 16, 2016 · 5 revisions

Important notice: migrate to 2.1.0

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.

Most users won't experience any problems from this. So 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). No further action is required.

However, 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 now 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 the name 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" to null 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 encounter any other problems, please let us know by creating a new issue.

Clone this wiki locally