From: gk on
http://download.oracle.com/docs/cd/E17477_01/javaee/5/api/javax/jms/Message.html


JMS messages are composed of the following parts:

Header - All messages support the same set of header fields. Header
fields contain values used by both clients and providers to identify
and route messages.

Properties - Each message contains a built-in facility for supporting
application-defined property values. Properties provide an efficient
mechanism for supporting application-defined message filtering.

Body - The JMS API defines several types of message body, which cover
the majority of messaging styles currently in use.



I don't understand the Properties section. It says .."Properties
provide an efficient mechanism for supporting application-defined
message filtering....".

Could you please elaborate how it works the application-defined
message filtering ? Is it something that Application ID is put into
the Properties and receiver can find that whether message is intended
for the receiver or not ? are they talking about this kind of
filtering ?


From: Jean-Baptiste Nizet on
On 1 juil, 06:22, gk <src...(a)gmail.com> wrote:
> http://download.oracle.com/docs/cd/E17477_01/javaee/5/api/javax/jms/M...
>
> JMS messages are composed of the following parts:
>
> Header - All messages support the same set of header fields. Header
> fields contain values used by both clients and providers to identify
> and route messages.
>
> Properties - Each message contains a built-in facility for supporting
> application-defined property values. Properties provide an efficient
> mechanism for supporting application-defined message filtering.
>
> Body - The JMS API defines several types of message body, which cover
> the majority of messaging styles currently in use.
>
> I don't understand the Properties section. It says .."Properties
> provide an efficient mechanism for supporting application-defined
> message filtering....".
>
> Could you please elaborate how it works the application-defined
> message filtering ? Is it something that Application ID is put into
> the Properties and receiver can find that whether message is intended
> for the receiver or not ?  are they talking about this kind of
> filtering ?

Yes they are.

See http://download.oracle.com/docs/cd/E17477_01/javaee/5/tutorial/doc/bnceh.html#bncer
and the section about selectors in
http://download.oracle.com/docs/cd/E17477_01/javaee/5/api/javax/jms/Message..html

To give you a concrete example on how it might be useful : the project
I'm working on involves multiple servers listening on the same message
queue. Multiple servers are needed to be able to sustain the load.
Every message posted in the queue concerns one location, identified by
a location code. And all the messages for a location must be handled
sequentially. We thus have a listener on a first server listening for
messages for locations A, B and C, while we have a second listener on
the second server listening for messages for locations D, E and F. We
do that by setting a property "locationCode" on each message posted in
the queue. The first listener has the selector "locationCode IN ('A',
'B', 'C')", and the second one has the selector "locationCode IN ('D',
'E', 'F')".

JB.
From: gk on
On Jul 1, 12:53 pm, Jean-Baptiste Nizet <jni...(a)gmail.com> wrote:
> On 1 juil, 06:22, gk <src...(a)gmail.com> wrote:
>
>
>
>
>
> >http://download.oracle.com/docs/cd/E17477_01/javaee/5/api/javax/jms/M...
>
> > JMS messages are composed of the following parts:
>
> > Header - All messages support the same set of header fields. Header
> > fields contain values used by both clients and providers to identify
> > and route messages.
>
> > Properties - Each message contains a built-in facility for supporting
> > application-defined property values. Properties provide an efficient
> > mechanism for supporting application-defined message filtering.
>
> > Body - The JMS API defines several types of message body, which cover
> > the majority of messaging styles currently in use.
>
> > I don't understand the Properties section. It says .."Properties
> > provide an efficient mechanism for supporting application-defined
> > message filtering....".
>
> > Could you please elaborate how it works the application-defined
> > message filtering ? Is it something that Application ID is put into
> > the Properties and receiver can find that whether message is intended
> > for the receiver or not ?  are they talking about this kind of
> > filtering ?
>
> Yes they are.
>
> Seehttp://download.oracle.com/docs/cd/E17477_01/javaee/5/tutorial/doc/bn....
> and the section about selectors inhttp://download.oracle.com/docs/cd/E17477_01/javaee/5/api/javax/jms/M...
>
> To give you a concrete example on how it might be useful : the project
> I'm working on involves multiple servers listening on the same message
> queue. Multiple servers are needed to be able to sustain the load.
> Every message posted in the queue concerns one location, identified by
> a location code. And all the messages for a location must be handled
> sequentially. We thus have a listener on a first server listening for
> messages for locations A, B and C, while we have a second listener on
> the second server listening for messages for locations D, E and F. We
> do that by setting a property "locationCode" on each message posted in
> the queue. The first listener has the selector "locationCode IN ('A',
> 'B', 'C')", and the second one has the selector "locationCode IN ('D',
> 'E', 'F')".
>


very nice. I guess corelation ID also be an example of this then ?
Anyway, you example was quite helpful.

Thanks for your time and post.