Running the example

Whichever way you run the examples, the MQeBundle.jar bundle is required by both the client and server and must be present on the Bundle Server.

To run the example, first start the Server:
  1. Import the MQeServerBundle.jar bundle onto the Bundle Server.
  2. Start a new SMF (Service Management Framework) runtime, and install and start the MQeServerBundle bundle on it. This should also install the three prerequisite bundles.
  3. The server then starts listening, you should see output on the console including:
    'MQeServerBundle - registering message listener' 
    This means the server is ready for messages.
Next you need to run a client to send a message. There are two methods for runnning the client bundle:
Method 1

In the same SMF runtime as the server:

  1. Import the MQeClientBundle.jar bundle onto the Bundle Server.
  2. Install and start the MQeClientBundle bundle on the runtime.
  3. The client now starts and sends a message, which the server will print on the console. You can stop and start the client bundle to send another message.
Method 2

In separate SMF runtimes:

  1. Import the MQeClientBundle.jar bundle onto the Bundle Server.
  2. Start a new SMF runtime, and install and start the MQeClientBundle bundle on it. This should also install the three prerequisite bundles.
  3. The client starts and sends a message, which the server will print on the console. You can stop and start the client bundle to send another message.

By default the example expects both client and server to be on the same machine running with the receiver listening on port 8085. However, you can change the port and address of the server, that is run the server on a separate machine. Before the server is started, tell it which port to run on by setting the java system property, examples.osgi.server.port. This can be set in the Runtime IDE by selecting Show runtime properties from the drop down menu.

To tell the client the address and port that the server is listening on, before starting the client set the system properties examples.osgi.server.address and examples.osgi.server.port.
Note: The server ignores the address property if it is not present. Also, if the client has already been run and you want to change the address and port, the runtime needs to be terminated and restarted to ensure that old MQeConnectionDefinition information is wiped from memory.

Terms of use | WebSphere software

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