How to manipulate SendMessageRequest to add MessageAttribute via Reflection when using SDK 2?

0

With Java SDK 1 when sending a message to AWS, we could add a custom MessageAttributeValue after the SendMessageRequest object has been made by calling the addMessageAttributeEntry(String Key, MessageAttributeValue attribute) on the SendMessageRequest object. This could have been done via Reflection.

But with Java SDK 2, the implementation of SendMessageRequest has changed and we cannot add a message attribute after the SendMessageRequest object has already been created. We have to create a new SendMessageRequest object, which we cannot. Because we are manipulating the object via Reflection. Also we cannot 'put' a new Entry into sendMessageRequest.messageAttributes() map because it's of type Unmodifiable.

asked 2 years ago23 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions