Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Producer and Consumer JMS Connections

Avatar

Level 1
Hello,



I am writing a JMS provider and I notice that Flex creates a
JMS connection for a Producer and another JMS connection for a
Consumer in my test application. Is this normal behavior for Flex
or do I have a problem with my provider that is causing this?



Thanks,



Chris Shafer, George Weiss Associates
4 Replies

Avatar

Level 1
It'd be nice if it shared a connection ;)

Avatar

Former Community Member
The JMS adapter that ships with the FDS/LCDS uses unique JMS
connections for consumers and producers. This is due to J2EE
restriction that states that JMS connections can have one active
JMS session. A JMS session can be used to receive messages or send
messages but not both. So there's no way, at least within J2EE, to
have JMS producer and consumer to share the connection.

Avatar

Level 2
If your goal is to have one JMS Consumer which receives
messages and broadcasts them to Flex clients, you can do this
without using the JMS adapter. Write some Java code either as a
"message driven bean" or using the JMS apis directly to grab the
JMS messages. You can then convert these messages to flex messages
and send them to an ActionScriptAdapter flex messaging destination.
See the Feed.java sample for the code necessary to do this. The
trickiest part of this is getting the JMS messages in the first
place. We are working on packaging up our JMS consumer apis so you
can do this more easily in a future release.