Well, you are using Flex to talk to BlazeDS that is deployed on Tomcat. What version of BlazeDS are you using?
Can you elaborate more on "Flex has to initalize it"? You have a Flex client, so you need to register interest (subscribe) to messaging destination from Flex.
If you are asking:
- How do I push messages from the server (Java) to the Flex then take a look: help.adobe.com/en_US/dataservicesjee/4.6/Developing/WS9d22440892c78ffa-3a437432122a8558cd f-8000Update.html.
- If you are asking how do I setup subscription from a Java, then BlazeDS does not support it (unless ofcourse you are using a JMS destination -- see documentation for how to that). The latest release of Data Services v4.6, ships with various remoting and messaging clients in Java, Andriod, iOS, HTML5/JS and lots of other features, that allow you to do this.
Can you clarify what exactly you need? Hope that helps.
I am asking question #1. How do I push messages from a Java server to Flex.
I am using the most recent version of BlazeDS and a very recent version of Tomcat. BlazeDS was downloaded within the last couple of days. Tomcat is 6.0.29.
The link you posted is giving me a 404 Not Found error.
Consider for instance the example in Tour de Flex under Flex Data Access / Messaging Service / Basic Authentication - with Tomcat (NEW). It describes very nicely what to do on the Flex side, and what to do with the Tomcat configuration files. I just don't know what to do in the Java itself to cause the subscription to be invoked in Flex.
I'm guessing that this is a very simple question. It may be one of those that is so simple, people who already know how to do it are assuming that everyone else does, too.
With respect to subscribing from java, see how the consumer subscribe happens from flex (the source code for Consumer class is viewable in FB). You will have to basically emulate that in your java code. Roughly it means doing the following:
1. Authenticate your self, and ensure that user principal gets set on the FlexContext.
2. Create a Subscription Command message (with appropriate values like client id etc.) and pass to the MessageBroker.routeCommandToService(subscriptionCmd, null).
Works like a charm. That URL shows just what I needed.