IPWorks MQ 2020 Python Edition

Questions / Feedback?

on_message_in Event

Fires when the class receives a message.

Syntax

class AMQPMessageInEventParams(object):
  @property
  def session_name() -> str: ...
  @property
  def session_index() -> int: ...
  @property
  def link_name() -> str: ...
  @property
  def link_index() -> int: ...
  @property
  def message_id() -> str: ...
  @property
  def state() -> int: ...
  @state.setter
  def state(value) -> None: ...

# In class AMQP:
@property
def on_message_in() -> Callable[[AMQPMessageInEventParams], None]: ...
@on_message_in.setter
def on_message_in(event_hook: Callable[[AMQPMessageInEventParams], None]) -> None: ...

Remarks

This event fires whenever the class receives a message. The message itself is automatically stored in the ReceivedMessage* properties.

Specifying a Delivery Outcome

The State parameter can be set to one of the following values to specify what delivery outcome the class should report to the sender (the default is Accepted (0)):
  • 0: Accepted - The message has been processed successfully.
  • 1: Rejected - The message failed to process successfully. Includes an error describing why.
  • 2: Released - The message has not been (and will not be) processed.
  • 3: Modified - Same as "Released", but with additional metadata for the sender.

When State is set to Rejected (1), the class will include error metadata when it informs the sender of the outcome. Set the RejectErrorCondition and RejectErrorDescription configuration settings before the event handler finishes to specify this error information.

When State is set to Modified (3), the class can include additional metadata when it informs the sender of the outcome. Set zero or more of the ModifiedDeliveryFailed, ModifiedMessageAnnotations, and ModifiedUndeliverableHere configuration settings before the event handler finishes to specify this additional metadata.

Other Parameters

SessionName is the name of the session the message was transmitted on.

SessionIndex is the index of the session in the Session* properties.

LinkName is the name of the link the message was transmitted on.

LinkIndex is the index of the link in the Link* properties.

MessageId is the Id of the message; it may be empty if a message Id was not set.

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