Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Problem with Flex Messaging using JMS


Level 1
Hi Friends,

I have started working on flex recently and got problem while
implementing Flex Chat application using JMS adaptor. I was able to
successed making it work with Flex Action Script, but I need have
my chat application with JMS. Here I am posting the details about
how I have done the chat application for JMS.

I am using Tomcat 5.5.25, Flex 2 and ActiveMQ 4.4 M4.

my WEB-INF/flex/messaging-config.xml with destination as



<adapter-definition id="jms"



<destination id="chat-topic-jms">





























<channel ref="my-rtmp"/>


<adapter ref="jms"/>



my WEB-INF/classes/jndi.properties file

java.naming.factory.initial =

# use the following property to configure the default

java.naming.provider.url = tcp://localhost:61616

# use the following property to specify a class path resource
or URL

# used to configure an embedded broker using the XML
configuration file

#brokerXmlConfig = file:src/conf/sample-conf/default.xml

# use the following property to specify the JNDI name the
connection factory

# should appear as.

connectionFactoryNames = connectionFactory,
queueConnectionFactory, topicConnectionFactory

# register some queues in JNDI using the form

# queue.[jndiName] = [physicalName]

# queue.MyQueue = example.MyQueue

# register some topics in JNDI using the form

# topic.[jndiName] = [physicalName]

# topic.MyTopic = example.MyTopic

topic.FlexChatTopic = chat.Topic


in my web.xml file I have added




finally my mxml file

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="




import mx.messaging.messages.AsyncMessage;

import mx.messaging.messages.IMessage;

import mx.controls.Alert;

private function send():void


var message:IMessage = new AsyncMessage();

Alert.show("msg dst >> "+message.toString());

message.body.chatMessage = msg.text;


msg.text = "";


private function messageHandler(message:IMessage):void


Alert.show("msg recived >> "+log.text);

log.text += message.body.chatMessage + "\n";




<mx:Producer id="producer"

<mx:Consumer id="consumer" destination="chat-topic-jms"

<mx:Panel title="Chat" width="100%" height="100%">

<mx:TextArea id="log" width="100%" height="100%"/>


<mx:TextInput id="msg" width="100%" enter="send()"/>

<mx:Button label="Send" click="send()"/>




Please help me.

Thanks in advance



4 Replies


Former Community Member
What exactly is the problem? Turn on debug logging on the
server and let us know if you see any exceptions/errors.


Level 1
Hi Mete Atamel,

The problem here is I am not able to send the message to the
server. There is no error / exception raised.

The same code is working fine when I was using "Flex
Messaging service" with the following changes.

WEB-INF/flex/messaging-config.xml with destination as


<adapter-definition id="actionscript"
default="true" />


<destination id="chat-topic-jms">












<channel ref="my-rtmp"/>




But when I changed the same code to make it work for JMS
adapter, it is not even sending the message to the server itself. I
was not able to understand the actual problem. Can u please tell me
where I was going wrong.

Thanks in advance.




Former Community Member
It's hard to tell what might be wrong. You should turn on
server side debug logging on. Look into services-config.xml,
there's a logging section. Make sure the level is set to "Debug",
run your test again and see what server side logging you get. If
you cannot send messages, there should be more info in the debug
log for why that is happening.


Level 1

Did you ever get this working?  I'm attempting to do a similar thing with Jrun4 -

There is a good article here that might help as your configuration is similar.