IPWorks IoT 2020 JavaScript Edition

Questions / Feedback?

MessageReturned Event

Fires if a previously published message is returned by the server due to it being undeliverable.

Syntax

amqpclassic.on('MessageReturned', listener: (e: {readonly channelName: string, readonly replyCode: number, readonly replyText: string, readonly exchangeName: string, readonly routingKey: string}) => void )

Remarks

This event fires if the server returns a previously published message because it could not deliver it. Typically, messages are only undeliverable in one of the following situations:

  • The message was originally published with the Mandatory option enabled, but there were no queues it could be routed to.
  • The message was originally published with the Immediate option enabled, but there were no consumers it could be delivered to immediately on any queue it was routed to (or there were no queues it could be routed to).

The ReceivedMessage* properties will be populated with the returned message.

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

ReplyCode will be an AMQP error code that indicates the reason why the message was returned. (Tip: The AMQPClassic class's Error Codes page includes the various AMQP error codes.)

ReplyText will be a message with further details about why the message was returned.

ExchangeName reflects the name of the exchange to which the message was originally published. (If the message was originally 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 originally published with.

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