NonStop JMS User's Manual (NonStop JMS 2.0+)

NSJMS Installation and Configuration
NonStop Server for Java Message Service User’s Manual522356-002
2-10
Install and Configure NSJMS
12. Compile the Sample Programs
Execute these commands to compile the sample programs that use the JNDI
object store and destinations created in Add JNDI and Create a Sample Queue
and Topic on page 2-9:
13. Test the Sample Programs
You will need two OSS shells to test each sample program.
In the sample programs, you can enable the non-blocking features of SQL/MX by
issuing the sqlmx_nowait system property from the command line using the -D
option:
java -Dsqlmx_nowait=on client-name client-attribute
where client-name is the name of the sample program and client-
attribute specifies the sample programs attributes. For example:
For additional information on using the sqlmx_nowait system property, see
Threading on page 3-12.
To test the Point-to-Point sample, execute these commands:
In the first shell:
In the second shell:
Your Point-to-Point sample output will be similar to:
OSH: cd examples
OSH: javac *.java
Note. Before testing each sample program, set the NSJMS_HOME variable and the
CLASSPATH variable in each shell; see Update the NSJMS_HOME Variable on page 2-7
and Update the CLASSPATH Variable
on page 2-8.
OSH: java -Dsqlmx_nowait=on SimpleReceiver -queue Q1 -ackmode 1
OSH: cd examples
OSH: java SimpleReceiver -queue Q1 -ackmode 1
OSH: cd examples
OSH: java SimpleSender -queue Q1 -count 5
OSH: cd examples
OSH: java SimpleReceiver -queue Q1 -ackmode 1
OSH: RCV Message: Sending message 0
OSH: RCV Message: Sending message 1
OSH: RCV Message: Sending message 2
OSH: RCV Message: Sending message 3
OSH: RCV Message: Sending message 4