publish abstract method

void publish(
  1. Object message,
  2. String routingKey, {
  3. MessageProperties properties,
  4. bool mandatory = false,
  5. bool immediate = false,
})

Publish message to the exchange. message should be either a Uint8List, a String, a Map or Iterable. If message is Map or Iterable it will be encoded as JSON and the appropriate message properties (content-type and content-encoding) will be set on the outgoing message. Any other message value will trigger an ArgumentError.

You may specify additional message properties by setting the properties named parameter.

If the mandatory flag is set, the server will return un-routable messages back to the client. Otherwise the server will drop un-routable messages.

if the immediate flag is set, the server will immediately return undeliverable messages to the client if it cannot route them. If the flag is set to false, the server will queue the message even though there is no guarantee that it will ever be consumed.

Implementation

void publish(Object message, String routingKey,
    {MessageProperties properties,
    bool mandatory = false,
    bool immediate = false});