2 Replies Latest reply on Nov 30, 2006 8:47 AM by cump

    Flex JMSAdapter

    cump
      Is the JMSAdapter source available ? I looked through my FDS download and don't see it. I am struggling with getting ActiveMQ to work with Flex and durable subscriptions, and would like to take a look at how the subscription is managed in the adapter.

      Thanks
        • 1. Flex JMSAdapter
          Bill Sahlas Level 1
          We do not make this source code available. Perhaps you can repost more specific questions about your situation (error messages, what your doing at the time of failer, etc) and we can assist.
          • 2. Re: Flex JMSAdapter
            cump Level 1
            Sure.

            I am trying to set up durable subscribers to a single JMS Topic. I am using ActiveMQ 4.0.1 as the messaging system, and running it inside Tomcat 5.5.20.

            In my messaging_config file, for the destination, I have the following entries for the destination:


            <destination id="test_durable">

            <properties>

            <server>
            <!--
            <durable-store-manager>flex.messaging.durability.FileStoreManager</durable-store-manager>
            <max-cache-size>1000</max-cache-size>
            -->
            <message-time-to-live>0</message-time-to-live>
            <durable>true</durable>
            </server>


            <jms>
            <destination-type>Topic</destination-type>
            <message-type>javax.jms.ObjectMessage</message-type>
            <connection-factory>topicConnectionFactory</connection-factory>
            <destination-jndi-name>DurableTopic</destination-jndi-name>
            <destination-name>DurableTopic</destination-name>
            <delivery-mode>PERSISTENT</delivery-mode>
            <message-priority>DEFAULT_PRIORITY</message-priority>
            <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
            <transacted-sessions>false</transacted-sessions>

            <initial-context-environment>
            <property>
            <name>java.naming.provider.url</name>
            <value>tcp://localhost:61616</value>
            </property>
            <property>
            <name>java.naming.factory.initial</name>
            <value>org.apache.activemq.jndi.ActiveMQInitialContextFactory</value>
            </property>
            </initial-context-environment>
            </jms>
            </properties>

            <channels>
            <channel ref="my-rtmp"/>
            </channels>

            <adapter ref="jms"/>

            </destination>


            The JMSAdapter is the out-of-box that came with FDS:

            <adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/>

            I start two browsers and log in. The log-in values are passed in as IDs in the consumer.subscribe() call.
            The Flex clients are just chat clients - modified from the dashboard-chat example. Once logged in, you enter text, and it is displayed in your window and the window of any other client subscribed to the topic.

            This all works fine. Messages flow back and forth, no problem.

            I then close one client (exit the browser), and continue typeing messages from the other. Then I open a new browser, and log back in with the ID I used in the client I closed.

            I expected to see the messages that had been sent from the 2nd browser now being delivered to the one I just subscribed from.
            But that doesn't happen. I does start handling any new messages just fine. Just not the "missed" ones.

            I don't get any error messages. If I uncomment the durable-store-manager and maximum-cache-size, I do get an error relating to the durable store manager: but it seems to me that they are not necessary if you are using JMS, and I still don't get the "missed" messages showing up.

            It could be my bad - misconfiguring, but I'm scratching my head after a few days of trying. So any help you can give would be appreciated.

            Please let me know if I can provide any more information.

            Thanks