Share this page

# LrSqsClient.createMessageAttributeValueBinary

Creates a binary attribute value that can be assigned to a message.

`public static LrSqsMessageAttributeValue createMessageAttributeValueBinary(byte[] bytes)`

`public static LrSqsMessageAttributeValue createMessageAttributeValueBinary(String str)`

## Arguments

Name | Description
--- | ---
bytes | The binary array value of the attribute.
str | The string value to serialize.

## Return values

This function returns an LrSqsMessageAttributeValue object. For details, see LrSqsMessageAttributeValue.

## General information

LrSqsMessageAttributeValue can be used as a value in the key-value pairs of a message attribute.

## Example

Copy code

    public void sendMessageEx(){

        HashMap<String, LrSqsMessageAttributeValue> messageAttributes = new HashMap<String, LrSqsMessageAttributeValue>();
        messageAttributes.put("attrib1", LrSqsClient.createMessageAttributeValueString("my string attribute"));
        messageAttributes.put("attrib2", LrSqsClient.createMessageAttributeValueInt("1234"));
        messageAttributes.put("attrib3", LrSqsClient.createMessageAttributeValueInt(5678));
        messageAttributes.put("attrib4", LrSqsClient.createMessageAttributeValueDouble(56.78));
        messageAttributes.put("attrib5", LrSqsClient.createMessageAttributeValueBinary("string binary to bytes".getBytes()));
        messageAttributes.put("attrib6", LrSqsClient.createMessageAttributeValueBinary("string binary value"));

        LrSqsClient.initClient(region, standardQueueUrl);
        LrSqsClient.sendMessageEx("MessageBody1", 0, messageAttributes);

        LrSqsClient.closeClient();

     }

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