You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Mark Webb <el...@gmail.com> on 2009/02/05 16:38:59 UTC
sending messages to a topic that program is listening to
I have a group of applications that use JMS to communicate. I would
like to set up a topic for internal control messages (status,
heartbeat..etc). Each of these processes will subscribe to the topic
and send messages to each other periodically. The problem I have is
that if application A sends a message to the topic for application B,
C and D to receive, they are going to receive the message. Is there
an easy way to filter messages in the onMessage(Message) method so
that application A does not receive its own messages?
Or is there a better way to allow applications to communicate with
each other for control messages.
Thanks
Re: sending messages to a topic that program is listening to
Posted by Bill Schuller <Bi...@intuit.com>.
I believe you have to specify your selector as you create your consumer.
On 2/6/09 6:07 AM, "Mark Webb" <el...@gmail.com> wrote:
> OK. I have it all figured out and running. I have looked through the
> API's and cannot find the answer, but can I set the selector criteria
> after the consumer has started?
>
> Thanks
>
>
> On Thu, Feb 5, 2009 at 11:32 AM, Bill Schuller <Bi...@intuit.com>
> wrote:
>> > Here is some more detailed information on message properties and selectors.
>> > The ActiveMQ documentation is a little sparse. Selectors are part of the >>
JMS
>> > API, so they behave the same across broker implementations.
>> >
>> > http://www.informit.com/articles/article.aspx?p=170722&seqNum=2
>> >
>> >
>> > On 2/5/09 9:48 AM, "Bill Schuller" <Bi...@intuit.com> wrote:
>> >
>> > use a selector
>> >
>> > ---
>> > Bill Schuller, Service Foundations Engineering, Intuit Inc.
>> >
>
---------------------------------------------------------------
Bill Schuller, Sr. SW Engineer
Intuit, Inc.
Intuit Ecosystem Platform Service Foundations
+1-214-387-2583, bill_schuller@intuit.com <ma...@intuit.com>
5601 Headquarters Drive, Plano, TX 75024
---------------------------------------------------------------
Re: sending messages to a topic that program is listening to
Posted by Mark Webb <el...@gmail.com>.
OK. I have it all figured out and running. I have looked through the
API's and cannot find the answer, but can I set the selector criteria
after the consumer has started?
Thanks
On Thu, Feb 5, 2009 at 11:32 AM, Bill Schuller <Bi...@intuit.com> wrote:
> Here is some more detailed information on message properties and selectors.
> The ActiveMQ documentation is a little sparse. Selectors are part of the JMS
> API, so they behave the same across broker implementations.
>
> http://www.informit.com/articles/article.aspx?p=170722&seqNum=2
>
>
> On 2/5/09 9:48 AM, "Bill Schuller" <Bi...@intuit.com> wrote:
>
> use a selector
>
> ---
> Bill Schuller, Service Foundations Engineering, Intuit Inc.
>
Re: sending messages to a topic that program is listening to
Posted by Bill Schuller <Bi...@intuit.com>.
Here is some more detailed information on message properties and selectors.
The ActiveMQ documentation is a little sparse. Selectors are part of the JMS
API, so they behave the same across broker implementations.
http://www.informit.com/articles/article.aspx?p=170722&seqNum=2
On 2/5/09 9:48 AM, "Bill Schuller" <Bi...@intuit.com> wrote:
> use a selector
---
Bill Schuller, Service Foundations Engineering, Intuit Inc.
Re: sending messages to a topic that program is listening to
Posted by Bill Schuller <Bi...@intuit.com>.
Implement a header property identifying the source of the message (
setStringProperty(source, ³me²)¹. In your topic subscription, use a
selector like source not me¹ in each of your apps...
On 2/5/09 9:38 AM, "Mark Webb" <el...@gmail.com> wrote:
> I have a group of applications that use JMS to communicate. I would
> like to set up a topic for internal control messages (status,
> heartbeat..etc). Each of these processes will subscribe to the topic
> and send messages to each other periodically. The problem I have is
> that if application A sends a message to the topic for application B,
> C and D to receive, they are going to receive the message. Is there
> an easy way to filter messages in the onMessage(Message) method so
> that application A does not receive its own messages?
>
> Or is there a better way to allow applications to communicate with
> each other for control messages.
>
> Thanks
>
---------------------------------------------------------------
Bill Schuller, Sr. SW Engineer
Intuit, Inc.
Intuit Ecosystem Platform Service Foundations
+1-214-387-2583, bill_schuller@intuit.com <ma...@intuit.com>
5601 Headquarters Drive, Plano, TX 75024
---------------------------------------------------------------