Tag Archives: Flex

Enterprise Messaging with JMS, Flex, Spring and ActiveMQ

I finally finished building an enterprise messaging system using Spring, JMS, and ActiveMQ integrated with Flex Messaging from Livecycle Data Services and a clients in both Flex and Java. The Flex-Java(Spring) integration is handled by Anvil for this project.

I plan to re-configure this in a simplified app using BlazeDS, Spring BlazeDS Integration with Spring, ActiveMQ, Flex, JMS and putting the source code here for a test drive in Tomcat, unless SpringSource beats me to the punch ;)

I probably won’t finish this for at least a month though since I’m still tuning the Spring/ActiveMQ configuration for enterprise use cases.

Share/Save

Spring BlazeDS Integration

I went through the reference docs and quickly set up a basic implementation using Livecycle Data Services and one thing quickly occurred to me just in reading the docs:

Here is an easy test drive from Christophe at Adobe.

I hope I am not taking the statement, “the FlexRemotingServiceExporter will be able to work transparently..” out of context but the sample below from the reference docs adds a layer of complexity to spring configuration. Example: I have 100 java services wrapping dao’s etc, configured in Spring, plus their flex handler services to pipe the remoting calls. Wrapping each service in a FlexRemotingServiceExporter adds to configuration mayhem. Could we simply declare the FlexRemotingServiceExporter, annotate the services as @RemoteService or new similar type of annotation that wires it to FlexRemotingServiceExporter as a wrapper, where it does its job allowing dynamic creation of remoting destinations? But by the sample below it would add a lot of overhead to massive enterprise apps such as the one I am currently working on. We are partnering with Adobe on our framework, and I had just proposed to write a Spring Extension for this when 2 weeks later read the press release, so I look forward to seeing this module develop.

From: Spring BlazeDS Integration Reference Guide

Code:
<!-- Expose the productService bean for BlazeDS remoting -->
<bean id="product" class="org.springframework.flex.messaging.remoting.FlexRemotingServiceExporter">
    <property name="messageBroker" ref="mySpringManagedMessageBroker"/>
    <property name="service" ref="productService"/>
</bean>

Would it help to set a parent a bean and save the implementors from adding the wrapper to each?

Code:
<bean name="fxExporter" abstract="true" "class="org.springframework.flex.messaging.remoting.FlexRemotingServiceExporter">
     <property name="messageBroker" ref="mySpringManagedMessageBroker"/>
</bean>

and then set
<bean id="product" parent="fxExporter" class="org.springframework.flex.messaging.remoting.FlexRemotingServiceExporter">
    <property name="service" ref="productService"/>
</bean>

I know this is just the first foundation release so this is just a suggestion (cutting down on configuration as you can already do dynamic destinations for java-flex at present). What i AM looking forward to is the JMS module with Flex Messaging. I’ve got this working now with Flex -Livecycle Data Services – AMQ – JMS, and hope this module will simplify implementations going forward.

Share/Save