yeah that absolutely makes sense, thanks Tom!

I was able to answer my own question.  In my original post I didn't
realize that the selector attribute of the Consumer component filtered
messages on the server side.  So, Stefan, if you want see what I'm
talking about, check out the sample chat application supplied with the
FDS installation.  In the chat.mxml file, change this line:

<mx:Consumer id="consumer" destination="chat-topic-jms"
message="messageHandler(event)"/>

by adding a selector attribute:

<mx:Consumer id="consumer" destination="chat-topic-jms"
message="messageHandler(event)" selector="room='Lobby'"/>

and then in the send() function, add a message header called room with
a value of "Lobby" like so:

            public function send():void
            {
                  var message:AsyncMessage = new AsyncMessage();
                  message.headers.userId = userId;     
                  message.headers.msg = msg.text;
                  message.headers.room = "Lobby";
                  producer.send(message);
                  msg.text="";
            }

So, you'll have just one destination called chat-topic-jms, but that
destination can serve multiple rooms by using a selector.  The server
only sends messages to clients that are both subscribed to that
destination and have specified a matching selector.  Let me know if
that makes sense.

Thanks,

Tom



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to