3 Replies Latest reply on May 28, 2008 12:40 PM by ccustine

    MQ & Triggers

    swampcritter

      Currently where I am working -- one of the developers created an in-house file transmission application (aka 'fileman') that uses dynamic ports to send data back and forth between different systems. The problem is that the software is not very stable and also a security nightmare as you pretty much have to open every port between the base IP on two or more servers. And to make matters worse, the original programmer never documented the 'fileman' code nor how it actually works.

       

      Coming from an IBM MQ Series background, I was hoping of possibly using Active MQ (or FUSE Message Broker) as a way to get rid of this old file application transference and dependence on cron and use something that would be a bit more secure, stable and easier to work with.

       

      My question is 'Can Active MQ be setup to use triggers' -- i.e. when a message is sent by a remote client interface to the MQ broker, can the local queue/topic discover the inbound message and trigger an outside process that can dump the message from the queue (or topic)?

        • 1. Re: MQ & Triggers
          bsnyder

           

          My question is 'Can Active MQ be setup to use triggers' -- i.e. when a message is sent by a remote client interface to the MQ broker, can the local queue/topic discover the inbound message and trigger an outside process that can dump the message from the queue (or topic)?

           

           

          You could certainly achieve this by creating a class that implements the JMS MessageListener so that every time a message arrives on a queue, some action is taken. Inside of class, you are free to do whatever is necessary. The whole point is that this type of event processing can be achieved using a MessageListener. You'd just have to implement the custom functionality.

           

          Bruce

          • 2. Re: MQ & Triggers
            swampcritter

            I found this sample Java program...

            http://www-304.ibm.com/jct09002c/isv/tech/sample_code/mq/JavaTrigger.java

             

            It seems to be more for IBM's Webspehere MQ. Could it be modified for Active MQ needs?

             

            A number of Websphere MQ Java samples:

            http://www-304.ibm.com/jct09002c/isv/tech/sampmq.html

            • 3. Re: MQ & Triggers
              ccustine

              I would suggest taking a look at Fuse Mediation Router / Apache Camel for your scenario.  You can find information about how to configure Camel inside of ActiveMQ here.  Basically you can configure camel to watch for a message on a queue and then route to one of the built in Camel components for transferring files (full list here).  For example, you could take the contents of a message from a queue and save to a local file, use ftp, sftp, and several other options.

               

              If you need more flexibility in configuring the file transfers (dynamic destinations, based on content, etc.) then you may have to get more crafty, but I am fairly certain that Camel going to get you pretty close to you solution.

               

              Chris