The OpenJMS code examples demonstrate how to write simple applications
The sources of these examples are located under the examples/basic/ directory.
|Sender.java||Sends messages to a destination|
|Receiver.java||Synchronously receives messages from a destination|
|Listener.java||Asynchronously receives messages from a destination|
|DurableSubscriber.java||Durable topic subscriber|
|Browser.java||Browses a queue|
Helper scripts are provided to compile the examples with the appropriate classpath. To run these, open a command prompt and type:
cd %OPENJMS_HOME%\examples\basic build
cd $OPENJMS_HOME/examples/basic build.sh
Helper scripts are also provided to run the examples. To run these, open a command prompt and type:
The examples connect to the OpenJMS server using properties specified in an application resource file named jndi.properties:
# # JNDI configuration file used by the OpenJMS examples # # java.naming.provider.url=tcp://localhost:3035 java.naming.factory.initial=org.exolab.jms.jndi.InitialContextFactory
This can be customised to change the connector the examples use to connect to the server.