High Quality JMS Messaging.

Example 1

This example shows how to create bridges between SwiftMQ and Weblogic JMS 8.1.

The first bridge is of type "local to remote" and connects the SwiftMQ queue "toWLS@router1" with Weblogic's queue "wlsqueue". If a message is send to "toWLS@router1", it will be transfered to "wlsqueue" on the Weblogic server.

The second bridge is of type "remote to local" and connects Weblogic's queue "wlsqueue" with SwiftMQ's queue "fromWLS@router1". If a message is send to "wlsqueue", it will be transfered to "fromWLS@router1" on the SwiftMQ router.

Therefore, if a message is send to "toWLS@router1", it will be transfered to "wlsqueue" on the Weblogic server and immediately transfered back to "fromWLS@router1" on the SwiftMQ router. The following pictures illustrates it:

Preparation

On the Weblogic server:

On the SwiftMQ router (we assume the routername is "router1"):

Step 1: Enable Tracing

It is highly recommended to enable tracing while you define your bridges. To do so, go to the Trace Swiftlet, change the filename of the first predicate of the trace space "swiftlet" to "console" and enable the trace space:

Step 2: Define a Server

Go to the JMS Bridge Extension Swiftlet, click on node "Server" and do a right click. Choose "Create a new Entity". This displays a frame to create a new Server. Just give it a name, e.g. "weblogic", leave it disabled (we will enable it later) and hit "Create":

Step 3: Define JNDI Properties

Expand the "Object Factory" node of the newly created bridge, select "Object Factory Properties":

Do a right click and select "Show Entity Table". A frame is displayed where you can add JNDI properties which is used from the bridge to create a JNDI InitialContext for Weblogic:

Use the "Add" button on the top left corner to add a JNDI property "java.naming.factory.initial" and specify the Weblogic factory:

Add another JNDI property with the "java.naming.provider.url" and specify Weblogic's provider URL:

The frame now lists all JNDI properties you've added; you can close it:

Step 4: Define a bridge from SwiftMQ to Weblogic

Next step is to define a bridge between the local SwiftMQ queue "toWLS@router1" and the remote Weblogic queue "wlsqueue". Select the node "JMS Bridgings", right click and select "Create a new Entity":

A frame is displayed to enter the bridging attributes:

The following table explains the above data:

Field Description
Name "toWLS" is just a name of this bridge.
Bridging Direction Goes from here to Weblogic, so it is "local_to_remote".
Durable Name n/a
Local Destination Name Is the local queue name "toWLS@router1".
Local Destination Type Is "queue".
Remote Factory Name Is the name of the remote connection factory. You've defined "QueueConnectionFactory" in Weblogic and this is what you specify here.
Remote Destination Name Is the remote queue name "wlsqueue".
Remote Destination Type Is "queue".
Transfer Persistence Define "as_source" to leave the persistence setting of a message untouched. You could also define "persistent" or "non_persistent" to change the persistence setting of messages on the fly.

Pushing the "Create" button creates the bridge.

Step 5: Define a bridge from Weblogic to SwiftMQ

Next step is to define a bridge between the remote Weblogic queue "wlsqueue" and the local SwiftMQ queue "fromWLS@router1". Repeat the above procedure to create a new entity:

The following table explains the above data:

Field Description
Name "fromWLS" is just a name of this bridge.
Bridging Direction Goes from Weblogic to here, so it is "remote_to_local".
Durable Name n/a (only required if you connect to a durable subscriber)
Local Destination Name Is the local queue name "fromWLS@router1".
Local Destination Type Is "queue".
Remote Factory Name Is the name of the remote connection factory. You've defined "QueueConnectionFactory" in Weblogic and this is what you specify here.
Remote Destination Name Is the remote queue name "wlsqueue".
Remote Destination Type Is "queue".
Transfer Persistence Define "as_source" to leave the persistence setting of a message untouched. You could also define "persistent" or "non_persistent" to change the persistence setting of messages on the fly.

Pushing the "Create" button creates the bridge.

Step 6: Enable the Server

Everything is defined. Now you are ready to enable the server with its bridgings. To do so, double click the "Enabled" attribute of the server:

The server is now activated. Since you've enabled tracing, you should see it in your console window:

2003-11-10 17:15:39.296/swiftlet/xt$bridge/weblogic/creating objectfactory
      'com.swiftmq.extension.bridge.JNDIObjectFactory'
2003-11-10 17:15:39.296/swiftlet/xt$bridge/weblogic/create bridgings ...
2003-11-10 17:15:39.296/swiftlet/xt$bridge/weblogic/create bridging 'fromWLS' ...
2003-11-10 17:15:39.328/swiftlet/xt$bridge/weblogic/created:
      [DestinationBridge, name=fromWLS, source=[RemoteQueueBridgeSource, queue=wlsqueue],
      sink=[LocalQueueBridgeSink, queue=fromWLS@router1]]
2003-11-10 17:15:39.328/swiftlet/xt$bridge/weblogic/create bridging 'toWLS' ...
2003-11-10 17:15:39.328/swiftlet/xt$bridge/weblogic/created:
      [DestinationBridge, name=toWLS, source=[LocalQueueBridgeSource, queue=toWLS@router1],
      sink=[RemoteQueueBridgeSink, queue=wlsqueue]]

An entry is shown below the "Usage" node as long as the server bridge is active.

Step 7: Send some Test Messages

Send some Messages to "toWLS@router1". You should see the transfer to/from Weblogic and the messages you sent should finally arrive at "fromWLS@router1".

Step 8: Disable Tracing

If everything is ok, the tracing needs to be disabled because it will slow down your bridges a lot. Double click the "Enabled" attribute of the "Swiftlet" trace space:

Step 9: Save your Changes!

Finally and most important you should save your changes now:

The following XML is stored in the routerconfig.xml:

      <swiftlet name="xt$bridge">
        <servers>
          <server name="weblogic" enabled="true">
            <bridgings>
              <bridging name="fromWLS"
                        direction="remote_to_local"
                        localname="fromWLS@router1"
                        remotefactoryname="QueueConnectionFactory"
                        remotename="wlsqueue"
                        remotetype="queue"/>
              <bridging name="toWLS"
                        localname="toWLS@router1"
                        remotefactoryname="QueueConnectionFactory"
                        remotename="wlsqueue"
                        remotetype="queue"/>
            </bridgings>
            <objectfactory>
              <properties>
                <property name="java.naming.factory.initial"
                          value="weblogic.jndi.WLInitialContextFactory"/>
                <property name="java.naming.provider.url"
                          value="t3://localhost:7001"/>
              </properties>
            </objectfactory>
          </server>
        </servers>
      </swiftlet>