Re: [flexcoders] routeMessageToService and routeMessageToClient
I've made a little bit of progress on this front. As suggested by an Adobe engineer, I created a custom ServiceAdapter that overrides invoke() like so:import flex.messaging.messages.CommandMessage;import flex.messaging.messages.Message ;import flex.messaging.services.MessageService;import flex.messaging.services.ServiceAdapter;public class SimpleCustomAdapter extends ServiceAdapter { @Override public Object invoke(Message message) { MessageService msgService = (MessageService)service; System.out.println( "" + message.getBody().toString() ); msgService.pushMessageToClients(message, true); return null; }Now, the alternate signature for pushMessageToClients accepts a Set of clientIDs as the first parameter. This is what you would use to send a message to a specific client. Now, the next question is how do I know which clients are subscribed to this destination? I think I need to manage subscriptions to the destination so I can keep track of the clientIDs, but the docs are vague about how to do that. Here's what my messaging-config.xml looks like:... ... ... ...-Tom On 7/21/06, m88e24 <[EMAIL PROTECTED]> wrote: The selector attribute of the Consumer class allows messages to be filtered based on information in the header of the message. The downside is that a message is always delivered to all clients which is inefficient and is also a potential security hazard. I just want to deliver a message to a single client from a server side Java class. Both methods, routeMessageToService and routeMessageToClient, are missing from the Flex Java API. The routeMessageToService obviously routes messages to all clients connect to the same destination. It maybe very likely that the routeMessageToClient will route the message to a single peer. But the methods needs a MessageClient which is also missing from the Java doc. With some googling I found a Java doc which contains a very terse definition of the MessageClient. But only very terse and of no use to someone who doesn't now the Flex internals. Is there any example or some more verbose documentation on how to use these classes. Much appreciate any help. __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] routeMessageToService and routeMessageToClient
I'm in the same boat, looking for the same information. The only help I can provide is regarding selectors: the filtering happens server-side, so only consumers that have subscribed using that selector will receive the message. We still want a way to be able to send a message to a specific client (like client.call() in FMS2), and there's got to be a better way than using selectors.-TomOn 7/21/06, m88e24 < [EMAIL PROTECTED]> wrote: The selector attribute of the Consumer class allows messages to be filtered based on information in the header of the message. The downside is that a message is always delivered to all clients which is inefficient and is also a potential security hazard. I just want to deliver a message to a single client from a server side Java class. Both methods, routeMessageToService and routeMessageToClient, are missing from the Flex Java API. The routeMessageToService obviously routes messages to all clients connect to the same destination. It maybe very likely that the routeMessageToClient will route the message to a single peer. But the methods needs a MessageClient which is also missing from the Java doc. With some googling I found a Java doc which contains a very terse definition of the MessageClient. But only very terse and of no use to someone who doesn't now the Flex internals. Is there any example or some more verbose documentation on how to use these classes. Much appreciate any help. __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
[flexcoders] routeMessageToService and routeMessageToClient
The selector attribute of the Consumer class allows messages to be filtered based on information in the header of the message. The downside is that a message is always delivered to all clients which is inefficient and is also a potential security hazard. I just want to deliver a message to a single client from a server side Java class. Both methods, routeMessageToService and routeMessageToClient, are missing from the Flex Java API. The routeMessageToService obviously routes messages to all clients connect to the same destination. It maybe very likely that the routeMessageToClient will route the message to a single peer. But the methods needs a MessageClient which is also missing from the Java doc. With some googling I found a Java doc which contains a very terse definition of the MessageClient. But only very terse and of no use to someone who doesn't now the Flex internals. Is there any example or some more verbose documentation on how to use these classes. Much appreciate any help. Yahoo! Groups Sponsor ~--> Yahoo! Groups gets a make over. See the new email design. http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM ~-> -- 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 <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/