One way to do it would be to copy the message.  The body on the message
copy should be writable.

On Wednesday, February 24, 2016, davyv <[email protected]>
wrote:

> I'm working on a project where I connect clients over MQTT and subscribers
> over JMS to an activeMQ instance.
>
> For saving data (Wireless 3G) over the MQTT connection, I am compressing
> the
> data in the MQTT client. And now I'm trying to figure out a way to
> decompress the data.
> I was looking to create a custom decompression interceptor to deploy into
> the activeMQ instance, however I ran into some issues. I override the
> 'send'
> method from the BrokerFilter. And try to replace the content with a
> decompressed bytearray.
>
>
> And the activeMQ configuration:
>
>
>
> I keep getting the exception that the message (BytesMessage) body is
> write-only, so I'm unable to read the content
> ('bytesMessage.readBytes(buffer)').
>
> Is an interceptor in activeMQ the best option for this? And how would this
> best be implemented? Does activeMQ have anything else for this? Or is the
> JMS client a better option?
>
> If a use an interceptor? When exactly is this executed? Are there charts
> that show the flow of an interceptor? What happens when implementing more
> than one interceptor? What is the order that they are called?
>
> As far as I can find in the specs, MQTT does not have an option in the
> protocol to compress the connection. However if anyone knows a standard
> option for this.
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/MQTT-To-JMS-Payload-de-compression-tp4708209.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>


-- 
Hiram Chirino
Engineering | Red Hat, Inc.
[email protected] | fusesource.com | redhat.com
skype: hiramchirino | twitter: @hiramchirino

Reply via email to