hi ,

I am trying to intercept a message in Artemis using my own interceptor code,
but when i intercept the message a i make a copy of the message so the
consumer still receives the actual message on the other end of Artemis.

i make a copy as follows:

*if (packet instanceof SessionSendMessage) {
                SessionSendMessage realPacket = (SessionSendMessage) packet;
                Message msg = realPacket.getMessage();
                Message msgCopy = msg.copy();
                ByteBufInputStream inputStream = new
ByteBufInputStream(msg.getBuffer());
                String output = inputStream.readLine();
                inputStream.close();*

Now after i made a copy of the message and put it in a stream, the string
returned should a json string of the payload sent by the producer. But the
"*String output*" has some Artemis Appended values(at least that is what i
think) in the beginning and ending of the string 

Sample is :

Beginning of the String - êØ{"companyId":"4711"
Ending of the string - 123"}}]}aesôŽ1 (Yè›Sj0þßÜ

how do i get the pure raw message body instead of these garbage values
appended to it?

P.S: the message at the end, near the consumer is totally fine, but the
interceptor is the one that has this issue.

Please advise ASAP.

Thank you,
Chandra



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Reply via email to