amazon-sqs-java-messaging-lib icon indicating copy to clipboard operation
amazon-sqs-java-messaging-lib copied to clipboard

SQSMessage.JMSMessagePropertyValue fails parsing message attributes on missing or unknown custom type

Open artamonovkirill opened this issue 7 years ago • 0 comments

SQS message attribute custom type is optional free text.

com.amazon.sqs.javamessaging.message.SQSMessage.JMSMessagePropertyValue.getObjectValue only allows

  • String without custom type: STRING.equals(type)
  • Number with a hard-coded list of customer types: int, Boolean, byte, double, float, long, short.

So, the following message attribute types:

com.amazon.sqs.javamessaging.SQSMessageConsumerPrefetch.processReceivedMessages catches JMSException and does not acknowledge a message with one of the types above without other exception being raised or anything logged.

How I think types should be treated:

  1. String / binary custom types might be disregarded.
  2. Number missing / unknown type should default to something (long?)
  3. At least an error should be logged if the message cannot be acknowledged due to JMSException.

artamonovkirill avatar Jan 04 '18 09:01 artamonovkirill