> First, is it correct to downcast to CoreMessage?

Only if it actually is an instance of CoreMessage. I recommend you add an
instanceof check to be sure.

> Second, will the bytes be identical to the bytes I put into the JMS
message, or will Artemis add some “framing” around it?

The bytes should be the same as far as I can tell.


Justin

On Wed, Nov 30, 2022 at 8:10 AM John Lilley
<john.lil...@redpointglobal.com.invalid> wrote:

> Greetings,
>
>
>
> I am trying to implement a logging ActiveMQServerPlugin that understands
> how to format the contents of our application messages.  But our clients
> are JMS and our client code makes JMS calls:
>
> BytesMessage m = session.createBytesMessage();
> m.writeBytes(bytes);
>
> When those packets are handled by our server plugin, and I do
>
> public void beforeSend(ServerSession session, Transaction tx, Message
> message, boolean direct, boolean noAutoCreateQueue) {
>
> var cm = (CoreMessage)message;
> var bytes = cm.getDataBuffer().byteBuf().array();
>
> First, is it correct to downcast to CoreMessage?
>
> Second, will the bytes be identical to the bytes I put into the JMS
> message, or will Artemis add some “framing” around it?
>
>
>
> Thanks
>
> John
>
>
>
> [image: rg] <https://www.redpointglobal.com/>
>
> John Lilley
>
> Data Management Chief Architect, Redpoint Global Inc.
>
> 888 Worcester Street, Suite 200 Wellesley, MA 02482
>
> *M: *+1 7209385761 <+1%207209385761> | john.lil...@redpointglobal.com
>
> PLEASE NOTE: This e-mail from Redpoint Global Inc. (“Redpoint”) is
> confidential and is intended solely for the use of the individual(s) to
> whom it is addressed. If you believe you received this e-mail in error,
> please notify the sender immediately, delete the e-mail from your computer
> and do not copy, print or disclose it to anyone else. If you properly
> received this e-mail as a customer, partner or vendor of Redpoint, you
> should maintain its contents in confidence subject to the terms and
> conditions of your agreement(s) with Redpoint.
>

Reply via email to