SQS FIFO with JMS fail to add message group ID

0

I am trying to setup a FIFO queue and integrate with our application using Amazon SQS Java Messaging Library. I have implemented is using the tutorial from Amazon " https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/getting-started.html(Getting Started with the Amazon SQS Java Messaging Library) ". For sending message to SQS FIFO queue, it says to setup the message Group ID (mandatory), which I did as follows:

var textMessage: TextMessage = session.createTextMessage(message)
textMessage.setStringProperty("JMSXGroupID", "Default")
          
LOG.info("Message group ID set to" + textMessage.getStringProperty("JMSXGroupID"))
producer.send(textMessage)

But when I run the code, it's throwing an AmazonServiceException with following trace:

from controllers.util.MyClass$ in application-myJob-90 : Caught while putting messages in the queue: AmazonServiceException: sendMessage. RequestId: 12c4b38d-d274-57b2-8f2b-e142d0bec9b3
HTTPStatusCode: 400 AmazonErrorCode: MissingParameter javax.jms.JMSException: AmazonServiceException: sendMessage. RequestId: 12c4b38d-d274-57b2-8f2b-e142d0bec9b3
HTTPStatusCode: 400 AmazonErrorCode: MissingParameter
...class trace...
Caused by: com.amazonaws.AmazonServiceException: The request must contain the parameter MessageGroupId. (Service: AmazonSQS; Status Code: 400; Error Code: MissingParameter; Request ID: 12c4b38d-d274-57b2-8f2b-e142d0bec9b3)

I tried to look for a solution for this but couldn't find any. Any idea what am I missing here?

Feel free to ask for more details if needed. Any help is highly appreciated.

Edited by: pranav8494 on Jan 10, 2018 2:36 AM

질문됨 6년 전1294회 조회
1개 답변
0

Which version of the library are you using? The latest version is 1.0.4 (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-java-message-service-jms-client.html) and support for SQS FIFO queues has been added in version 1.0.2.

Make sure you are not using version older than 1.0.2.

Kuba
답변함 6년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠