Protected
Retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds parameter enables long-poll support.
Use a bare-bones client and the command you need to make an API call.
import { QueuesClient, ReceiveMessageCommand } from "@stedi/sdk-client-queues"; // ES Modules import// const { QueuesClient, ReceiveMessageCommand } = require("@stedi/sdk-client-queues"); // CommonJS importconst client = new QueuesClient(config);const input = { // ReceiveMessageInput queueUrl: "STRING_VALUE", // required maxNumberOfMessages: Number("int"), visibilityTimeout: Number("int"), waitTimeSeconds: Number("int"), attributeNames: [ // AttributeNameList "All" || "ApproximateFirstReceiveTimestamp" || "ApproximateReceiveCount" || "SenderId" || "SentTimestamp" || "MessageDeduplicationId" || "MessageGroupId" || "SequenceNumber", ],};const command = new ReceiveMessageCommand(input);const response = await client.send(command);// { // ReceiveMessageOutput// messages: [ // MessageList// { // MessageItem// messageId: "STRING_VALUE",// body: "STRING_VALUE",// md5OfBody: "STRING_VALUE",// receiptHandle: "STRING_VALUE",// attributes: { // AttributeMap// "<keys>": "STRING_VALUE",// },// },// ],// };
ReceiveMessageCommandInput
ReceiveMessageCommandOutput
input
response
config
AccessDeniedException (client fault)
ProductUnavailableException (client fault)
ResourceAlreadyExistsException (client fault)
ResourceNotFoundException (client fault)
ResourceUnderChangeException (client fault)
ServiceException (server fault)
QueuesServiceException
Base exception class for all service exceptions from Queues service.
Readonly
Static
Retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds parameter enables long-poll support.
Example
Use a bare-bones client and the command you need to make an API call.
Param
ReceiveMessageCommandInput
Returns
ReceiveMessageCommandOutput
See
input
shape.response
shape.config
shape.Throws
AccessDeniedException (client fault)
Throws
ProductUnavailableException (client fault)
Throws
ResourceAlreadyExistsException (client fault)
Throws
ResourceNotFoundException (client fault)
Throws
ResourceUnderChangeException (client fault)
Throws
ServiceException (server fault)
Throws
QueuesServiceException
Base exception class for all service exceptions from Queues service.