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