You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Antsa <ad...@teamware.com> on 2009/03/06 03:00:05 UTC

Using properties with BytesMessage with XML content

Using ActiveMQ, I want to send UTF8 encoded XML.  BytesMessage seems the most
appropriate although the JMS javadocs state that TextMessage is for XML - (I
disagree as UTF8 is not 'text', i.e. a sequence of chars in Java, it's a
sequence of bytes - this is like using application/xml instead of text/xml -
but I digress...).

Anyway, the javadocs also state

"Although the JMS API allows the use of message properties with byte
messages, they are typically not used"

I want to add properties because I want the consumers to be able to use
selectors (rather than consuming all messages and discarding the ones they
don't want)

I've read various post in places on this subject, but as I'm new to JMS and
am using ActiveMQ, wanted to know what others experience of this is.

TIA
Antony


-- 
View this message in context: http://www.nabble.com/Using-properties-with-BytesMessage-with-XML-content-tp22364812p22364812.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Using properties with BytesMessage with XML content

Posted by Andreas Gies <ag...@progress.com>.
hi...

i can understand your point from a theoretical point of view.
This having said, i never ran into problems using TextMessages for XML  
documents.
If your clients are distributed across different geograhical regions  
and use different encoding
there *might* be an issue, but you can come around those as well.

With repect to the properties:

Use them as you see fit. Not using properties for BytesMessages: I  
believe this has been said because
the properties are most often related to the message content and that  
might be hard to determine for bytesMessages.
If you can set properties that can be used for proper selection I  
would advise to do so.

Hope that helps
Andreas
On Mar 6, 2009, at 3:00 AM, Antsa wrote:

>
> Using ActiveMQ, I want to send UTF8 encoded XML.  BytesMessage seems  
> the most
> appropriate although the JMS javadocs state that TextMessage is for  
> XML - (I
> disagree as UTF8 is not 'text', i.e. a sequence of chars in Java,  
> it's a
> sequence of bytes - this is like using application/xml instead of  
> text/xml -
> but I digress...).
>
> Anyway, the javadocs also state
>
> "Although the JMS API allows the use of message properties with byte
> messages, they are typically not used"
>
> I want to add properties because I want the consumers to be able to  
> use
> selectors (rather than consuming all messages and discarding the  
> ones they
> don't want)
>
> I've read various post in places on this subject, but as I'm new to  
> JMS and
> am using ActiveMQ, wanted to know what others experience of this is.
>
> TIA
> Antony
>
>
> -- 
> View this message in context: http://www.nabble.com/Using-properties-with-BytesMessage-with-XML-content-tp22364812p22364812.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

---
Mit freundlichen Grüssen - Kind Regards
Andreas Gies
Principal Consultant
Open Source Center of Competence

Progress Software GmbH
Agrippinawerft 26
50678 Köln

E-Mail      	agies@progress.com
Direct Line 	+49 (0)9953 980349
Mobile      	+49 (0)170 5759611
Skype        	+44 (0)20 3239 2922
Skype       	+353 (0)1 443 4971
Skype       	+1 (0)781 262 0168

http://www.progress.com
http://fusesource.com
http://open-source-adventures.blogspot.com



-------------------------------------------------------
Progress Software GmbH
Sitz der Gesellschaft: Agrippinawerft 26, 50678 Koeln;
Niederlassung: Fuerstenrieder Str. 279, 81377 Muenchen
Amtsgericht Koeln, HRB 15620; 
Geschaeftsfuehrung: David Ireland
-------------------------------------------------------