Example - MQeServer

MQeServer is the simplest server implementation.

qm_server server_QMgr_name [-p private_reg_PIN]

You must supply the -p parameter if the queue manager uses a private registry. Otherwise, the queue manager's registry is treated as a file registry. The program activates the queue manager (including a listener listening on port 8081) and goes into an indefinite sleep.

Use ctrl-C to shut down the server.

To delete the constructed queue manager, use the example qm_delete.

When two queue managers communicate with each other, MQe opens a connection between the two queue managers. The connection is a logical entity that is used as a queue manager to queue manager pipe. Multiple connections may be open at any time.

Server queue managers, unlike client queue managers, can have one or more listeners. A listener waits for communications from other queue managers, and processes incoming requests, usually by forwarding them to its owning queue manager. Each listener has a specified adapter that defines the protocol of incoming communications, and also specifies any extra data required.

You create listeners on the local queue manager using administration messages, remotely and locally. However, a remote queue manager must have a listener in order to receive a message.

A listener that has just been created by sending administration messages to the queue manager does not then start. To start it you can send an administration message explicitly to start the listener, or you can restart the queue manager. (However, listeners are persistent in the registry. This means that, once created, listeners that exist at queue manager startup are started automatically).

This example shows how to create and start a listener using administration messages:
String  listenerName = "MyListener";
   String  listenAdapter = "com.ibm.mqe.adapters.MQeTcpipHttpAdapter";
   int     listenPort = 1881;
   int     channelTimeout = 300000;
   int     maxChannels = 0;
    
   MQeCommunicationsListenerAdminMsg msg = new MQeCommunicationsListenerAdminMsg();

     msg.setName(listenerName);
     msg.create(listenAdapter, listenPort, channelTimeout, maxChannels);
     
     .
     .
     .

     //In order to start the listener use the start action
      
   MQeCommunicationsListenerAdminMsg msg = new MQeCommunicationsListenerAdminMsg();
    
   msg.setName(listenerName);
   msg.start();

   .
   .

When the listener is started, the server is ready to accept network requests.

When the server is deactivated:
  1. The listener is stopped, preventing any new incoming requests
  2. The queue manager is closed

Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.