2 Replies Latest reply: Aug 16, 2010 10:47 PM by BKBK RSS

    Event Gateway for Weblogic JMS

    HeyKen93 Community Member

      Hi there, just learning about event gateways in Coldfusion.  After a day playing and reading, I'm still unable to figure out if it is possible, using the default JMS and ActiveMQ event gateway type, to listen to a Oracle Weblogic JMS queue.

       

      When trying to configure a JMS gateway instance to listen to Weblogic JMS queue, I get a "Gateway 'testJMS (examples.JMS.JMSGateway)' has taken more than 30 seconds to start." error.  When I use the ActiveMQ gateway type, I get an "Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [t3]".

       

      I'm no expert on CF event gateway or Weblogic JMS messaging so would appreciate it if someone could tell me if this is even possible using the default supplied gateway types with CF8 or if a custom gateway type has to be built.

       

      Thanks in advance everyone.

        • 1. Re: Event Gateway for Weblogic JMS
          BKBK MVP

          I do believe it is possible. You will need just 2 files: a CFC and a CFG.

           

          I'll refer to 2 pages in the livedocs, namely:

          Developing an event gateway application

          and

          Using the example event gateways and gateway applications

           

          You need the CFC and the CFG(configuration) file to create an instance of the JMS gateway. The CFC is the gateway's listener. You will have to register its full path when you create an instance of the gateway (for example, your 'testJMS') in the Coldfusion administrator.

           

          A simple test example of such a listener CFC contains just one method, namely, onIncomingMessage. The first reference contains an example.

           

          To get an idea of the CFG file, see the example that comes with your Coldfusion installation. You will find it at

           

          {CF_INSTALLATION_DIR}\gateway\config\jmsgateway.cfg

           

          That example works only for JRun Topics, not even Queues. But it contains clues for you. Here's where you have to do some searching.

           

          Search for the Weblogic values for the following.

           

          queueName=name_of_your_Weblogic_queue
          providerURL=a_standard_weblogic_configuration
          initialContextFactory=a_standard_weblogic_configuration
          queueConnectionFactory=name_of_your_Weblogic_queue

           

          Coldfusion will use the providerURL to connect to Weblogic, and the initialContectFactory to know how to fetch queues by name. I once used the following with JORAM(a JMS provider you can loosely compare with Weblogic)

           

          QueueName=myClientService

          providerURL=scn://client.myDomain.com:16400
          initialContextFactory=fr.dyade.aaa.jndi2.client.NamingContextFactory

          QueueConnectionFactory=myClientQConnFactory

           

          Save your own 4 lines(for Weblogic) as, for example,

           

          {CF_INSTALLATION_DIR}\gateway\config\test_jms_gateway.cfg

           

          Then use this full path, together with that of the CFC above to fully define the JMS gateway instance in the administrator. The second reference above shows you the content of the event struct that the listener CFC listens to. For example, whenever a message arrives in the Weblogic queue, the listener CFC will pick it up as arguments.CFEvent.data.msg (assuming you copied the CFC example referenced above).

           

          You will of course want to record the message. Use the cflog tag.

          • 2. Re: Event Gateway for Weblogic JMS
            BKBK MVP

            Anyone tried the suggestions I gave? What was the result?