Thursday 19 January 2012

Apache ActiveMQ with Webphere commerce

  • Download the latest release of Apache ActiveMQ from http://activemq.apache.org/download.html
  • The active-mq setup files are downloaded in zipped
  • Extract the contents of the folder of your choice. E.g. C:\Installs\Apache Software Foundation\apache-activemq-5.4.3\
  • The folder “\apache-activemq-5.4.3\bin” would be considered as the ACTIVEMQ_HOME
  • Navigate to C:\Installs\Apache Software Foundation\apache-activemq-5.4.3\bin in a command window and execute “activemq.bat”.
  • The Active MQ JMS server starts with following startup options
    • Requests are listened at port 61616 by default
      • tcp://127.0.0.1:61616
    • Admin console for administering and monitoring ActiveMQ
      • http://127.0.0.1:8161/admin
  • Hit http://127.0.0.1:8161/admin and you can create and administer the queues. (Not part of the purpose of this tutorial)
    • If you are behind the firewall of a corporate n/w and proxy settings are applied on your Internet connection, please ensure to exclude “localhost” & “127.0.0.1” in the “No proxy for” list in Internet connection settings.
    • Navigate to the admin console and select “Queue” to create the below queues
      • JMSSerialInboundQueue
      • JMSParallelInboundQueue
      • JMSErrorQueue
      • JMSOutboundQueue
  • Now, the JMS provider will be configured in the WAS admin console
    • Place the following jar files in WAS classpath

      C:\IBM\SDP\runtimes\base_v7\lib\ext. These jars will be available in the ACTIVEMQ installation_dir\lib folder
      • activeio-core-3.1.2
      • activemq-core-5.4.3
      • commons-logging-1.1
      • geronimo-j2ee-management_1.1_spec-1.0.1
      • geronimo-jms_1.1_spec-1.1.1
      • geronimo-jta_1.0.1B_spec-1.0.1
      • kahadb-5.4.3
    • Open WAS admin console, navigate to Resources -> JMS -> JMS provider
      • Select Scope --> Node=Localhost, Server=server1
      • Select New
      • Give a name of your choice --> e.g., ActiveMQJMSProvider
      • External initial context factory --> org.apache.activemq.jndi.ActiveMQInitialContextFactory
      • External provider URL --> tcp://127.0.0.1:61616
    • Custom properties required for binding the JNDI name defined in ActiveMQ with the JNDI name defined in WAS (WC-Server.xml)
      • Select “ActiveMQJMSProvider” from JMS Providers(or the one which you created in the previous step)
      • Under “Additional properties” select “Custom properties”
      • Click New and add the following four properties
        • Name – connectionFactoryNames, Value-queueConnectionFactory
        • Name-queue.JMSErrorQueue, Value-JMSErrorQueue
        • Name-queue.JMSOutboundQueue, value-JMSOutboundQueue
        • Name-queue.JMSParallelInboundQueue, value-JMSParallelInboundQueue
        • Name-queue.JMSSerialInboundQueue, value-JMSSerialInboundQueue
    • Configuring ‘Queues’ in WAS admin console – for the queues created in ActiveMQ admin console. (Please use JNDI names of your choice, for simplicity reasons, I’ve used the same JNDI names for defining the physical queues and WAS JNDI binding configuration)
      • JMSErrorQueue
        • Click New
        • Node --> Node=localhost,Server=server1
        • Provider --> ActiveMQJMSProvider
        • Name --> JMSErrorQueue
        • Type --> Queue
        • JNDI Name --> JMSErrorQueue
        • External JNDI Name --> JMSErrorQueue
        • Click Apply and save the configuration
      • JMSOutboundQueue
        • Click New
        • Node --> Node=localhost,Server=server1
        • Provider --> ActiveMQJMSProvider
        • Name --> JMSOutboundQueue
        • Type --> Queue
        • JNDI Name --> JMSOutboundQueue
        • External JNDI Name --> JMSOutboundQueue
        • Click Apply and save the configuration
      • JMSParallelInboundQueue
        • Click New
        • Node --> Node=localhost,Server=server1
        • Provider --> ActiveMQJMSProvider
        • Name --> JMSParallelInboundQueue
        • Type --> Queue
        • JNDI Name --> JMSParallelInboundQueue
        • External JNDI Name --> JMSParallelInboundQueue
        • Click Apply and save the configuration
      • JMSSerialInboundQueue
        • Click New
        • Node --> Node=localhost,Server=server1
        • Provider --> ActiveMQJMSProvider
        • Name --> JMSSerialInboundQueue
        • Type --> Queue
        • JNDI Name --> JMSSerialInboundQueue
        • External JNDI Name --> JMSSerialInboundQueue
        • Click Apply and save the configuration
    • Open WC-Server.xml, enable the MQ specific transport adapter.
      • Navigate to config-->Components-->component@compClassName=“com.ibm.commerce.messaging.listener.TransportAdapter”
      • If attribute enable=”false”, make it to enable=”true”
  • Restart the server, ensure that the ActiveMQ server is started while starting the WAS server.

No comments:

Post a Comment