2 Replies Latest reply: Nov 5, 2009 1:18 PM by BKBK RSS

    ApacheMQ JMS gateway not processing messages

    ROudejans Community Member
      I'm trying to use the ActiveMQ JMS gateway of Coldfusion, but messages are not being processed.

      I have created an Gateway instance of type ApacheMQ and specified a CFC that needs to process the incoming messages.
      This CFC should simply write to a log file stating it has received a message.

      I'm sending messages to a queue named "MyQueue" with a Java application, but the CFC never writes anything to the log file.
      ApacheMQ is running and with the Java JConsole.exe I can see the messages that have been sent to the queue (strangely called examples.MyQueue).

      In the Coldfusion administrator I monitor the Gateway instance and I sometimes see the number in the Out column increase.
      Why is the number in the Out column increasing? I expected the number in the In column to increase and the CFC to be invoked.

      What do I need to do to make the Gateway instance invoke the CFC upon message receival?
      I have searched the web for proper JMS gateway documentation but have so far failed to find anything useful.

      My Gateway configuration file contains the following settings:

      #outboundOnly=no
      debug=yes
      topic=no

      providerURL=tcp://localhost:61616
      initialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory
      connectionFactory=ConnectionFactory

      # ActiveMQ requires fake JNDI entries to lookup queue / topic names, e.g.,
      contextProperties=queue.MyQueue
      queue.MyQueue=MyQueue
      destinationName=MyQueue

      # ActiveMQ also supports dynamicQueues and dynamicTopics:
      destinationName=dynamicQueues/TEST.FOO
        • 1. Re: ApacheMQ JMS gateway not processing messages
          PENNY506 Community Member

          It looks like you have devined 2 destinationName values in your config.

           

          Also, from comparing yours to ours, we also have a 'destination={something}' before the first destinationName property.

           

          Hope that helps - you may be targeting an incorrect queue.

           

          Also make sure your cfc has the required onIncomingMessage method and is formatted correctly.

           

          (also try sending a message direct from amq admin console down for that queue - for testing another angle)

          • 2. Re: ApacheMQ JMS gateway not processing messages
            BKBK Community Member
            Why is the number in the Out column increasing? I expected the number in the In column to increase and the CFC to be invoked.

            You expect every message you send in, to eventually come out. What Coldfusion is telling you is that the message was successfully sent, but hasn't yet been processed by the CFC. The usual reason for the CFC to fail is if it, or the configuration file, contains an error.

             

            I think giving 2 values for destinationname in the config file is a mistake. The following should be sufficient

             

            debug=yes
            topic=no

             

            providerURL=tcp://localhost:61616
            initialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory
            connectionFactory=ConnectionFactory


            destinationName=dynamicQueues/TEST.FOO