-
Notifications
You must be signed in to change notification settings - Fork 372
Add support for SQS custom data types #410
Comments
@AbdulWahedHaiderzadah1217 how do you see this support should look like? |
Maybe when there is a custom data type like e.g. binary.png - a value for header should be just wrapper like: CustomTypeMessageAttribute with fields: type: Binary, typeLabel: png, value - wrapped value handled in the same way as it is currently for basic Binary (or String or Number) type. |
@maciejwalkowiak, @AbdulWahedHaiderzadah1217 if You are happy with solution with CustomTypeMessageAttribute wrapper then I can make it working that way... |
@maciejwalkowiak, I'd like to help with that one. IMHO its quite important to have it done, as lack of proper handling of custom data types may force people to workarounds. I could create initial PR. I think that for this one, I will have to extend documentation a bit to mention about |
Go for it @voytech. I can't tell for sure now but the idea with wrapper sounds legit. |
After thinking a bit more, I am not sure if using
|
What if we go with 2. but with addition that for |
You mean:
Or:
I think both are equally ok (should be better than is now) The only thing that I personally don't like here - is lack of consistency in that sometimes we are using CustomTypeMessageAttribute for MessageAttributes with labeled types, but there are situations for Number with labelled type where we cannot use CustomTypeMessageAttribute (number type labels for primitives/Java Number classses already supported). Scenario: Because of above - for 2.3 - I think I would prefer not to use CustomTypeMessageAttribute at all. I would just support Binary and String with custom type labels not fully - by unwrapping ByteBuffer for Binary and String value, putting them straight as header value (with loosing custom type label info). For Numbers support is present. Then I think I would consider (on major version e.g. 3) to add MessageAttributeValue (not CustomTypeMessageAttribute) for all MessageAttributes. And getMessageAttribute method on SqsMessageHeaders (If SqsMessageHeaders are going to stay). |
…ributes. Fix spring-atticgh-410 [v2]. This is another approach to solve spring-atticgh-410. First approach is here: spring-attic#633. Original issue and discussion is here: spring-attic#410
Currently custom data types are silently ignored during transformation from MessageAttributes to MessageHeaders in QueueMessageUtils. Either custom data types should be supported fully or an Exception should be thrown.
If somebody uses SQS custom data type, which currently can only hold String or Binary values, it will get omitted in QueueMessageUtils and finding out why can be very time consumeing since it is omitted silently.
The text was updated successfully, but these errors were encountered: