moveToDeadLetter method

  1. @override
Future moveToDeadLetter(
  1. MessageEnvelope message

Permanently removes a message from the queue and sends it to dead letter queue.

  • message a message to be removed. Return (optional) Future that receives or null for success. Throws error


Future moveToDeadLetter(MessageEnvelope message) async {
  if (message.getReference() == null) {
    return null;

  int lockedToken = message.getReference();

  counters.incrementOne('queue.' + getName() + '.dead_messages');
  logger.trace(message.correlation_id, 'Moved to dead message %s at %s',
      [message, toString()]);