smallrye / smallrye-reactive-messaging

SmallRye Reactive Messaging
http://www.smallrye.io/smallrye-reactive-messaging/
Apache License 2.0
229 stars 174 forks source link

Allow conversion to JsonObject to be optional during amqp message deserialization #2619

Open ylepikhov opened 1 month ago

ylepikhov commented 1 month ago

Documentation states: The connector converts incoming AMQP Messages into Reactive Messaging Message<T> instances. T depends on the body of the received AMQP Message. In case of AMQP Data (with binary content) and the content-type is set to application/json T becomes JsonObject. It might be unwanted. One might want to leave payload as is (without any deserialization/serialization), or use alternative deserialization (Jackson, etc). It will be nice to have a configuration option for AmqpConnetor to disable conversion to JsonObject in case of json content type.

ozangunalp commented 1 month ago

In that case, you can inject io.vertx.amqp.AmqpMessage to the application and unwrap it to access the low level Proton API Message. If you'd like to handle it transparently to the consuming methods, you can implement a MessageConverter.