FetchMessage Method

Fetches a single message over the specified receiver link.

Syntax

ANSI (Cross Platform)
int FetchMessage(const char* lpszLinkName);

Unicode (Windows)
INT FetchMessage(LPCWSTR lpszLinkName);
- (void)fetchMessage:(NSString*)linkName;
#define MID_AMQP_FETCHMESSAGE 11

IPWORKSIOT_EXTERNAL int IPWORKSIOT_CALL IPWorksIoT_AMQP_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

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.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

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