However, you run the examples the following bundle is required by both the
client and server and must be present on the bundle server. See the
Configuration Guide for details on submitting bundles to a server.
To run the example you will need to first start the Server:
- Import the MQeServerBundle.jar bundle onto the Bundle
Server.
- Start a new SMF runtime and Install and start the MQeServerBundle bundle
on it. This should also install the three prerequisite bundles.
- 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:
- Import the MQeClientBundle.jar bundle onto the Bundle
Server.
- Install and start the MQeClientBundle bundle on the runtime.
- 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:
- Import the MQeClientBundle.jar bundle onto the Bundle
Server.
- Start a new SMF runtime and Install and start the MQeClientBundle bundle
on it. This should also install the three prerequisite bundles.
- 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, you can 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,
set the "examples.osgi.server.address" and
"examples.osgi.server.port" system properties before the
client is started.
- 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.
© IBM Corporation 2002. All Rights Reserved