send method

  1. @override
Future send(
  1. String? correlationId,
  2. MessageEnvelope envelope

Sends a message into the queue.

  • correlationId (optional) transaction id to trace execution through call chain.
  • envelope a message envelop to be sent. Return (optional) Future that receives null for success. Throws error


Future send(String? correlationId, MessageEnvelope envelope) async {
  envelope.sent_time =;
  // Add message to the queue
  counters.incrementOne('queue.' + getName() + '.sent_messages');
  logger.debug(envelope.correlation_id, 'Sent message %s via %s',
      [envelope.toString(), toString()]);