IPWorks IoT 2020 Python Edition

Questions / Feedback?

on_message_out Event

Fires when a message is published.

Syntax

class AMQPClassicMessageOutEventParams(object):
  @property
  def channel_name() -> str: ...
  @property
  def exchange_name() -> str: ...
  @property
  def routing_key() -> str: ...
  @property
  def message_id() -> str: ...
  @property
  def delivery_tag() -> int: ...
  @property
  def accepted() -> bool: ...

# In class AMQPClassic:
@property
def on_message_out() -> Callable[[AMQPClassicMessageOutEventParams], None]: ...
@on_message_out.setter
def on_message_out(event_hook: Callable[[AMQPClassicMessageOutEventParams], None]) -> None: ...

Remarks

This event fires anytime a message is published; or after an outgoing message has been acknowledged by the server, if the channel it was published on is in "publish confirmations" mode.

ChannelName reflects the name of the channel the message was published on.

ExchangeName reflects the name of the exchange the message was published to. (If the message was published to the server's default exchange, whose name is always the empty string, ExchangeName will also be empty.)

RoutingKey reflects the routing key that the message was published with.

MessageId reflects the message's unique Id, if one was set.

DeliveryTag reflects the channel-specific delivery tag number for the message. (Note that this is only populated for messages published on a channel in "publish confirmations" mode; otherwise it will be set to -1.)

Accepted indicates whether the server published back a positive True or negative False acknowledgement for the outgoing message. Note that this is only valid for messages published on a channel in "publish confirmations" mode; Accepted will always be True messages published on a channel in normal or transaction mode.

Refer to enable_publish_confirms for more information about channels in "publish confirmations" mode.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 Python Edition - Version 20.0 [Build 8265]