IPWorks MQ 2020 Node.js Edition

Questions / Feedback?

FetchMessage Method

Fetches a single message over the specified receiver link.

Syntax

amqp.fetchMessage(linkName, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

When FetchMessage is called, the class will supply the sender with a single credit and then block until a message is received (if the FetchTimeout property is set to zero).

If FetchTimeout is non-zero, the class will only block for the specified number of seconds; once that time expires, it will instruct the sender to consume the credit. If the sender chooses to consume the credit by incrementing the value of the LinkDeliveryCount property rather than by sending a message, then the class will throw an error indicating a timeout.

LinkName specifies the receiver link which should fetch a message; if there is no such link, if the specified link is not a receiver link, or if the specified receiver link is not operating in rmSyncGet (1) mode, an error is thrown.

Refer to ReceiveMode and FetchTimeout for more information.

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