activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Bertram <jbert...@apache.org>
Subject Re: Removing values appended by Artemis in message body when doing a message copy in Interceptor
Date Thu, 15 Mar 2018 18:27:42 GMT
What version of Artemis are you using?  It looks like 1.x.  However, even
in 1.x the org.apache.activemq.artemis.api.core.Message interface (which is
what is returned by
org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionSendMessage.getMessage())
doesn't have a method named copy() or getBuffer().  Please clarify exactly
what you're doing.


Justin

On Thu, Mar 15, 2018 at 1:05 PM, cnadukula <cnadukula@gmail.com> wrote:

> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message