Chapter 4. Examples

JBoss Messaging has a number of examples that are available for download. Download the examples archive file from https://access.redhat.com

Task: Download JBoss Messaging Examples Zip

Follow this task to download the JBoss Messaging Example Zip bundle. The examples are contained within the documentation bundle for the platform.

Prerequisites

  • You have the correct entitlements for JBoss Enterprise Application Platform on access.redhat.com
  1. Log in to the Red Hat Customer Portal.
  2. Select DownloadsJBoss Enterprise MiddlewareDownloads
  3. On the Software Downloads page, select Application Platform from the Product drop-down menu.
    The Version drop-down menu defaults to the latest release.
  4. Locate the Application Platform [version] Documentation entry, and click Download.
  5. The documentation bundle begins to download.

Task: Unpack and Deploy Examples

Complete this task to unpack the JBoss Messaging examples from the platform documentation bundle, and meet all basic configuration requirements to run the examples.
  1. Open the zip archive using an archive utility appropriate for your operating system.
  2. In the zip archive manager, navigate to jboss-eap-5.1doc.
  3. Extract the examples directory to $JBOSS_HOME/docs/examples.
  4. Open $JBOSS_HOME/docs/examples/jboss-messaging-examples/destinations/ in a file browser.
  5. Copy jbm-examples-destinations-service.xml to $JBOSS_HOME/server/default/deploy to deploy the destinations configuration directives required by the examples.

Unclustered Examples

Important

You must run the Unclustered examples on JBoss Enterprise Application Platform non-clustered profiles: the All and Production profiles are not supported.
The readme.html for each example provides the setup details, expected output, and simple troubleshooting.
queue
This example shows a simple send and receive to a remote queue using a JMS client
topic
This example shows a simple send and receive to a remote topic using a JMS client
mdb
This example demonstrates usage of an EJB2.1 MDB with JBoss Messaging
ejb3mdb
This example demonstrates usage of an EJB3 MDB with JBoss Messaging
stateless
This example demonstrates an EJB2.1 stateless session bean interacting with JBoss Messaging
mdb-failure
This example demonstrates rollback and redelivery occurring with an EJB2.1 MDB
secure-socket
This example demonstrates a JMS client interacting with a JBoss Messaging server using SSL encrypted transport
http
This example demonstrates a JMS client interacting with a JBoss Messaging server tunneling traffic over the HTTP protocol
web-service
This example demonstrates JBoss web-service interacting with JBoss Messaging
stateless-clustered
This example demonstrates a JMS client interacting with clustered EJB2.1 stateless session bean, which in turn interacts with JBoss Messaging. The example uses HAJNDI to look up the connection factory
bridge
This example demonstrates using a message bridge. It deploys a message bridge in EAP which then proceeds to move messages from a source to a target queue
servlet
This example demonstrates how to use servlet transport with JBoss Messaging. It deploys a servlet and a ConnectionFactory that uses the servlet transport.
ordering-group
This example demonstrates using strict message ordering with JBoss Messaging. It uses JBoss Messaging ordering group API to deliver strictly ordered messages, regardless of their priorities.

Clustered Examples

Important

The clustered examples require two running JBoss Application Server instances with port settings set to ports-01 and ports-02.
The examples are supported for use on the Enterprise Application Platform All and Production server profiles.
The readme.html for each example provides the setup details, expected output, and simple troubleshooting.
distributed-topic
This example demonstrates a JMS client interacting with a JBoss Messaging distributed topic - it requires two EAP instances to be running
distributed-queue
This example demonstrates a JMS client interacting with a JBoss Messaging distributed queue - it requires two EAP instances to be running
queue-failover
This example demonstrates the transparent failover of a JMS consumer.