Share this page

# LrSqsMessage.toString

Returns the LrSqsMessage as a String.

`public final String toString()`

## Return values

This API returns a String that represents an LrSqsMessage.

## Example

Copy code

    public void sendMessageByBatch_FIFO(){
     LrSqsClient.initClient(region, fifoQueueUrl);
            LrSqsClient.initMessageBatch();
            LrSqsClient.addMessageToBatch("batch message 0", "group1", "dup1");
            LrSqsClient.addMessageToBatch("batch message 1", "group1", "dup2");

            HashMap<String, LrSqsMessageAttributeValue> messageAttributes = new HashMap<String, LrSqsMessageAttributeValue>();
            messageAttributes.put("attr1", LrSqsClient.createMessageAttributeValueString("my string attribute value"));
            messageAttributes.put("attr2", LrSqsClient.createMessageAttributeValueInt("1234"));

            LrSqsClient.addMessageToBatchEx("batch message 3", "group1", "dup3", "idInBatch1", messageAttributes);

            LrSqsSendMessageBatchRequestStatus batchResponse = LrSqsClient.sendMessageBatch();
            Collection<LrSqsSendMessageBatchStatusEntry> successful_res = batchResponse.successful();

            for (LrSqsSendMessageBatchStatusEntry entry : successful_res){
                lr.output_message("Message sent successfully: " + entry.messageId());
            }

            LrSqsClient.closeClient();
    }

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: