What is the best string message format for AWS SQS?

Chris Garsonn :

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;
}
Jason Wadsworth :

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.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=20860&siteId=1