activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lionel Cons <lionel.c...@cern.ch>
Subject How can we get/set the message body in an Artemis transformer?
Date Wed, 09 May 2018 08:11:44 GMT
The Transformer interface uses the Message class. It is very easy to get/set
message properties. See for instance [1].

The Message class only contains deprected methods to get the message body
(getBodyBuffer() and getBodyInputStream()) and nothing to set it.

How can we set/get the message body from a transformer?

Here is a typical use case: the body contains a binary payload that needs to
be decoded and replaced by an equivalent JSON payload.

Cheers,

Lionel

[1] https://github.com/apache/activemq-artemis/blob/master/examples/features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/AddForwardingTimeTransformer.java

Mime
View raw message