Project JMS Communication Test --- 1.0
Subproject of Mobile Datacommunication
Goals
"Mobile Datacommunication" is a chapter in the book called "Java praxisnah - Profitieren Sie von Programmierprofis".
JMS Communication Test is a source code package used in the book. JMS Communication Test shows how to set up an
error respecting JMS communication on a low-quality, high-latency bearer (e.g. GPRS connection).
Installation
Major software products involved:
- Joram version 3.0.1 (the libs from joram are needed)
- JDK version 1.4.x
- Ant version 1.5.1
It is assumed that JDK and Ant software are already installed and ready
to run on your system. Joram needs to be unpacked and the libraries
contained in the joram distribution have to be copied to the project
directory - see below. Joram is selected as the JMS implementation because
of it's a powerful freeware without licensing problems coming as a binary
and source package.
- Unpack Joram distribution.
- Copy all jar-files from directory ".\joram-3.0.1\lib"
to the example project directory structure into directory "JMSTest/lib".
- Now the system should be able to compile the examples without error
messages.
You will need these jar-files for compilation:
You will need these additional files for execution:
- mom.jar
- ol_util_log_wrp_log4j.jar
- log4j.jar
- xerces.jar
Compile
[Note: Before you may compile the project without errors you have to
install the joram jar-files into directory lib of the example project. See
Installation section for further information!]
- Change to the project root directory.
- Type "ant" into your command line
tool. The default target for ant is the "deploy" target. This will
compile all necessary sources.
- Compilation should succeed without any problems.
- If you encounter problems regarding ant or java please check your
installation of ant and / or the java jdk.
Execution
- To execute the example you have to open three different
command line environments.
One will be used to execute the JoRAM JMS server.
One will be used to execute the sending client.
The third will be used to execute the receiving client.
- Change to the first command line and type
startadmin
This will configure the JMS server for this example.
- To start the JMS server type
startjoram
into the same command line.
Screen output should look like this:
>startjoram
AgentServer#0 started.
- Switch to the second command line and type
startsender
Screen output should look like this:
>startsender
Start JMS Sender ...
JNDI Lookup [1].
: Queue:#0.0.1029: created.a.joram.Client - Destination.<init>(68)
: QCF:MICHAEL/195.30.48.210: created.lient -
ConnectionFactory.<init>(91)
JMS Communication [1].
: Trying to connect to the server...Client - Connection.connect(468)
: ... connected!G fr.dyade.aaa.joram.Client - Connection.connect(501)
: Cnx:#0.0.1030-0: starts the Driver.Client - Connection.<init>(152)
Msg send: Test number 0
Msg send: Test number 1
Msg send: Test number 2
Msg send: Test number 3
Msg send: Test number 4
Msg send: Test number 5
Msg send: Test number 6
Msg send: Test number 7
Msg send: Test number 8
Msg send: Test number 9
10 messages sent.
Communication successfully ended.
- Switch to the last command line and type
startreceiver
Screen output should look like this:
>startreceiver
Start JMS Receiver ...
JNDI Lookup [1].
: Queue:#0.0.1029: created..joram.Client - Destination.<init>(68)
: QCF:MICHAEL/195.30.48.210: created.lient -
ConnectionFactory.<init>(91)
JMS Communication [1].
: Trying to connect to the server...Client - Connection.connect(468)
: ... connected!G fr.dyade.aaa.joram.Client - Connection.connect(501)
: Cnx:#0.0.1030-0: starts the Driver.Client - Connection.<init>(152)
Msg received: Test number 1
Msg received: Test number 2
Msg received: Test number 3
Msg received: Test number 4
Msg received: Test number 5
Msg received: Test number 6
Msg received: Test number 7
Msg received: Test number 8
Msg received: Test number 9
Msg received: Test number 0
10 messages received.
Communication successfully ended.
Disclaimer
All code provided is provided on an "AS IS" basis, without warranty. The author
makes no representation, or warranty, either express or implied,
with respect to the programs, their quality, accuracy, or fitness for a specific purpose.
Therefore, the author will not have any liability to you or any other person or entity with respect to any liability,
loss, or damage caused or alleged to have been caused directly or indirectly by the programs provided by the author.
This includes, but is not limited to, interruption of service, loss of data, loss of profits, or consequential damages
from the use of these programs.
Terms of Use
All code provided by the author for view and/or download is the copyrighted work of the respective author.