A server usually runs on a server platform. A server can run server-side applications but can also run client-side applications. As with clients, a server can open connections to many other queue managers on both servers and clients. One of the main characteristics that differentiate a server from a client is that it can handle many concurrent incoming requests. A server often acts as an entry point for many clients into an WebSphere MQ Everyplace network . WebSphere MQ Everyplace provides the following server examples:
MQeServer is the simplest server implementation.
When two queue managers communicate with each other, WebSphere MQ Everyplace 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 can create listeners on the local queue manager using either the MQeAdministrator class or administration messages, remotely and locally. However, a remote queue manager must have a listener in order to receiver a message.
This section describes how to create a listener using the MQeAdministrator class. As the listener can take a number of arguments, use MQeProperties to pass the parameters as name and value string pairs. The adapter defines the parameter names and their values. The following example defines a listener using a TcpipHttp adapter, listening on port 8080:
/*create a properties object to pass the adapter parameters to the listener String listenerName = "MyListener"; String adapter = "com.ibm.mqe.adapters.MQeTcpipHttpAdapter"; String port = "8080"; MQeProperties properties = new MQeProperties(); properties.setProperty(MQeCommunicationsAdapter.COMMS_ADAPTER_CLASS, adapter); properties.setProperty(MQeCommunicationsAdapter.COMMS_ADAPTER_PORT, port); properties.setProperty(MQeCommunicationsAdapter.COMMS_ADAPTER_LISTEN, true); /* create an administrator MQeAdministrator admin = new MQeAdministrator(myQMgr); /* created the administrator, now use it to create the listener admin.listenCreateNew(listenerName, properties, timeout, maxChannels); /* now use the administrator itself to start the listener admin.listenerStart(listenerName);
When the listener is started, the server is ready to accept network requests.
When the server is deactivated:
MQePrivateServer is an extension of MQeServer with the addition that it configures the queue manager and registry to allow for secure queues. See Security.