LrSqsMessage.messageId

Retrieves the message ID.

public final String messageId()

Return values

This function returns a String representing the message ID.

Example

Copy code
public void lrsqsMessage(){
        LrSqsClient.initClient(region, standardQueueUrl);
        
        LrSqsMessage message = LrSqsClient.receiveMessage();
        if (message != null) {
            lr.output_message("messageID: " + message.messageId());
            lr.output_message("body: " + message.body());
            lr.output_message("receiptHandle: " + message.receiptHandle());
            lr.output_message("md5OfBody: " + message.md5OfBody());
            lr.output_message("md5ofAttributes: " + message.md5OfAttributes());
            lr.output_message("Full LrSqsMessage: " + message.toString());

     if (message.hasSystemAttributes()) {
            Map<String, String> sustemAttrib = message.systemAttributesAsStrings();
            Map<LrSqsMessageSystemAttributeName, String> sustemAttrib_name = message.systemAttributes();
            }

            if (message.hasAttributes()) {
                  Map<String, LrSqsMessageAttributeValue> userAttrib = message.attributes();    
            }
        }
        LrSqsClient.closeClient();
 }