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.

質問済み 2年前23ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ