amazon-sqs-java-messaging-lib
amazon-sqs-java-messaging-lib copied to clipboard
SQSMessage.JMSMessagePropertyValue fails parsing message attributes on missing or unknown custom type
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:
- String.foo
- Number
- Number.integer or Number.boolean
- Binary
- Binary.foo will cause an JMSException(type + " is not a supported JMS property type")
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:
- String / binary custom types might be disregarded.
- Number missing / unknown type should default to something (long?)
- At least an error should be logged if the message cannot be acknowledged due to
JMSException.