Showing posts with label JMS. Show all posts
Showing posts with label JMS. Show all posts

How to Configure WebLogic Server with IBM WebSphere MQ V6 or V7 as a Foreign JMS Server in Two Different Machines

WebSphere MQ Information Center
WebSphere MQ Information Center (Photo credit: peter_anghelides)


Configuring WebSphere MQ

Please follow these steps:

  1. In the WebSphere MQ Explorer Navigator pane, click on the 'IBM WebSphere MQ' node to expand it.
  2. Create a queue manager by right clicking on the Queue Manager node and selecting New -> Queue Manager.
  3. In the opened window, enter the name MQTest in the Name text box. Ensure that you choose a port which is not already in use. Otherwise, accept the default options by clicking Next until you reach 'Finish' and finally click Finish. Keep a record of these settings as they will be used later in the configuration of the bindings.
  4. Right click on the Queues node under MQTest queue manager. Select New -> Local Queue.
  5. Enter 'MQSenderQueue' as the name for the local MQ queue. Click Next and Finish.
  6. Repeat the above two steps to create another local queue called 'MQReceiverQueue.'
  7. Create a new channel for the new MQTest Queue Manager.
    1. Expand Queue Managers -> MQTest -> Advanced -> Channels -> New -> Server-connection Channel
    2. Name: mysvrconnchannel
    3. Keep all other values as default.
    4. Click Next -> Finish.

Integrating Oracle WebLogic Server with Websphere MQ

Solution

  1. Download Websphere MQ from the following location and install it: http://www.ibm.com/developerworks/downloads/ws/wmq/
  2. Run the following command to create the necessary resources in MQ:
    Change directory to MQ_HOME/bin folder:
    - Create a MQ manager (Example: "COSI"):
    crtmqm COSI
    - Start the MQ Manager:
    strmqm COSI
    - Create local queue and channel:
    runmqsm
    DEFINE QLOCAL('DAVE') DEFPSIST(YES) //{Example: DAVE is the queuename}
    DEFINE CHANNEL(MAP.SVRCONN) CONNAME(SVRCONN) XMITQ(WW) //{Example: MAP.SVRCONN is the channel name}
    End
  3. Include weblogic.jar in the classpath and also include JRE in the path.
  4. Run the following command to start JMSAdmin:

How To Delete JMS Messages from a Queue with the WLST

This document describes WebLogic Scripting Tool (WLST) commands to delete messages from a JMS message queue. Sometime, you may need to delete all the messages from JMS queues. However, using the Queues > Monitoring tab in the console, you might encounter an out of memory condition. This can happen because the console tries to load the messages prior to deleting them, leading to the out of memory condition.

Solution

Run the following sequence of WLST commands, substituting your own server's information where necessary:
wls:/offline> connect('weblogic','welcome1','t3://localhost:7001')

wls:/WLST_domain/serverConfig> serverRuntime()wls:/WLST_domain/serverRuntime> cd('JMSRuntime/AdminServer.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0')wls:/WLST_domain/serverRuntime/JMSRuntime/AdminServer.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0> ls()wls:/WLST_domain/serverRuntime/JMSRuntime/AdminServer.jms/JMSServers/JMSServer-0/Destinations/SystemModule-0!Queue-0> cmo.deleteMessages('')