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

# $Id: README.txt,v 1.10 2005/04/18 16:51:22 rogerperey 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 examples/jms directory of your JOTM distribution (e.g.,
.../jotm/output/dist/examples/jms from CVS (or JOTM_HOME/examples/jms)

Type

     ant compile

to compile the example.
__________________________________________________________________________________

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

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

o To run the example, first check that only RMI JRMP protocol is
activated (in the ../../conf/carol.properties (JOTM_HOME/conf) is set to jrmp); 

----------------------------------------------------------------------------------
In JOTM_HOME/lib/ directory type

UNIX:
  $ rmiregistry -J-classpath -Jjotm.jar:jotm_jrmp_stubs.jar:commons-cli-1.0.jar:connector-1_5.jar:howl.jar;joram.jar -J-Djava.security.policy=../conf/java.policy &

WINDOWS:
    rmiregistry -J-classpath -Jjotm.jar;jotm_jrmp_stubs.jar;commons-cli-1.0.jar;connector-1_5.jar;howl.jar;joram.jar -J-Djava.security.policy=../conf/java.policy 

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

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


UNIX:
  $ java -classpath jotm.jar:jotm_jrmp_stubs.jar:commons-cli-1.0.jar:connector-1_5.jar:howl.jar:joram.jar:.:../conf/ org.objectweb.jotm.Main -u UserTransaction -m TransactionManager &

WINDOWS:
    java -classpath jotm.jar;jotm_jrmp_stubs.jar;commons-cli-1.0.jar;connector-1_5.jar;howl.jar;joram.jar;.;../conf/ org.objectweb.jotm.Main -u UserTransaction -m TransactionManager

to start JOTM.

o Finally, type 

    ant run.jms

to start the example.

Enjoy!



