High Quality Enterprise Messaging.

Getting Started

Requirements

JDK/JRE 1.5 or higher is required. To make all scripts work contained in the distribution, the "java" executable must be in your PATH. To check this, call

    java -version

If the Java VM starts and displays its version number, then it's ok. Otherwise, put your JDK/JRE "bin" directory into your PATH environment variable.

Install

Download SwiftMQ Router and SwiftMQ Client and unpack it.

Start SwiftMQ Router

Open a shell/command window, switch to <routerinstall>/scripts/<platform> and call

    ./smqr1

The SwiftMQ Router is now running and the AMQP Swiftlet listens on port 5672 (plain) and 5671 (SSL/TLS). Since it uses native message transformer by default, there is no further configuration required.

Run the Request/Reply Example

Open a new shell/command window and switch to <clientinstall>/samples/amqp and start the replier sample program:

    ./starter ReplierNonTransacted

    Host        : localhost
    Port        : 5672
    Source      : testqueue
    Number Msgs : 100
    QoS         : EXACTLY_ONCE
    Auth as Anon: true
    User        : null
    Password    : null

Open another shell/command window and switch to <clientinstall>/samples/amqp and start the requestor sample program:

    /starter RequestorNonTransacted

    Host        : localhost
    Port        : 5672
    Target      : testqueue
    Number Req  : 100
    QoS         : EXACTLY_ONCE
    Auth as Anon: true
    User        : null
    Password    : null

You should now see request/reply output of 100 requests/replies in both windows.

Run a mixed Pub/Sub AMQP/JMS Example

This requires to configure the JMS-Mapping transformers for the topic destination. Make sure the router is shutdown (Ctrl/C in the shell/command window).

The following configuration snippet defines the JMS-Mapping transformers for topic "testtopic". This is required in order to have JMS clients understand the messages sent from AMQP clients. Replace it in <routerinstall>/config/router1/routerconfig.xml:

    <swiftlet name="sys$amqp">
      <declarations>
        <connection-templates>
          <connection-template name="ssl" socketfactory-class="com.swiftmq.net.JSSESocketFactory"/>
        </connection-templates>
        <transformer>
          <default-inbound-transformers>
            <default-inbound-transformer name="0">
              <properties/>
            </default-inbound-transformer>
          </default-inbound-transformers>
          <default-outbound-transformers>
            <default-outbound-transformer name="0">
              <properties/>
            </default-outbound-transformer>
          </default-outbound-transformers>
          <destination-transformers>
            <destination-transformer name="testtopic">
              <inbound-transformers>
                <inbound-transformer name="0"
                  class-name="com.swiftmq.impl.amqp.amqp.v01_00_00.transformer.JMSMappingInboundTransformer">
                  <properties/>
                </inbound-transformer>
              </inbound-transformers>
              <outbound-transformers>
                <outbound-transformer name="0"
                  class-name="com.swiftmq.impl.amqp.amqp.v01_00_00.transformer.JMSMappingOutboundTransformer">
                  <properties/>
                </outbound-transformer>
              </outbound-transformers>
            </destination-transformer>
          </destination-transformers>
        </transformer>
      </declarations>
      <listeners>
        <listener name="amqp">
          <host-access-list/>
        </listener>
        <listener name="amqps" connection-template="ssl" port="5671">
          <host-access-list/>
        </listener>
      </listeners>
    </swiftlet>

Open a new shell/command window and switch to <clientinstall>/samples/amqp and start the AMQP receiver sample program:

    ./starter ReceiverNonTransacted localhost 5672 testtopic

    Host        : localhost
    Port        : 5672
    Source      : testtopic
    Number Msgs : 100
    QoS         : EXACTLY_ONCE
    Auth as Anon: true
    User        : null
    Password    : null

Open a second shell/command window and switch to <clientinstall>/samples/router_network and start the JMS subscriber sample program:

    ./starter PubSubSubscriber smqp://localhost:4001 plainsocket@router1 testtopic 100

    The following parameters are used:

    SMQP-URL       : smqp://localhost:4001
    TCF Name       : plainsocket@router1
    Topic Name     : testtopic
    Number Messages: 100

Open a third shell/command window and switch to <clientinstall>/samples/amqp and start the AMQP sender sample program:

    ./starter SenderNonTransacted localhost 5672 testtopic

    Host        : localhost
    Port        : 5672
    Target      : testtopic
    Number Msgs : 100
    QoS         : EXACTLY_ONCE
    Auth as Anon: true
    User        : null
    Password    : null

You should now see 100 messages sent from an AMQP sender on a topic received by a JMS subscriber and an AMQP receiver simultaneously. The other direction is also possible, JMS publisher and AMQP receiver.