MessageIn Event

Fires when the class receives a message.

Syntax

ANSI (Cross Platform)
virtual int FireMessageIn(AMQPMessageInEventParams *e);
typedef struct {
const char *SessionName;
int SessionIndex;
const char *LinkName;
int LinkIndex;
const char *MessageId;
int State; int reserved; } AMQPMessageInEventParams; Unicode (Windows) virtual INT FireMessageIn(AMQPMessageInEventParams *e);
typedef struct {
LPCWSTR SessionName;
INT SessionIndex;
LPCWSTR LinkName;
INT LinkIndex;
LPCWSTR MessageId;
INT State; INT reserved; } AMQPMessageInEventParams;
- (void)onMessageIn:(NSString*)sessionName :(int)sessionIndex :(NSString*)linkName :(int)linkIndex :(NSString*)messageId :(int*)state;
#define EID_AMQP_MESSAGEIN 7

virtual INT IPWORKSMQ_CALL FireMessageIn(LPSTR &lpszSessionName, INT &iSessionIndex, LPSTR &lpszLinkName, INT &iLinkIndex, LPSTR &lpszMessageId, INT &iState);

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 C++ Edition - Version 20.0 [Build 8155]