Thanks Justin!
Since this is only a logger plugin, I just do a lot of checks and ignore 
anything unexpected.  And it works!
John





[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<tel:+1%207209385761> | 
john.lil...@redpointglobal.com<mailto:john.lil...@redpointglobal.com>
From: Justin Bertram <jbert...@apache.org>
Sent: Wednesday, November 30, 2022 9:13 AM
To: users@activemq.apache.org
Subject: Re: JMS bytes vs Artemis CoreMessage bytes

*** [Caution] This email is from an external source. Please use caution 
responding, opening attachments or clicking embedded links. ***

That will only be true for applications using the core JMS client or the 
OpenWire JMS client. If the client application is using the Qpid JMS client it 
won't be a CoreMessage. It will be an AMQPMessage.

Regardless, it's always good to have such checks in place to confirm 
expectations and deal with exceptions gracefully rather than assuming them and 
risking some kind of breaking failure.


Justin

On Wed, Nov 30, 2022 at 10:06 AM John Lilley 
<john.lil...@redpointglobal.com.invalid<mailto:john.lil...@redpointglobal.com.invalid>>
 wrote:
I’ve verified it is indeed a CoreMessage



[rg]<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,xeMun_pF48LdlncyfriKqwXUhjrfV5vB2igeOzj9eFwWWjDDaH6uaED780FGGvmi1dsT1vhkxNnIb0lDe1yGvTRxT8eupHFPHF6U9pyg2xhAcWb7CkdRDg_IjiM,&typo=1>

John Lilley

Data Management Chief Architect, Redpoint Global Inc.

888 Worcester Street, Suite 200 Wellesley, MA 02482

M: +1 7209385761<tel:+1%207209385761> | 
john.lil...@redpointglobal.com<mailto:john.lil...@redpointglobal.com>
From: John Lilley 
<john.lil...@redpointglobal.com.INVALID<mailto:john.lil...@redpointglobal.com.INVALID>>
Sent: Wednesday, November 30, 2022 8:42 AM
To: users@activemq.apache.org<mailto:users@activemq.apache.org>
Subject: RE: JMS bytes vs Artemis CoreMessage bytes

*** [Caution] This email is from an external source. Please use caution 
responding, opening attachments or clicking embedded links. ***

Thanks Justin!

If I send a JMS BytesMessage, should that end up being a CoreMessage in the 
server?

john



<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

John Lilley 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

Data Management Chief Architect, Redpoint Global Inc. 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

888 Worcester Street, Suite 200 Wellesley, MA 02482 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

M: +1 7209385761 | john.lil...@redpointglobal.com 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
From: Justin Bertram <jbert...@apache.org>
Sent: Wednesday, November 30, 2022 8:33 AM
To: users@activemq.apache.org
Subject: Re: JMS bytes vs Artemis CoreMessage 
bytes<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
*** [Caution] This email is from an external source. Please use caution 
responding, opening attachments or clicking embedded links. 
***<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
> First, is it correct to downcast to 
> CoreMessage?<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
Only if it actually is an instance of CoreMessage. I recommend you add an 
instanceof check to be 
sure.<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
> Second, will the bytes be identical to the bytes I put into the JMS message, 
> or will Artemis add some “framing” around 
> it?<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
The bytes should be the same as far as I can 
tell.<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
Justin<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
On Wed, Nov 30, 2022 at 8:10 AM John Lilley 
<john.lil...@redpointglobal.com.invalid> 
wrote:<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
Greetings,<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
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:<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
BytesMessage m = session.createBytesMessage();
m.writeBytes(bytes);<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
When those packets are handled by our server plugin, and I 
do<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
public void beforeSend(ServerSession session, Transaction tx, Message message, 
boolean direct, boolean noAutoCreateQueue) 
{<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
var cm = (CoreMessage)message;
var bytes = 
cm.getDataBuffer().byteBuf().array();<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
First, is it correct to downcast to 
CoreMessage?<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
Second, will the bytes be identical to the bytes I put into the JMS message, or 
will Artemis add some “framing” around 
it?<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
Thanks<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
John<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>
 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

John Lilley 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

Data Management Chief Architect, Redpoint Global Inc. 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

888 Worcester Street, Suite 200 Wellesley, MA 02482 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

M: +1 7209385761 | john.lil...@redpointglobal.com 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

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. 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

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. 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

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. 
<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.redpointglobal.com%2f&c=E,1,HR3BXNxA_AN54I5go7bLBDNS8_Ow4YpGhKkXgNdbs0CAwSFA7HRIHuryB-cZ6z2DPGQGSkOsJWuBBmAb-Dxo2HrsaDAXjem-22EI3TcBmzD0&typo=1>

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