###############
#             #
# JMS example #
#             #
###############

# $Id: README.txt,v 1.9 2003/01/10 15:41:29 jmesnil Exp $

Scenario:
---------

The SimpleJmsXa example is a simple example showing how
to use JTA transactions with a JMS server.

Setup:
------

o A RMI registry
o JOTM is the Transaction Manager
o JORAM is the JMS server

o JmsXA setups the JMS objects (Queue, Session and ConnectionFactory) and
  registers them in JOTM as XA resources

o SimpleSender sends 4 messages on a JMS queue
  - one is outside a transaction
  - one is inside a transaction with a commit result
  - one is inside a transaction with a rollback result
  - a last one with a special text to stop SimpleReceiver

o SimpleReceiver receives 3 messages from this JMS queue
  - the one which was outside a transaction
  - the one which was inside a transaction with a commit result
  - the last one
  (SimpleReceiver does not received the 3rd message which was sent
  because it has been rolled back.)

Compilation:
------------

Set JOTM_HOME to the directory of your JOTM distribution (e.g.,
.../jotm/output/dist from CVS)

Type

   $ ant compile

to compile the example

Run the example:
----------------

o To run the example, first check that only RMI protocol will be
activated (in the ../../config/carol.properties, carol.rmi.activated
should be set to jrmp); then type in $JOTM_HOME/lib/ directory

   $  rmiregistry -J-classpath -Jjotm.jar:jotm_jrmp_stubs.jar -J-Djava.security.policy=../config/java.policy &

to start a RMI registry on default port (i.e. 1099).

o Then, in $JOTM_HOME/lib/ directory, type

   $ java -classpath jotm.jar:jotm_jrmp_stubs.jar:../config/ org.objectweb.jotm.Main -u UserTransaction -m TransactionManager &

to start JOTM.

o Finally, type 

   $ ant run.jms

to start the example.

Enjoy!



