* @param jmsMessage Message to be converted
* @return Corresponding SQSMessage instance
* @throws MessageBoxException
*/
public SQSMessage jmsMessageToSQSMessage(Message jmsMessage) throws MessageBoxException {
SQSMessage sqsMessage = new SQSMessage();
TextMessage textMessage = (TextMessage) jmsMessage;
try {
sqsMessage.setDefaultVisibilityTimeout(
Long.parseLong(textMessage.getStringProperty(
MessageBoxConstants.JMS_MESSAGE_PROPERTY_VISIBILITY_TIME_OUT)));
sqsMessage.setMd5ofMessageBody(
textMessage.getStringProperty(
MessageBoxConstants.JMS_MESSAGE_PROPERTY_MD5_OF_MESSAGE));
sqsMessage.setBody(textMessage.getText());
sqsMessage.setMessageId(
textMessage.getStringProperty(
MessageBoxConstants.JMS_MESSAGE_PROPERTY_MESSAGE_ID));
sqsMessage.getAttribute().put(
MessageBoxConstants.SQS_MESSAGE_ATTRIBUTE_SENDER_ID,
textMessage.getStringProperty(
MessageBoxConstants.SQS_MESSAGE_ATTRIBUTE_SENDER_ID));
sqsMessage.getAttribute().put(
MessageBoxConstants.SQS_MESSAGE_ATTRIBUTE_SENT_TIMESTAMP,
textMessage.getStringProperty(
MessageBoxConstants.SQS_MESSAGE_ATTRIBUTE_SENT_TIMESTAMP));
sqsMessage.getAttribute().put(
MessageBoxConstants.SQS_MESSAGE_ATTRIBUTE_FIRST_RECEIVE_TIMESTAMP,
textMessage.getStringProperty(
MessageBoxConstants.SQS_MESSAGE_ATTRIBUTE_FIRST_RECEIVE_TIMESTAMP));
sqsMessage.getAttribute().put(
MessageBoxConstants.SQS_MESSAGE_ATTRIBUTE_RECEIVE_COUNT,
textMessage.getStringProperty(
MessageBoxConstants.JMS_MESSAGE_PROPERTY_RECEIVED_COUNT));
return sqsMessage;
} catch (JMSException e) {