SwiftMQ 4.x/IBM WebSphere 5.0 IntraVM

Introduction

SwiftMQ 4.0.1 introduces a new intra-VM JMS client and includes a custom service in swiftmq.jar to start SwiftMQ as an intra-VM service in IBM WebSphere 5.0. This has been tested with SwiftMQ 4.0.1 and IBM WebSphere 5.0.

SwiftMQ provides full JMS XA and ASF capabilities to IBM WebSphere 5.0.

Note that you have to use the JMS XA/ASF Swiftlet!

Configuration

SwiftMQ 4.x uses JMS 1.1 but WebSphere 5.0 includes JMS 1.0.2 classes in "lib/j2ee.jar" so you have to delete all "javax/jms" classes out of this jar file. Then copy "jms.jar" from the router's "jars/" directory to WebSphere's "lib/" directory.

The following configuration assumes that you have a SwiftMQ distribution under "d:/temp/swiftmq_4_0_1_jmsplus". We provide examples to the XML configuration of WebSphere 5.0. Of course, you are free to add this configuration via WebSphere's administration console.

You'll find the configuration files in directory "config/cells/<hostname>/nodes/<hostname>/servers/<servername>".

Edit "server.xml" and add this part to the "process:server" element:

    <customServices xmi:id="CustomService_1"
                    enable="true"
                    externalConfigURL="SwiftMQ"
                    classname="com.swiftmq.appserver.was5.SwiftMQService"
                    displayName="SwiftMQ"
                    description="SwiftMQ Service"
                    classpath="d:/temp/swiftmq_4_0_1_jmsplus/jars/swiftmq.jar;
                               d:/temp/swiftmq_4_0_1_jmsplus/jars/dom4j-full.jar">
      <properties xmi:id="Property_10"
                    name="workingdir"
                    value="d:/temp/swiftmq_4_0_1_jmsplus/scripts/win32"
                    description="Working Directory"
                    required="false"/>
      <properties xmi:id="Property_11"
                    name="configfile"
                    value="../../config/router1/routerconfig.xml"
                    description="Router Configuration File"
                    required="false"/>
    </customServices>

It defines the SwiftMQ service to start intra-VM. Next time you start WebSphere, you should see in the SystemOut log file that SwiftMQ has been started.

Edit "resources.xml" and add this part to the "xmi:XMI" element:

    <resources.jms:JMSProvider xmi:id="JMSProvider_1"
                  name="SwiftMQ"
                  externalInitialContextFactory="com.swiftmq.jndi.InitialContextFactoryImpl"
                  externalProviderURL="smqp://intravm/timeout=10000">
      <factories xmi:type="resources.jms:GenericJMSConnectionFactory"
                  xmi:id="GenericJMSConnectionFactory_1" name="SamplePPQCF"
                  jndiName="jms/SamplePPQCF"
                  authMechanismPreference="BASIC_PASSWORD"
                  externalJNDIName="IVMConnectionFactory"
                  type="QUEUE">
        <connectionPool xmi:id="ConnectionPool_12"/>
        <mapping xmi:id="MappingModule_4" mappingConfigAlias="DefaultPrincipalMapping" authDataAlias=""/>
        <sessionPool xmi:id="ConnectionPool_13"/>
      </factories>
      <factories xmi:type="resources.jms:GenericJMSConnectionFactory"
                 xmi:id="GenericJMSConnectionFactory_2"
                 name="QCF"
                 jndiName="Sample/JMS/QCF"
                 authMechanismPreference="BASIC_PASSWORD"
                 externalJNDIName="IVMConnectionFactory"
                 type="QUEUE">
        <connectionPool xmi:id="ConnectionPool_14"/>
        <mapping xmi:id="MappingModule_5" mappingConfigAlias="DefaultPrincipalMapping" authDataAlias=""/>
        <sessionPool xmi:id="ConnectionPool_15"/>
      </factories>
      <factories xmi:type="resources.jms:GenericJMSDestination"
                 xmi:id="GenericJMSDestination_2"
                 name="Q1"
                 jndiName="Sample/JMS/Q1"
                 externalJNDIName="Q1@router1"
                 type="QUEUE"/>
      <factories xmi:type="resources.jms:GenericJMSDestination"
                 xmi:id="GenericJMSDestination_3"
                 name="Q2"
                 jndiName="Sample/JMS/Q2"
                 externalJNDIName="Q2@router1"
                 type="QUEUE"/>
      <factories xmi:type="resources.jms:GenericJMSDestination"
                 xmi:id="GenericJMSDestination_4"
                 name="SampleOutputQueue"
                 jndiName="jms/SampleOutputQueue"
                 externalJNDIName="Q2@router1"
                 type="QUEUE"/>
    </resources.jms:JMSProvider>

It defines the resources (connection factories and queues) for the Point-To-Point example includes in WebSphere. Note that you have to create the queues "Q1" and "Q2" in SwiftMQ before.

That's it! Start WebSphere which starts SwiftMQ intra-VM, deploy your beans and enjoy!