Chris Garsonn
Chris Garsonn

Reputation: 777

What is the best string message format for AWS SQS?

Maybe it is a dumb question but just started to work on Aws Sqs; I want to sent a message to the queue(normal queue/not FIFO), I have a customerDto which has first name,last name and balanceAmount. I want to send these information in a single message and then in another method I want to get that message.

In which format I can send the message? Just send them all together with a custom sign like "+" and then parsing "+" to space character?.. Or Which way is good for listener method to parse properly ?

public class CustomerDto {

    @ApiModelProperty(value = "Name of the user", required = true)
    private String firstName;

    @ApiModelProperty(value = "Last name of the user", required = true)
    private String lastName;

    @ApiModelProperty(value = "Balance", required = true)
    private Long accountBalance;
}

Upvotes: 1

Views: 1986

Answers (1)

Jason Wadsworth
Jason Wadsworth

Reputation: 8887

The most common thing, I believe, would be to serialize your data into a JSON string. It's simple, and every language has a way of dealing with it already.

Upvotes: 4

Related Questions