Import the sample Micro broker programs into your Eclipse workspace:
- Select File -> Import -> General -> Existing Projects into Workspace
- Select archive file
- Navigate to the samples directory:
C:\Program Files\IBM Lotus Expeditor Toolkit\eclipse\plugins\com.ibm.rcp.tools.samplegallery_6.2.0.\archive\jmsmb.jar
- Select Open and Finish to import the two projects:
The two projects are imported into the workspace. These are projects of type "Client Services" which is the required project type for Expeditor applications. They are configured to compile and run against the DesktopEE_6.5_SDK; this can be seen against the JRE System Library entry. The Plug-in Dependencies folder contains the Lotus Expeditor plug-ins required to build the project. Notice that the jms11.jar is required. The com.ibm.rcp.samples.microbroker.setup project creates a very simple Micro broker called "FirstBroker" that will run on the default port 1883. The com.ibm.rcp.samples.microbroker.jmspubsub project implements a publisher and subscriber that uses the JMS protocol to publish messages to a topic on the micro broker and subscribes to the same topic to receive the messages. The subscriber uses JNDI to look up the topic name.
In order to run the Micro broker sample programs, we need to create a Launch configuration for Lotus Expeditor:
- Select Run -> Run Configurations
- Highlight Client Services
- Press the New button at the top left of the toolbar
- Provide a name for the new Configuration, for example, XPD_Desktop_Configuration
- On the Main tab, tick the Clear checkbox, to clear the workspace data each time the platform is launched; ensure that the Runtime JRE selected is DesktopEE_6.5_SDK
On the Plug-ins tab, ensure that the two micro broker plug-ins are selected in the Workspace section .
Select Apply and Run
. The Expeditor Client for Desktop is launched and you are prompted for a password for the new KeyStore for this run-time.
Run-time configuration data, including the micro broker configuration and log files, is stored in:
C:\Program Files\IBM Lotus Expeditor Toolkit\runtime-New_configuration
Workspace data, including the config.ini file, is located in
C:\Program Files\IBM Lotus Expeditor Toolkit\
In the Console view of the Eclipse Toolkit, the OSGi console for the run-time is displayed.
The OSGi console can be used to see which bundles are installed in the run-time and what the status of the bundles is. Typing ? at the console prompt displays a list of possible commands.
Type 'ss' to display a list of the bundles that are installed.
The two micro broker bundles have a status of
. This means that they are installed but not started, and that they will be started when they are invoked by another bundle. The bundles can also be manually started from the command line by typing:
osgi > start BUNDLE_ID
where BUNDLE_ID is the id of the bundle (in this case 420 or 421).
When the bundles are started, the micro broker starts up and listens on port 1883, the publisher publishes messages, and the subscriber receives and displays them on the console: