Posted on

Configuring JMS endpoints with WebSphere MQ

websphere mq configuring jms destinations

Configuring JMS endpoints with WebSphere MQ

You can configure both the Queue and Topic destinations for the WebSphere MQ messaging provider. In this section, we introduce how to create and configure a WebSphere MQ Queue destination. To configure a Queue destination for the WebSphere MQ messaging provider, complete the following steps:

  1. Click Resources > JMS> Queues. In the Queues window, click Scope (we will use Server scope in this sample), and then click New.
  2. Select the WebSphere MQ messaging provider option, and enter the following basic properties:

 websphere mq configuring jms destinations

Click OK. The new Queue is created. Save the changes to the master configuration.

Posted on

Configuring Websphere MQ

configuring websphere mq message broker

Configure Websphere MQ Messaging Provider

The WebSphere MQ JMS provider maps to the WebSphere MQ messaging system which is one of the most widely used message-oriented-middleware (MOM) product in the industry. It has been available for many years and is widely used to integrate applications on disparate platforms. The key runtime artifact in WebSphere MQ is called a Queue Manager.

Since WebSphere MQ is not part of WebSphere Application Server, its Queue Managers run in separate processes and are separately administered through the WebSphere MQ Queue Manager.

In order to proceed with Websphere MQ configuration, you need to download a trial of it at: http://www-947.ibm.com/support/entry/portal/downloads/software/websphere/websphere_mq\

Create Websphere MQ basic objects

In order to connect to WebSphere MQ messaging provider we will show at first how to create some basic MQ objects. The following commands can be executed from the MQ_HOME/bin folder.

To create a new Queue Manager called MQQueueManager issue the following command:

crtmqm MQQueueManager

Now start the Queue Manager named MQQueueManager by typing the following command:

strmqm MQQueueManager

To stop the Queue Manager enter the following command:

endmqm MQQueueManager

In order to create a new Queue definition for the MQQueueManager, you need to use the runmqsc command which takes its input from stdin, thus you will enter your command interactively.

So, in order to create a Queue definition using MQ scripting, enter the following commands:

runmqsc MQQueueManager  define qlocal(SampleMQ)  end

Now create a listener for your Queue by entering the following commands:

runmqsc MQQueueManager  DEFINE LISTENER(MQQueueManager.listener) TRPTYPE (TCP) PORT(1424)  START LISTENER(MQQueueManager.listener)  end

Finally, restart the QueueManager for your commands to take effect:

endmqm MQQueueManager  strmqm MQQueueManager

Configuring a Connection Factory with WebSphere MQ

To configure a JMS connection factory for the WebSphere MQ provider, choose Resources> JMS> Connection factories. In the Connection factories window, select the Scope of your resource and then click “New”.

configuring websphere mq message broker 

In the next step select the WebSphere MQ messaging provider option,

configuring websphere mq message broker 

Click OK. This will take you to the Step 1 wizard where you need to enter the Name for the Connection Factory and the JNDI name that binds it to the name space.

configuring websphere mq message broker 

Click Next to continue. In the Step 2, you should determine how to connect to Websphere MQ. Choose “Enter all the required information into this wizard “option, as shown:

configuring websphere mq message broker 

Click Next to continue. In the Step 2.1 you need to supply the Queue Manager or Queue sharing group name you wish to connect to. (see the paragraph “Create Websphere MQ basic objects” )

configuring websphere mq message broker 

Click Next. In the Step 2.2 choose the transport type and specify the host and port of the MQ Queue Manager. The port must match the listener port that you defined for the Queue Manager.

configuring websphere mq message broker 

Click Next. You can check your connection by clicking on the Test connection to verify that you can connect to the WebSphere MQ Queue Manager. In the Summary window, review your configuration, then click Finish and Save.

Posted on

Configuring JMS endpoints with the default provider

configure jms destination websphere broker

Configuring JMS Destination on Websphere application server

You can configure both Queue and Topic destinations for the default messaging provider. Creating a JMS destination using the default messaging provider is a two process step which requires

  • Registering the JMS destination on the Bus
  • Definition of the JMS destination (and its binding) as WAS Resource

Let’s see each one in detail:

Registering the JMS destination on the Bus

In the first part, we will register a JMS Queue on the Bus by completing the following steps:

  1. Click Service integration > Buses.
  2. Then click on the JMSBus we have formerly created and navigate to Destinations link.

configure jms destination websphere broker

  1. From there, click New:

 configure jms destination websphere broker

  1. Now choose the destination type as shown by the following picture:

 configure jms destination websphere broker

  1. Next, enter an unique Identifier for the Queue destination, as shown in the picture:

 configure jms destination websphere broker

  1. In the last screen, you will assign the Queue to a Bus member. You can just leave the default values and confirm the queue creation in the last screen.

 configure jms destination websphere broker

Click OK and Save the changes to the master configuration. A new Queue name

DemoQueue has been created.

Definition of JMS destinations as WAS Resource

Once registered the JMS destination on the Bus, in order to be able to use it you need to define it as WAS Resource.

  1. From the Admin Console expand your Resources option and choose JMS > Queues.
  2. In the Queues window, choose the Scope for your destination and then click New.

 configure jms destination websphere broker

Select the Default messaging provider option and click OK:

configure jms destination websphere broker 

Complete the wizard by entering the JMS destination properties. In this example, we are binding the Demo Queue under the JNDI name “jms/demoQueue” and using the following properties:

configure jms destination websphere broker 

Click OK. The new Queue is created. Save the changes to the master configuration.

Posted on

Configuring a Connection Factory with Websphere default provider

configure jms connection factory websphere broker

We will now show how to configure a Queue Connection Factory using the default Websphere default JMS provider:

  1. Start by selecting Resources > JMS > Queue Connection factories.
  2. In the Queue Connection factories window, choose the scope, and then click New.

 configure jms connection factory websphere broker

In the next screen, you will need to associate the Connection Factory with a JMS Provider. Select “Default messaging provider

 

configure jms connection factory websphere broker 

Click OK to continue. Next you will enter the Connection Factory General Properties as shown here:

configure jms connection factory websphere broker 

The mandatory fields are the Connection Factory Name (which will be used as display name) and the JNDI name binding for the resources.

The actual list of Connection Factory properties is quite large and it’s beyond the scope of this book to discuss about them all. If you want to learn more, consult Websphere AS Messaging guide (http://www.redbooks.ibm.com/redbooks/pdfs/sg247770.pdf)

Click OK. The new connection factory is now created. Save the changes to the master configuration

Posted on

Configuring Websphere default JMS broker

websphere jms broker

This excerpt from the Enter­prise Appli­ca­tion Server Cook­Book that will teach how to configure the default JMS broker for Websphere application server.

If you want to fully understand the complex topics contained in this chapter we need to make sure that you have a basic knowledge of JMS core elements:

  • A Connection Factory is an object that a JMS client (a Java program that uses the JMS API) uses to create a connection with a JMS provider.
  • A JMS queue is a staging area that contains messages that have been sent and are waiting to be read (by only one consumer). Note that, in contrast to what the name “queue” suggests, messages don’t need to be delivered in the order sent. A JMS queue only warranties that each message is processed only once.
  • A JMS topic is a distribution mechanism for publishing messages that are delivered to multiple subscribers.

When using the default JMS provider your JMS Connection Factories will connect to a Service Integration Bus (SiBus), which hides the actual JMS implementation from the application. Applications then use queues within the SiBus to send and receive messages. At the same time, the JMS Topics are persisted in the SiBus and accessed through appropriate Connection Factories, which applications use to gain access to the Bus.

In order to create a JMS Connection Factory using the Default Provider you need at first create a Service Integration Bus which will act as a proxy between your messaging engines.

Connect to the Admin Console and choose Service Integration > Buses. Click on “New”. The new Bus wizard will start. In Step 1 enter the name of your Bus:

websphere jms broker 

If you have checked the Bus security option you will ensure that client applications authenticate to the bus and the authorization policy for the Bus is enforced. This will add some additional screen shots for specifying which security domain to use for securing your Bus. Please refer to the Chapter 11 for learning how to create a security domain).

Click on Next. In Step 2 you will be requested to confirm the creation of your Bus. Once confirmed, the Bus will be enlisted in the Bus summary page as shown by the following picture:

websphere default jms broker 

To complete the configuration of the SiBus, we must add an existing server as a member to the SiBus so that we have a facility for message persistence.

In order to do that, click on the “JMSBus” just created and, within the Topology section, click Bus members, as shown by the following screenshot:

websphere default jms broker 

You will now be presented with a screen where you can add Bus members.

By clicking Add and you will be able to select the server you wish to add as a member to the Bus. You will notice that the Server option is already pre-selected, as shown in the following screenshot:

websphere default jms broker

 

Click Next to proceed to the final screen, where you will choose the message persistence option between File store and Data store (the first one will persist your messages on a file system, the second one obviously on a database):

websphere default jms broker

The next screen will be dependent on your message store. Supposing that you have selected “File Store”, in the next step you will be able to configure the File Store properties:

websphere default jms broker

Click Next. In the following screen you will be able to tune performance parameters by choosing an appropriate JVM heap size; in the following screen we have just left the default values:

websphere default jms broker 

Clicking Next again will take you to the Summary page where you can review your configuration. Click Finish and Save to retain the changes.

You will now see the application server called server01 listed as a Bus member. At this point, the server must be restarted in order to activate the SiBus message engine. In the next recipes we can start configuring JMS resources on the top of it.