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.

gefragt vor 2 Jahren23 Aufrufe
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen