Java Message Service
Java Message Service
Abstract
NonStop Server for Java™ Message Service (NSJMS) is an implementation of Sun
Microsystems Java™ Message Service (JMS) API on HP NonStop™ S-series systems
and HP Integrity NonStop NS-series systems. NSJMS utilizes the performance and
reliability inherent in HP NonStop SQL/MX products to provide standards-based
messaging for JMS clients running on HP NonStop servers. It is assumed the reader is
already familiar with Sun Microsystems published specification, Java Message Service,
Version 1.0.2.
As part of U64 program, a new 64-bit dll (libnsjms_64.so) is included in addition to
the existing 32-bit dll ([Link])
Product Version
NSJMS 3.0
Supported Release Version Updates (RVUs)
This publication supports G06.18 and all subsequent G-series RVUs and H06.03 and
all subsequent H-series RVUs until otherwise indicated by its replacement publication.
The U64 program support is present from H06.25.00 and all subsequent H-series
RVUs unless otherwise indicated by its replacement publication. U64 program does
not support G-series RVUs.
Part Number Published
522356-006 February 2013
Document History
Part Number Product Version Published
522356-001 NSJMS 1.0 April 2002
522356-002 NSJMS 2.0 April 2003
522356-003 NSJMS 3.0 November 2003
522356-004 NSJMS 3.0 April 2005
522356-005 NSJMS 3.0 June 2011
522356-006 NSJMS 3.0 February 2013
Legal Notices
Copyright 2013 Hewlett-Packard Development Company L.P.
Confidential computer software. Valid license from HP required for possession, use or copying.
Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software
Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under
vendor's standard commercial license.
The information contained herein is subject to change without notice. The only warranties for HP
products and services are set forth in the express warranty statements accompanying such products
and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be
liable for technical or editorial errors or omissions contained herein.
Export of the information contained in this publication may require authorization from the U.S.
Department of Commerce.
Microsoft, Windows, and Windows NT are U.S. registered trademarks of Microsoft Corporation.
Intel, Itanium, Pentium, and Celeron are trademarks or registered trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
Motif, OSF/1, UNIX, X/Open, and the "X" device are registered trademarks and IT DialTone and The
Open Group are trademarks of The Open Group in the U.S. and other countries.
Open Software Foundation, OSF, the OSF logo, OSF/1, OSF/Motif, and Motif are trademarks of the
Open Software Foundation, Inc.
OSF MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THE OSF MATERIAL PROVIDED
HEREIN, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
OSF shall not be liable for errors contained herein or for incidental consequential damages in
connection with the furnishing, performance, or use of this material.
© 1990, 1991, 1992, 1993 Open Software Foundation, Inc. This documentation and the software to
which it relates are derived in part from materials supplied by the following:
© 1987, 1988, 1989 Carnegie-Mellon University. © 1989, 1990, 1991 Digital Equipment Corporation.
© 1985, 1988, 1989, 1990 Encore Computer Corporation. © 1988 Free Software Foundation, Inc.
© 1987, 1988, 1989, 1990, 1991 Hewlett-Packard Company. © 1985, 1987, 1988, 1989, 1990, 1991,
1992 International Business Machines Corporation. © 1988, 1989 Massachusetts Institute of
Technology. © 1988, 1989, 1990 Mentat Inc. © 1988 Microsoft Corporation. © 1987, 1988, 1989,
1990, 1991, 1992 SecureWare, Inc. © 1990, 1991 Siemens Nixdorf Informationssysteme AG. © 1986,
1989, 1996, 1997 Sun Microsystems, Inc. © 1989, 1990, 1991 Transarc Corporation.
This software and documentation are based in part on the Fourth Berkeley Software Distribution
under license from The Regents of the University of California. OSF acknowledges the following
individuals and institutions for their role in its development: Kenneth C.R.C. Arnold,
Gregory S. Couch, Conrad C. Huang, Ed James, Symmetric Computer Systems, Robert Elz. © 1980,
1981, 1982, 1983, 1985, 1986, 1987, 1988, 1989 Regents of the University of California.
Printed in the US
NonStop Server for Java
Message Service User’s Manual
1. Introduction to NSJMS
Features and Functions of NSJMS 1-1
NSJMS Client Messaging Components 1-1
JMS Client 1-2
JMS API 1-2
JNDI API 1-2
NSJMS 1-2
JNDI Provider 1-2
SQL/MX 1-3
Administrative Utility Components 1-3
Administrative Servlet 1-3
Command-Line Interface 1-3
NSJMS 1-3
SQL/MX 1-4
JNDI API 1-4
JNDI Provider 1-4
Supported Platform 1-4
Compliance Information 1-4
Hewlett-Packard Company—522356-006
i
Contents 2. NSJMS Installation and Configuration for TNS/R
Glossary
Index
Examples
Example 5-1. Modifying the [Link] Script to Include Foreign-Provider Client Jar
Files 5-4
Example 5-2. start_template.txt File 5-20
Example 5-3. Start Script Sample 5-23
Example 5-4. stop_template.txt File 5-26
Example 5-5. Stop Script Sample 5-26
Figures
Figure 1-1. NSJMS Client Messaging on a NonStop System 1-2
Figure 1-2. NSJMS Administrative Utility 1-3
Figure 5-1. Reliable Messaging Bridge 5-2
Abstract
NonStop Server for Java™ Message Service (NSJMS) is an implementation of Sun
Microsystems Java™ Message Service (JMS) API on HP NonStop™ S-series systems
and HP Integrity NonStop NS-series systems. NSJMS utilizes the performance and
reliability inherent in HP NonStop SQL/MX products to provide standards-based
messaging for JMS clients running on HP NonStop servers. It is assumed the reader is
already familiar with Sun Microsystems published specification, Java Message Service,
Version 1.0.2.
As part of U64 program, a new 64-bit dll (libnsjms_64.so) is included in addition to
the existing 32-bit dll ([Link])
Product Version
NSJMS 3.0
Supported Release Version Updates (RVUs)
This publication supports G06.18 and all subsequent G-series RVUs and H06.03 and
all subsequent H-series RVUs until otherwise indicated by its replacement publication.
The U64 program support is present from H06.25.00 and all subsequent H-series
RVUs unless otherwise indicated by its replacement publication. U64 program does
not support G-series RVUs.
Document History
Part Number Product Version Published
522356-001 NSJMS 1.0 April 2002
522356-002 NSJMS 2.0 April 2003
522356-003 NSJMS 3.0 November 2003
522356-004 NSJMS 3.0 April 2005
522356-006 NSJMS 3.0 February 2013
Related Manuals
Depending on the tasks you are performing, other manuals you might need are:
SQL/MX Installation and Management Guide
SQL/MP Installation and Management Guide
SQL/MP Reference Manual
Notation Conventions
Hypertext Links
Blue underline is used to indicate a hypertext link within text. By clicking a passage of
text with a blue underline, you are taken to the location described. For example:
This requirement is described under NSJMS System Requirements on page 2-1.
UPPERCASE LETTERS. Uppercase letters indicate keywords and reserved words; enter
these items exactly as shown. Items not enclosed in brackets are required. For
example:
MAXATTACH
lowercase italic letters. Lowercase italic letters indicate variable items that you supply.
Items not enclosed in brackets are required. For example:
file-name
computer type. Computer type letters within text indicate C and Open System Services
(OSS) keywords and reserved words; enter these items exactly as shown. Items not
enclosed in brackets are required. For example:
myfile.c
italic computer type. Italic computer type letters within text indicate C and Open
System Services (OSS) variable items that you supply. Items not enclosed in brackets
are required. For example:
pathname
each side of the list, or horizontally, enclosed in a pair of brackets and separated by
vertical lines. For example:
FC [ num ]
[ -num ]
[ text ]
K [ X | D ] address
{ } Braces. A group of items enclosed in braces is a list from which you are required to
choose one item. The items in the list can be arranged either vertically, with aligned
braces on each side of the list, or horizontally, enclosed in a pair of braces and
separated by vertical lines. For example:
LISTOPENS PROCESS { $appl-mgr-name }
{ $process-name }
ALLOWSU { ON | OFF }
| Vertical Line. A vertical line separates alternatives in a horizontal list that is enclosed in
brackets or braces. For example:
INSPECT { OFF | ON | SAVEABEND }
… Ellipsis. An ellipsis immediately following a pair of brackets or braces indicates that you
can repeat the enclosed sequence of syntax items any number of times. For example:
M address [ , new-value ]…
[ - ] {0|1|2|3|4|5|6|7|8|9}…
An ellipsis immediately following a single syntax item indicates that you can repeat that
syntax item any number of times. For example:
"s-char…"
Item Spacing. Spaces shown between items are required unless one of the items is a
punctuation symbol such as a parenthesis or a comma. For example:
CALL STEPMOM ( process-id ) ;
If there is no space between two items, spaces are not permitted. In the following
example, there are no spaces permitted between the period and any other items:
$process-name.#su-name
Line Spacing. If the syntax of a command is too long to fit on a single line, each
continuation line is indented three spaces and is separated from the preceding line by
a blank line. This spacing distinguishes items in a continuation line from items in a
vertical list of selections. For example:
ALTER [ / OUT file-spec / ] LINE
[ , attribute-spec ]…
!i and !o. In procedure calls, the !i notation follows an input parameter (one that passes data
to the called procedure); the !o notation follows an output parameter (one that returns
data to the calling program). For example:
CALL CHECKRESIZESEGMENT ( segment-id !i
, error ) ; !o
!i,o. In procedure calls, the !i,o notation follows an input/output parameter (one that both
passes data to the called procedure and returns data to the calling program). For
example:
error := COMPRESSEDIT ( filenum ) ; !i,o
!i:i. In procedure calls, the !i:i notation follows an input string parameter that has a
corresponding parameter specifying the length of the string in bytes. For example:
error := FILENAME_COMPARE_ ( filename1:length !i:i
, filename2:length ) ; !i:i
!o:i. In procedure calls, the !o:i notation follows an output buffer parameter that has a
corresponding input parameter specifying the maximum length of the output buffer in
bytes. For example:
error := FILE_GETINFO_ ( filenum !i
, [ filename:maxlen ] ) ; !o:i
Bold Text. Bold text in an example indicates user input entered at the terminal. For
example:
ENTER RUN CODE
?123
CODE RECEIVED: 123.00
The user must press the Return key after typing the input.
Nonitalic text. Nonitalic letters, numbers, and punctuation indicate text that is displayed or
returned exactly as shown. For example:
Backup Up.
lowercase italic letters. Lowercase italic letters indicate variable items whose values are
displayed or returned. For example:
p-register
process-name
[ ] Brackets. Brackets enclose items that are sometimes, but not always, displayed. For
example:
Event number = number [ Subject = first-subject-value ]
A group of items enclosed in brackets is a list of all possible items that can be
displayed, of which one or none might actually be displayed. The items in the list might
be arranged either vertically, with aligned brackets on each side of the list, or
horizontally, enclosed in a pair of brackets and separated by vertical lines. For
example:
proc-name trapped [ in SQL | in SQL file system ]
{ } Braces. A group of items enclosed in braces is a list of all possible items that can be
displayed, of which one is actually displayed. The items in the list might be arranged
either vertically, with aligned braces on each side of the list, or horizontally, enclosed in
a pair of braces and separated by vertical lines. For example:
obj-type obj-name state changed to state, caused by
{ Object | Operator | Service }
process-name State changed from old-objstate to objstate
{ Operator Request. }
{ Unknown. }
| Vertical Line. A vertical line separates alternatives in a horizontal list that is enclosed in
brackets or braces. For example:
Transfer status: { OK | Failed }
% Percent Sign. A percent sign precedes a number that is not in decimal notation. The
% notation precedes an octal number. The %B notation precedes a binary number.
The %H notation precedes a hexadecimal number. For example:
%005400
%B101111
%H2F
P=%p-register E=%e-register
JMS Client
SQL/MX
[Link]
JMS Client
A JMS client is a user-written application that uses NSJMS to exchange messages
with other JMS client applications.
JMS API
The Java JMS API provides a generic set of interfaces that enables JMS clients to
exchange messages.
JNDI API
The JNDI API provides a generic set of interfaces that enables JMS clients to access
naming and directory services.
NSJMS
NSJMS is the JMS provider that provides an implementation of the JMS API on a
NonStop system.
JNDI Provider
The JNDI provider implements the naming and directory services.
SQL/MX
SQL/MX is the HP relational database management system that provides access to
large distributed databases. JMS clients use SQL/MX to access messages and
information stored in NSJMS SQL databases.
Administrative Command-Line
Servlet Interface
NSJMS
SQL/MX
[Link]
Administrative Servlet
The optional administrative servlet provides a programmatic interface for the
administrative utility to access and manage the NSJMS database.
Command-Line Interface
The command-line interface provides a local command-line tool for the administrative
utility to access and manage the NSJMS objects.
NSJMS
NSJMS is the JMS provider that provides an implementation of the JMS API on a
NonStop system.
SQL/MX
SQL/MX is the HP relational database management system that provides access to
large distributed databases. JMS clients use SQL/MX to access messages and
information stored in NSJMS SQL databases.
JNDI API
The JNDI API provides a generic set of interfaces that enables the administrative utility
to access naming and directory services.
JNDI Provider
The JNDI provider implements the naming and directory services.
Supported Platform
This publication supports H06.25.00 and all subsequent H-series RVUs unless
otherwise indicated by its replacement publication. This program does not support G-
series RVUs.
Compliance Information
NSJMS conforms to Sun Microsystems published specification, Java Message
Service, Version 1.0.2, except as noted. The specification is available on the Sun
Microsystems Java Message Service (JMS) Web site
([Link]
JMS Application Server facilities refers to server-side facilities in a JMS
implementation that could be used by an expert application. These features are
optional interfaces (ConnectionConsumer, ServerSession and SeverSessionPool)
and are not available in the NSJMS implementation.
A JMS provider can provide Java Transaction API (JTA)-aware connections and
sessions by using the XAConnectionFactory, XAConnection, XASession, and so
on. On the operating system, the transaction integration of NSJMS and other
products is provided by HP NonStop Transaction Management Facility (TMF).
Although these XA interfaces are not implemented in NSJMS, you can use JTA to
start or commit transactions which involve NSJMS.
The JMS specification defines the priority value as 0 (zero), the lowest priority, and
nine, the highest. Priority does not affect delivery of messages in the NSJMS
implementation.
Software
WARNING. The JNDI 1.2.1 FS Context Service Provider from Sun Microsystems Java Naming
and Directory Interface (JNDI) Web site ([Link] must be
downloaded and extracted on your workstation. These files are required for NSJMS.
WARNING. The JNDI 1.2.1 FS Context Service Provider from Sun Microsystems Java Naming
and Directory Interface (JNDI) Web site ([Link] must be
downloaded and extracted on your workstation. These files are required for NSJMS.
Determine whether you will use DSM/SCM to move files to Installation Subvolumes
(ISVs) after files are placed on your workstation. For additional information about
using DSM/SCM, see the DSM/SCM User’s Guide.
Note. Using DSM/SCM is optional for G06.18 or later RVUs, but is recommended.
Caution. Every time you use the Install product to install a release of the operating system
software, you must reinstall your Independent Product. Installing a release using the Install
product can result in overwriting this Independent Product with older versions of software. This
problem does not occur if you are using DSM/SCM to install releases.
To Run IPSetup
Exit all other Windows applications before placing NSJMS software on the host
system.
1. Open the product CD by double clicking on the CD drive.
2. Click the View Readme file button. Setup opens the README file in Notepad. Be
sure to review the entire README file before proceeding.
3. Click the IPSetup button to launch IPSetup. The program displays a Welcome
Screen and a License Agreement screen. To continue the installation, click Next
on each of these screens.
4. On the Placement Options screen select the NonStop Kernel RISC option.
If you plan on using DSM/SCM, check the box for “Use DSM/SCM to complete
installation on host.” Click Next.
If you do not plan on using DSM/SCM, uncheck the box for “Use DSM/SCM to
complete installation on host.” Click Next.
5. On the Product Selection screen, highlight NonStop Server for Java Message
Service as the product you want to install. Click the ADD button. Click Next.
6. Log on using a user ID that can write to the /usr OSS directory (for example,
[Link]) by following the instructions on the Host Information screen. You can
use either the system name or the system IP address to log on. Click Next.
7. On the Host Target screen you can either accept the default locations for Work and
Backup subvolumes or browse to locations of your choice. Click Next when you
are satisfied with the locations.
8. On the Host File Placement screen you can either accept the default disk locations
or browse to locations of your choice. Click Next when you are satisfied with the
locations.
9. On the Placement Manifest screen review the file locations. You can click Back to
go back and change the file locations. When you are satisfied with the locations,
click Next. This step can take a few minutes to complete.
10. On the Placement Complete screen you can choose to view the release
documentation or to launch DSM/SCM. You should review the release
documentation.
11. After you review the release documentation, click Finish to complete running
IPSetup.
Note. You must be installing NSJMS on a NonStop S-series system running G06.18 or
later RVU.
3. COPY the received product files to a new software revision of the configuration you
want to update.
4. BUILD and APPLY the configuration revision.
Note. If the option Manage OSS Files was not selected in the DSM/SCM planner interface
in Step 2 above, the NSJMS PAX file is in the Guardian subvolume $[Link] (where
ISV is the name of your installation subvolume). Use COPYOSS to extract and place the
contents of the NSJMS PAX file into the OSS file system. (Go to Use COPYOSS to Place the
Product Files in /usr/tandem on page 2-6).
6. Go to Install and Configure NSJMS on page 2-6 for detailed instructions about
running the install script and configuring NSJMS.
Note. You must be installing NSJMS on a NonStop S-series system running G06.18 or
later RVU.
3. COPY the received product files to a new software revision of the configuration you
want to update.
4. BUILD and APPLY the configuration revision.
5. Run ZPHIRNM to perform the RENAME step.
6. Use PINSTALL to unpax the NSJMS PAX file into the OSS file system.
a. On your NonStop S-series server, log on as [Link]:
TACL> LOGON [Link]
b. Navigate to the Guardian subvolume $[Link]:
TACL> VOLUME $[Link]
where ISV is the name of your installation subvolume.
c. Unpax T1251PAX using the PINSTALL utility:
TACL> PINSTALL -s:/usr/tandem:install-dir: -rvf
T1251PAX
PINSTALL extracts the files contained in T1251PAX and places them in the
version-specific OSS directory install-dir/nsjms/version, where
Note. Running the PINSTALL command does not affect any environment currently
running on your NonStop S-series server.
7. Go to Install and Configure NSJMS on page 2-6 for detailed instructions about
running the install script and configuring NSJMS.
Note. Running the copyoss command does not affect any environment currently running
on your NonStop S-series server.
3. Go to Install and Configure NSJMS on this page for detailed instructions about
running the install script and configuring NSJMS.
Note. If you are running NonStop Server for Java (T0083V31), the NSJ Makefile
INCLUDE_JDBCMX variable must be set to yes, and the user ID must match the user ID
that was used to install the JVM NSJ software. This Makefile is located in
/usr/tandem/java/install.
For example:
Note. Run the installation script only once after you unpax the NSJMS product files into
the version-specific OSS directory. Run the installation script a second time only when you
reinstall the T1251 NSJMS libraries or class files.
Caution. After verifying installation, do not delete or modify the version-specific directory
(/usr/tandem/nsjms/version) or its subdirectories because OSS symbolic links point
back to the version-specific directory tree. If any part of the version-specific directory tree is
deleted or modified, you must reinstall NSJMS by unpaxing the NSJMS PAX file. (For more
information, see Unpax the NSJMS Product Files on page 2-4.)
3. Copy the JNDI files from your workstation to the NSJMS directory:
Using FTP in binary mode, transfer the [Link] file and the
[Link] file from your workstation to the
/usr/tandem/nsjms/version/lib directory where version is the vproc of
this release (for example, T1251V30_30SEP2003_V30).
Note. The [Link] file is included in the NSJ 2.0 release and resides in the
/usr/tandem/java/jre/lib/ext directory.
Note. If there is no match, an installation error occurred. Correct the error before
proceeding.
For example:
If NonStop Server for Java (T0083V31) is installed use these commands:
OSH: cd /usr/tandem/nssjava/version/bin/oss/posix_threads
OSH: vproc java
where version is the vproc of this JVM release (for example, jdk131_v10)
If NonStop Server for Java (T2766V10) is installed use these commands:
OSH: cd /usr/tandem/nssjava/version/bin
OSH: vproc java
where version is the vproc of this JVM release (for example, jdk141_v10)
The vproc should contain a version procedure similar to:
Version procedure: T1251V30_30SEP2003_BASE_LIBNSJMS
Note. The remaining installation steps do not require [Link] privileges. However, to
maintain a secure environment, you should choose or create a user ID that is configured for
the OSS environment and from under which you run your JMS applications. Use this user ID to
perform the post-installation steps.
5. Use the export command to update the NSJMS_HOME variable. For example:
OSH: cd /usr/tandem/nsjms/version
OSH: export NSJMS_HOME=$PWD
6. Use the export command to update the CLASSPATH variable. For example:
OSH: cd /usr/tandem/nsjms/version
OSH: export JAVA_HOME=/usr/tandem/java
OSH: export JREHOME=$JAVA_HOME/jre
OSH: export CLASSPATH=$NSJMS_HOME:$NSJMS_HOME/examples:$CLASSPATH
OSH: export CLASSPATH=`echo $NSJMS_HOME/lib/*.jar | tr ' ' ':'`:$CLASSPATH
7. Verify that you have access to an existing SQL catalog, or create a new catalog.
NSJMS uses SQL tables to store messages and destination information.
To create a new SQL catalog:
For additional information about the requirements for creating SQL catalogs, see
the SQL/MP Installation and Management Guide.
8. Update SQL Catalog and Table Location:
If the NSJMS SQL tables reside on the same subvolume as the SQL catalog,
using an editor of your choice, update the SQL catalog location in the
/usr/tandem/nsjms/version/creatsql file to reflect the
11. Add the JNDI and create a sample queue and topic by using these commands:
OSH: cd /usr/tandem/nsjms/version
OSH: java [Link]
NSJMS Admin started.
nsjms-> add jndi
Jndi Initialized
nsjms-> add queue Q1
Destination added.
nsjms-> add topic T1
Destination added.
nsjms-> exit
12. Compile the sample programs by using these commands. The sample programs
use the JNDI object store and destinations created in Step 11 on page 2-10:
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 Step 5 on page 2-8 and Step 6 on page 2-8.
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:
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
OSH: cd examples
OSH: java SimpleSender -queue Q1 -count 5
OSH: Publishing: Sending message 0
OSH: Publishing: Sending message 1
OSH: Publishing: Sending message 2
OSH: Publishing: Sending message 3
OSH: Publishing: Sending message 4
OSH: Finished Publishing 5 messages
OSH: cd examples
OSH: java SimpleConsumer -topic T1 -ackmode 1
OSH: cd examples
OSH: java SimplePublisher -topic T1 -count 5
OSH: cd examples
OSH: java SimpleConsumer -topic T1 -ackmode 1
Message listener has been set
OSH: Received message #1: Publishing this message 0
OSH: Received message #2: Publishing this message 1
OSH: Received message #3: Publishing this message 2
OSH: Received message #4: Publishing this message 3
OSH: Received message #5: Publishing this message 4
OSH: cd examples
OSH: java SimplePublisher -topic T1 -count 5
OSH: Finished publishing 5 messages
Note. All properties must appear in the properties file in a PropertyKey=Value format.
For example, [Link]=FileLogger.
[Link]
Default: 1000
Values: milliseconds
Value milliseconds—The time (in milliseconds) that the
Description: thread delays after a stream timeout occurs.
Example: [Link]=1000
[Link]
Default: 3000
Values: milliseconds
Value milliseconds—The time (in milliseconds) for a table
Descriptions: lock timeout. If milliseconds elapses before a lock is
acquired on a table, the statement fails, and SQL returns
a file system error 73 (disk file or record is locked).
Example: [Link]=3000
[Link]
Default: 100
Values: milliseconds
Value milliseconds—The time (in milliseconds) in which the
Descriptions: stream selects a block for new messages before a
timeout occurs.
Example: [Link]=100
[Link]
Default: [Link]
Values: [Link]
Value [Link]—The volume and subvolume of the
Description: database tables.
Example: [Link]=$[Link]
[Link]
Default: 0
Values: 0 through 5000
Value Dead messages are messages in topics which have
Description: been read by all existing subscribers of the topic
(including durable subscribers), and are therefore
unusable to any subscriber.
The messages are deleted periodically as part of the
regular receive process. The frequency of deletion is
determined by the delete-count value. A delete count of
100 means that after every 100th message received from
a topic, the client will automatically delete all dead
messages. When 0 is specified, no dead messages are
deleted.
Example: [Link]=100
[Link]
Default: [Link]
Value: name
Value name is the file location that contains log information.
Description:
Example: [Link]=[Link]
[Link]
Default: warning
Values: fatal | error | exception | warning | info | debug
Value fatal—Logs a fatal message that leads to abnormal
Descriptions: termination.
error—Logs messages that do not necessarily lead to
abnormal termination but still should be noted, such as a
message about an incorrect configuration parameter. A
log level of error displays messages that have log
levels of fatal and error
exception—Logs a specified exception.
warning—Logs messages that do not effect the integrity
of the JMS client but should be brought to the JMS
client’s attention. A log level of warning displays
messages that have log levels of fatal, error, exception,
and warning,
info—Logs messages that do not imply an error but
could indicate an important event, such as a message
that the JMS client is connected. A log level of info
displays messages that have log levels of fatal, error,
exception, warning, and info.
debug—Logs messages useful during a debugging
session. Setting [Link] to debug can
substantially degrade performance and should be used
only when requested by support personnel. A log level of
debug displays all levels of messages: fatal, error,
exception, warning, info, and debug.
Example: [Link]=warning
[Link]
Default: FileLogger
Values: FileLogger | ConsoleLogger
Value FileLogger—Logs to the file specified in [Link].
Descriptions:
ConsoleLogger—Logs to the client home term.
Example: [Link]=FileLogger
[Link]
Default: false
Values: true | false
Value true—Specifies that validation is performed on the
Description: administrative servlet XML request and reply using a
DTD.
false—Specifies that no validation is performed on the
administrative servlet XML administrative request and
reply using a DTD.
Example: [Link]=false
[Link]
Default: false
Values: true | false
Value true—Updates the statistics database at each
Descriptions: [Link].
false—Does not update the statistics database at each
[Link].
Example: [Link]=false
[Link]
Default: 60
Values: 1 through 60
Value 1 through 60—The interval (in minutes) in which Stats
Description: are recorded.
Example: [Link]=60
[Link] – Contains these properties that specify the JNDI initial
context and the location of JNDI objects:
Note. All properties must appear in the properties file in a PropertyKey=Value format.
For example,
[Link]=[Link]
ory
[Link]
Default: [Link]
Value: [Link]
Value [Link]
Description: specifies the JNDI initial context to be the file system.
Example: [Link]=[Link].
[Link]
[Link]
Default: [Link]
_store
Value: [Link]
_store
Value [Link]
Description: _store specifies the actual directory where the JNDI
objects are stored.
Example: [Link]=[Link]
tandem/nsjms/version/jndi_object_store
creatsql – Contains the sqlci database creation commands.
install – Contains the installation script that moves the [Link] and
[Link] and libnsjms_u64.so for 64-bit support files to the appropriate
JVM locations, runs the NSJ Makefile to bind the NSJMS libraries with the JVM,
and creates the SQL/MP tables.
[Link] – Contains the NSJMS administrative utility help file.
[Link] – Contains the license agreement for the NSJMS software.
[Link] – Contains the license agreement for the apache Software
foundation.
[Link] – Contains the license agreement for ExOffice Technologies, Inc.
/jndi_object_store – Contains the JNDI bindings for Administered objects.
/lib – Contains
NSJMS Client Classes ([Link]). This file contains the core classes for
NSJMS that implement the JAVA JMS API.
/examples – Contains
[Link]. This file is used with the administrative servlet sample program.
/bridge – Contains
[Link]. The [Link] script is used to launch the reliable messaging bridge
configuration tool which is used to map between queues and topics and to
define the persistent environment parameters.
After completion of the previous SQLCI ALTER TABLE command, the table has two
partitions that have these starting destination ID values:
Partition Location Starting Destination ID
$VOL1 0
$VOL2 10000
An existing partition within a message table that has three partitions is split. Before the
split operation, the message table has three partitions that have these starting
destination ID values:
Partition Location Starting Destination ID
$VOL1 0
$VOL2 10000
$VOL3 20000
By using this SQLCI ALTER TABLE command, $VOL1 splits into two partitions,
resulting in the new partition residing on $VOL4. Destinations that have ID values
greater than or equal to 5000 but less than the starting destination value for $VOL2
(10000) are relocated to $VOL4.
After completion of the above SQLCI ALTER TABLE command, the message table has
four partitions that have these starting destination ID values:
Partition Location Starting Destination ID
$VOL1 0
$VOL4 5000
$VOL2 10000
$VOL3 20000
The creatsql file that is provided with NSJMS includes this command to insert a
dummy record that has a destination ID value of 0.
Then use the administrative utility ADD Command on page 7-2 to assign destination
IDs for the new partition starting at 5001.
Uninstalling NSJMS
To remove an installed version of NSJMS, follow these steps from within the OSS
environment:
1. Remove the NSJMS library archive.
If NonStop Server for Java (T0083V31) is installed use these commands:
OSH: cd /usr/tandem/java/jre/lib/oss/posix_threads
OSH: rm libnsjms.a
OSH: cd /usr/tandem/java_public_lib
OSH: rm libnsjms.a
OSH: cd /usr/tandem/java/install
OSH: make
b. Delete the iTP Secure WebServer NSJMS directory by using these commands:
OSH: cd /usr/tandem/webserver/samples/Servlets
OSH: rm nsjms
OSH: cd /usr/tandem/webserver/conf
OSH: ./restart
OSH: cd /usr/tandem/nsjms
OSH: rm -R version
Note. Removal of this directory will require any future installation of NSJMS to start with
Run the IPSetup Program on page 2-3.
Software
WARNING. The JNDI 1.2.1 FS Context Service Provider from Sun Microsystems Java Naming
and Directory Interface (JNDI) Web site ([Link] must be
downloaded and extracted on your workstation. These files are required for NSJMS.
Note. NonStop SQL/MP driver is not required from H06.25 release onwards.
The following installation instructions are correct as of the time this manual was
published; however, the [Link] file or Softdoc supersedes the information here.
Note. Using DSM/SCM is optional for G06.18 or later RVUs, but is recommended.
Caution. Every time you use the Install product to install a release of the operating system
software, you must reinstall your Independent Product. Installing a release using the Install
product can result in overwriting this Independent Product with older versions of software. This
problem does not occur if you are using DSM/SCM to install releases.
To Run IPSetup
Exit all other Windows applications before placing NSJMS software on the host
system.
1. Open the product CD by double clicking on the CD drive.
2. Click the View Readme file button. Setup opens the README file in Notepad. Be
sure to review the entire README file before proceeding.
3. Click the IPSetup button to launch IPSetup. The program displays a Welcome
Screen and a License Agreement screen. To continue the installation, click Next
on each of these screens.
4. On the Placement Options screen select the NonStop Kernel RISC option.
If you plan on using DSM/SCM, check the box for “Use DSM/SCM to complete
installation on host.” Click Next.
If you do not plan on using DSM/SCM, uncheck the box for “Use DSM/SCM to
complete installation on host.” Click Next.
5. On the Product Selection screen, highlight NonStop Server for JMS as the product
you want to install. Click the ADD button. Click Next.
6. Log on using a user ID that can write to the /usr OSS directory (for example,
[Link]) by following the instructions on the Host Information screen. You can
use either the system name or the system IP address to log on. Click Next.
7. On the Host Target screen you can either accept the default locations for Work and
Backup subvolumes or browse to locations of your choice. Click Next when you
are satisfied with the locations.
8. On the Host File Placement screen you can either accept the default disk locations
or browse to locations of your choice. Click Next when you are satisfied with the
locations.
9. On the Placement Manifest screen review the file locations. You can click Back to
go back and change the file locations. When you are satisfied with the locations,
click Next. This step can take a few minutes to complete.
10. On the Placement Complete screen you can choose to view the release
documentation or to launch DSM/SCM. You should review the release
documentation.
11. After you review the release documentation, click Finish to complete running
IPSetup.
Note. You must be installing NSJMS on a NonStop NS-series system running H06.03 or
later RVU. For U64 support you must be installing NSJMS on a NonStop NS-series system
running H06.25 or later RVU.
3. COPY the received product files to a new revision of the software configuration you
want to update.
4. BUILD and APPLY the configuration revision.
5. Run ZPHIRNM to perform the RENAME step.
Note. If the option Manage OSS Files was not selected in the DSM/SCM planner interface
in Step 2 above, the NSJMS PAX file is in the Guardian subvolume $[Link] (where
ISV is the name of your installation subvolume). Use COPYOSS to extract and place the
contents of the NSJMS PAX file into the OSS file system. (Go to Use COPYOSS to Place the
Product Files in /usr/tandem on page 3-5).
6. Go to Install and Configure NSJMS on page 3-6 for detailed instructions about
running the install script and configuring NSJMS.
Note. You must be installing NSJMS on a NonStop NS-series system running H06.25 or
later RVU.
3. COPY the received product files to a new revision of the software configuration you
want to update.
4. BUILD and APPLY the configuration revision.
Note. Running the PINSTALL command does not affect any environment currently
running on your NonStop NS-series server.
7. Go to Install and Configure NSJMS on page 3-6 for detailed instructions about
running the install script and configuring NSJMS.
COPYOSS extracts the files contained in T1251PAX and places them in the
version-specific OSS directory /usr/tandem/nsjms/version, where version
for this RVU is: (for example, T1251H10_30MAY2005_H10).
Note. Running the copyoss command does not affect any environment currently running
on your NonStop NS-series server.
3. Go to Install and Configure NSJMS on page 3-6 for detailed instructions about
running the install script and configuring NSJMS.
Note. The installation steps do not require [Link] privileges. However, to maintain a
secure environment, you should choose or create a user ID that is configured for the OSS
environment and from under which you run your JMS applications. Use this user ID to
perform the post-installation steps.
3. TACL>OSH
OSH: cd /<jms-install-dir>/nsjms/T1251H10_30MAY2005_H10/lib
OSH: chmod u+x [Link]
OSH: chmod u+x libnsjms_64.so
4. Use the export command to update the NSJMS_HOME variable. For example:
OSH: cd /<jms-install-dir>/nsjms/T1251H10_30MAY2005_H10
OSH: export NSJMS_HOME=$PWD
5. Use the export command to update the CLASSPATH variable. For example:
6. Verify that you have access to an existing SQL catalog, or create a new catalog.
NSJMS uses SQL tables to store messages and destination information.
To create a new SQL catalog:
For additional information about the requirements for creating SQL catalogs, see
the SQL/MP Installation and Management Guide.
7. Update SQL Catalog and Table Location:
If the NSJMS SQL tables reside on the same subvolume as the SQL catalog,
using an editor of your choice, update the SQL catalog location in the
/usr/tandem/nsjms/version/creatsql file to reflect the
[Link] of the existing or newly created SQL catalog specified in Step
6 on page 3-7. For example:
Change:
VOLUME;
To:
VOLUME $[Link];
If the NSJMS SQL tables will reside on a different subvolume than the SQL
catalog, using an editor of your choice, add the SQL catalog location to the
/usr/tandem/nsjms/version/creatsql file by adding a CATALOG
command referring to the catalog from Step 6 on page 3-7, and update the
VOLUME command to refer to the [Link] where the database tables
will reside. For example:
Change:
VOLUME;
To:
CATALOG $volume1.subvol1
VOLUME $volume2.subvol2
8. Use this command to create the NSJMS SQL tables. For example:
10. Add the JNDI and create a sample queue and topic by using these commands:
OSH: cd /usr/tandem/nsjms/version
OSH: java [Link]
NSJMS Admin started.
nsjms-> add jndi
Jndi Initialized
nsjms-> add queue Q1
Destination added.
nsjms-> add topic T1
Destination added.
nsjms-> exit
11. Compile the sample programs by using these commands. The sample programs
use the JNDI object store and destinations created in Step 10 on page 3-8:
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 Step 4 on page 3-6 and Step 5 on page 3-6.
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:
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
OSH: cd examples
OSH: java SimpleSender -queue Q1 -count 5
OSH: Publishing: Sending message 0
OSH: Publishing: Sending message 1
OSH: Publishing: Sending message 2
OSH: Publishing: Sending message 3
OSH: Publishing: Sending message 4
OSH: Finished Publishing 5 messages
OSH: cd examples
OSH: java SimpleConsumer -topic T1 -ackmode 1
OSH: cd examples
OSH: java SimplePublisher -topic T1 -count 5
OSH: cd examples
OSH: java SimpleConsumer -topic T1 -ackmode 1
Message listener has been set
OSH: Received message #1: Publishing this message 0
OSH: Received message #2: Publishing this message 1
OSH: Received message #3: Publishing this message 2
OSH: Received message #4: Publishing this message 3
OSH: Received message #5: Publishing this message 4
OSH: cd examples
OSH: java SimplePublisher -topic T1 -count 5
OSH: Finished publishing 5 messages
Note. All properties must appear in the properties file in a PropertyKey=Value format.
For example, [Link]=FileLogger.
[Link]
Default: 1000
Values: milliseconds
Value milliseconds—The time (in milliseconds) that the
Description: thread delays after a stream timeout occurs.
Example: [Link]=1000
[Link]
Default: 3000
Values: milliseconds
Value milliseconds—The time (in milliseconds) for a table
Descriptions: lock timeout. If milliseconds elapses before a lock is
acquired on a table, the statement fails, and SQL returns
a file system error 73 (disk file or record is locked).
Example: [Link]=3000
[Link]
Default: 100
Values: milliseconds
Value milliseconds—The time (in milliseconds) in which the
Descriptions: stream selects a block for new messages before a
timeout occurs.
Example: [Link]=100
[Link]
Default: [Link]
Values: [Link]
Value [Link]—The volume and subvolume of the
Description: database tables.
Example: [Link]=$[Link]
[Link]
Default: 0
Values: 0 through 5000
Value Dead messages are messages in topics which have
Description: been read by all existing subscribers of the topic
(including durable subscribers), and are therefore
unusable to any subscriber.
The messages are deleted periodically as part of the
regular receive process. The frequency of deletion is
determined by the delete-count value. A delete count of
100 means that after every 100th message received from
a topic, the client will automatically delete all dead
messages. When 0 is specified, no dead messages are
deleted.
Example: [Link]=100
[Link]
Default: [Link]
Value: name
Value name is the file location that contains log information.
Description:
Example: [Link]=[Link]
[Link]
Default: warning
Values: fatal | error | exception | warning | info | debug
Value fatal—Logs a fatal message that leads to abnormal
Descriptions: termination.
error—Logs messages that do not necessarily lead to
abnormal termination but still should be noted, such as a
message about an incorrect configuration parameter. A
log level of error displays messages that have log
levels of fatal and error
exception—Logs a specified exception.
warning—Logs messages that do not effect the integrity
of the JMS client but should be brought to the JMS
client’s attention. A log level of warning displays
messages that have log levels of fatal, error, exception,
and warning,
info—Logs messages that do not imply an error but
could indicate an important event, such as a message
that the JMS client is connected. A log level of info
displays messages that have log levels of fatal, error,
exception, warning, and info.
debug—Logs messages useful during a debugging
session. Setting [Link] to debug can
substantially degrade performance and should be used
only when requested by support personnel. A log level of
debug displays all levels of messages: fatal, error,
exception, warning, info, and debug.
Example: [Link]=warning
[Link]
Default: FileLogger
Values: FileLogger | ConsoleLogger
Value FileLogger—Logs to the file specified in [Link].
Descriptions:
ConsoleLogger—Logs to the client home term.
Example: [Link]=FileLogger
[Link]
Default: false
Values: true | false
Value true—Specifies that validation is performed on the
Description: administrative servlet XML request and reply using a
DTD.
false—Specifies that no validation is performed on the
administrative servlet XML administrative request and
reply using a DTD.
Example: [Link]=false
[Link]
Default: false
Values: true | false
Value true—Updates the statistics database at each
Descriptions: [Link].
false—Does not update the statistics database at each
[Link].
Example: [Link]=false
[Link]
Default: 60
Values: 1 through 60
Value 1 through 60—The interval (in minutes) in which Stats
Description: are recorded.
Example: [Link]=60
[Link] – Contains these properties that specify the JNDI initial
context and the location of JNDI objects:
Note. All properties must appear in the properties file in a PropertyKey=Value format.
For example,
[Link]=[Link]
ory
[Link]
Default: [Link]
Value: [Link]
Value [Link]
Description: specifies the JNDI initial context to be the file system.
Example: [Link]=[Link].
[Link]
[Link]
Default: [Link]
_store
Value: [Link]
_store
Value [Link]
Description: _store specifies the actual directory where the JNDI
objects are stored.
Example: [Link]=[Link]
tandem/nsjms/version/jndi_object_store
creatsql – Contains the sqlci database creation commands.
[Link] – Contains the NSJMS administrative utility help file.
[Link] – Contains the license agreement for the NSJMS software.
[Link] – Contains the license agreement for the apache Software
foundation.
[Link] – Contains the license agreement for ExOffice Technologies, Inc.
/jndi_object_store – Contains the JNDI bindings for Administered objects.
/lib – Contains
NSJMS Client Classes ([Link]). This file contains the core classes for
NSJMS that implement the JAVA JMS API.
/examples – Contains
[Link]. This file is used with the administrative servlet sample program.
/bridge – Contains
[Link]. The [Link] script is used to launch the reliable messaging bridge
configuration tool which is used to map between queues and topics and to
define the persistent environment parameters.
After completion of the previous SQLCI ALTER TABLE command, the table has two
partitions that have these starting destination ID values:
Partition Location Starting Destination ID
$VOL1 0
$VOL2 10000
An existing partition within a message table that has three partitions is split. Before the
split operation, the message table has three partitions that have these starting
destination ID values:
Partition Location Starting Destination ID
$VOL1 0
$VOL2 10000
$VOL3 20000
By using this SQLCI ALTER TABLE command, $VOL1 splits into two partitions,
resulting in the new partition residing on $VOL4. Destinations that have ID values
greater than or equal to 5000 but less than the starting destination value for $VOL2
(10000) are relocated to $VOL4.
After completion of the above SQLCI ALTER TABLE command, the message table has
four partitions that have these starting destination ID values:
Partition Location Starting Destination ID
$VOL1 0
$VOL4 5000
$VOL2 10000
$VOL3 20000
The creatsql file that is provided with NSJMS includes this command to insert a
dummy record that has a destination ID value of 0.
Then use the administrative utility ADD Command on page 7-2 to assign destination
IDs for the new partition starting at 5001.
Messaging Models
The JMS model supports Point-to-Point and Publish/Subscribe messaging models.
Within each messaging model, the generic JMS interfaces are further defined to
address behavior specific to each messaging model.
Point-to-Point (PTP)
A PTP messaging application is a one-to-one messaging model which uses queues for
messaging destinations. A message is sent by a sending client to a specific queue
where the message can be received by the receiving client. A queue retains a
message until it is received by the receiving client or until the message expires.
The generic JMS interfaces are further defined within the PTP messaging application
as:
Queue Interfaces Description
QueueConnection Provides an active connection to NSJMS that is used to create one or
more QueueSessions.
QueueSession Provides methods for creating QueueSender’s and QueueReceiver’s.
QueueSender Used to send messages to a queue.
QueueReceiver Used to receive messages that have been delivered to a queue.
Publish/Subscribe (Pub/Sub)
A Pub/Sub messaging application is a one-to-many messaging model which uses
topics for messaging destinations. A message is published by a sending client to a
topic where any receiving client who is subscribed to the topic will receive the
message. A topic retains a message until the message expires.
The generic JMS interfaces are further defined within the Pub/Sub messaging
application as:
Topic Interfaces Description
TopicConnection Provides an active connection to NSJMS that is used to create one or
more TopicSessions.
TopicSession Provides methods for creating TopicPublisher’s and TopicSubscriber’s.
TopicPublisher Used to publish messages to a topic.
TopicSubscriber Used to receive messages that have been published to a topic.
Administered Objects
Administered objects are built using the administrative utility and are stored in a JNDI
namespace. For information about using the administrative utility to build NSJMS
administered objects, see Section 7, Managing the NSJMS Environment. A JMS client
can retrieve the administered objects from the JNDI namespace and use them without
needing to know how they have been implemented.
JMS clients use administered objects to create connections to NSJMS and to specify
the destinations for messages. All NSJMS-specific information is contained in
implementations of these NSJMS administered objects:
NSJMS Administered Objects Description
QueueConnectionFactory Used within a PTP messaging application by JMS clients
for creating connections to NSJMS.
TopicConnectionFactory Used within a Pub/Sub messaging application by JMS
clients for creating connections to NSJMS.
Queue Used within a PTP messaging application by JMS clients
to specify the destinations to and from which the JMS
clients send and receive messages.
Topic Used within a Pub/Sub messaging application by JMS
clients to specify the destinations to and from which the
JMS clients send and receive messages.
Creating a Connection
A JMS client uses a ConnectionFactory object to create a connection with NSJMS. To
create a connection between a JMS client and NSJMS:
Create an Initial Context on page 4-4
Retrieve the Connection Factory on page 4-4
Use the Factory Object to Create a Connection on page 4-5
Start the Connection on page 4-5
Create a Session on page 4-5.
Note. At this time, no interoperability exists among the JMS providers. A user achieves
platform interoperability by using a JMS provider that is present on all the required platforms.
Two or more JMS implementations can coexist. A user must establish JMS connections to
each provider from the same Java program. The user can then receive messages from one
provider and send the message using another provider. NSJMS includes code that transforms
foreign messages to native format when the messages are sent using a NSJMS session.
Note. To protect the JMS application from NSJMS-specific information, factory objects are
stored in a JNDI namespace.
Create a Session
After you have started the connection, use a queue or topic session method to create a
session.
Creating a queue session is shown in this code fragment taken from the
[Link] sample program file:
QueueSession session = [Link](false,
Session.AUTO_ACKNOWLEDGE);
Creating a topic session is shown in this code fragment taken from the
[Link] sample program file:
TopicSession session = [Link](false,
Session.CLIENT_ACKNOWLEDGE);
Transactions
NSJMS supports transacted sessions and external transactions. Transacted sessions
allow you to send and receive multiple messages in a single transaction that is local to
the session. External transactions are inherited transactions that start and end external
to NSJMS and allow you to combine other database or server work with the same
transaction that reads or sends messages. External transactions are defined using
either the current class methods or the JTA both of which are described in the NonStop
Server for Java Programmer’s Reference.
The JMS client process' current TMF transaction is inherited by NSJMS send-and-
receive operations. If no current transaction exists, a transaction is started within
NSJMS and committed within NSJMS.
Messages sent within a transaction are received by consumers only after the
transaction is committed. Messages received from a queue within a transaction are not
removed from the queue until the transaction is committed.
Transacted Sessions
JMS sessions are created as transacted sessions. Transacted sessions use JMS
commit() and rollback() methods to commit or abort the transaction started for
the session. NSJMS supports transacted sessions, but the use of external transactions
overrides the transacted session. Within a transacted session, an external transaction
can send and receive messages. The JMS session commit() and rollback()
methods affects only those operations that were performed without an external
transaction.
Caution. When a transacted session is used to receive messages and an external transaction
is started without first issuing a commit() or rollback() method for the transacted session,
an error may occur if a receive() method is issued under the external transaction. This is
because two active transactions are associated with the cursor used to read messages. The
transacted session should be committed or rolled back before using the external transaction.
When writing JMS client code, check that no more than one current transaction exists for each
subscriber, receiver, or publisher.
Non-Transacted Sessions
Non-Transacted sessions use client acknowledgment to signal when receives are
committed. Client acknowledgment is determined by a mode established for the
session and can be implicit (AUTO_ACKNOWLEDGE and DUPS_OK_ACKNOWLEDGE) or
explicit (CLIENT_ACKNOWLEDGE). An external transaction overrides the client
acknowledgment mode. A client's explicit message acknowledgment acknowledges
only those messages received without an external transaction.
Sending Messages
A JMS client uses a MessageProducer to send messages to a specified destination. A
message producer is an object created by a session that is used by JMS clients to
send messages to queues or topics. The PTP messaging application uses the
QueueSender interface as its message producer, and the Pub/Sub messaging
application uses the TopicPublisher interface as its message producer.
Specifying a Destination
A QueueSender or TopicPublisher is typically created for a specific queue or topic. This
ensures that all messages sent using the QueueSender or TopicPublisher are sent to
the specific queue or topic. The destination of the queue or topic is specified using a
Queue or Topic object. Queue and Topic objects can be built and stored in a JNDI
namespace or created at runtime.
Destination Names
Queue names and topic names are Java letters and Java digits, limited to 100 bytes,
where the first character is a Java letter. This syntax also describes subscription
names and client IDs.
Temporary Destinations
JMS allows for the creation of temporary queues and topics that exist only for the
duration of a JMS connection. A temporary queue or topic is a unique destination that
survives only as long as the JMS connection that created it. NSJMS creates these as
specially named destinations with these prefixes: __temp_queue__ or __temp_topic__.
When a JMS connection is closed, any temporary destinations along with associated
messages are removed. If an application ends abnormally and a close operation is
not performed, the temporary destinations and associated messages remain on the
database until the next DELETE MESSAGE EXPIRED operation is performed.
This code fragment creates a temporary queue destination:
Queue queue = [Link]();
This code fragment creates a temporary topic destination:
Topic topic = [Link]();
Destination IDs
Destinations (queues and topics) within NSJMS are assigned IDs that represent the
destinations in the database. The IDs allow efficient storage for messages and flexible
partitioning of the message table.
Assignment of the destination ID is done when the destination is first created. This
assignment can be automatic (implicit) or it can be explicitly provided within the
administrative commands.
Explicit destination-ID assignment is useful when you need message-table partitioning.
The IDs are chosen so that ranges are defined over the IDs to identify the partitions.
For example, you can group destinations by 100s with separate partitions assigned to
each range of 100.
Destination IDs must be positive numbers, 1 to 32767 (SHORT_MAX). If no explicit
ID is specified, the ID is generated by adding one to the current highest ID. Destination
IDs cannot be changed once assigned. You must delete and re-create a destination to
change an ID.
Persistence
NSJMS does not optimize for NON_PERSISTENT messages (deliver at most once). All
messages are treated as having PERSISTENT delivery mode (deliver once and only
once).
Priority
JMS allows message priority to be set by the setPriority() method on the
MessageProducer object and retrieved using the getPriority() method on the
MessageConsumer object. Although NSJMS allows message priority to be set and
retrieved, this priority does not affect message-delivery order.
Receiving Messages
A JMS client uses a MessageConsumer to receive messages from a specified
destination. A message consumer is an object created by a session that is used by
JMS clients to receive messages from queues or topics. The PTP messaging
application uses QueueReceiver as its message consumer, and the Pub/Sub
messaging application uses TopicSubscriber as its message consumer.
This code fragment shows the use of instanceof when pulling the contents from a
TextMessage:
if (inMessage instanceof TextMessage){
String replyString =((TextMessage)inMessage).getText();
.
.
.
} else {
[Link]("Reply message was not a TextMessage");
}
Non-durable Subscribers
These subscribers only receive messages that are published on a chosen topic while
the subscriber is active.
To create a non-durable subscriber use the createSubscriber() method for the
session object. For example:
TopicSubscriber subscriber = [Link](topic);
Non-durable subscribers automatically terminate themselves when their close()
method is called.
Durable Subscribers
These subscribers receive all messages published on a topic, including messages
published while the subscriber is inactive.
A durable subscriber registers a durable subscription with a unique identity that is
retained by the NSJMS. Subsequent subscriber objects with the same identity resume
the subscription in the same state as left by the previous subscriber. If a durable
subscription has no active subscriber, the NSJMS retains the subscription's messages
until they are received by the subscription or until they expire.
To establish a unique identity for a durable subscriber specify:
A client ID for the connection.
A topic and a subscription name for the subscriber.
The client ID is set by calling the setClientID() method for the connection object.
For example, [Link] ("client_ID_01");
The client ID must be set before creating the durable subscription. To create a durable
subscriber use the createDurableSubscriber() method for the session object.
This method is similar to creating a non-durable subscriber, except that you must pass
a subscription name to identify the unique subscriber. For example:
TopicSubscriber subscriber=
[Link](topic,MY_SUB_01);
The subscriber becomes active after you start the TopicConnection. Later on, the
TopicSubscriber can be closed by calling the close() method of
TopicSubscriber object. For example, [Link]();
If the program or another application calls createDurableSubscriber method with
the same client ID, topic, and subscription name, then the subscription is reactivated.
Subsequently, the NSJMS delivers the messages that were published while the
subscriber was inactive.
To terminate a durable subscriber, use the unsubscribe() method and submit the
unique name that created the subscriber. For example:
[Link](MY_SUB_01);
No-Local
You can ignore messages that are sent or published on the subscriber’s own
connection by setting the third parameter of the createSubscriber() method to
true.
This code fragment causes messages published on the subscriber’s connection to be
ignored:
TopicSubscriber sub =
[Link](topic,null,true);
Note. Although multiple sessions are allowed, they should not be repetitively created for
Consumers or Producers.
TopicSubscriber subscriber =
[Link](topicSub,
"MySubscription");
TopicPublisher publisher =
[Link](topicPub);
TextMessage messagePub =
[Link]();
[Link]([Link]());
[Link](messagePub);
//session commits can be done after each message or
//batched
}
}
Threading
You can use JMS with multithreaded Java applications. Although threading is
supported, the send calls block the process during send operations and the receive
calls support the non-blocking features of SQL/MX during receive operations when
sqlmx_nowait is set to on.
Two NSJMS property values specify the threading behavior. The [Link]
property value is the time in milliseconds during which stream selects block for new
messages before a timeout. The [Link] property value is the time in
milliseconds that the thread is delayed after a timeout.
Setting the [Link] and [Link] values below 1000 gives
more responsive threads because the read is stopped and restarted frequently, which
allows other threads to run. This responsiveness costs in system throughput, however,
because the read is tried several times for each message. In single-threaded
applications and applications where inter-thread responsiveness is not critical, use
[Link] and [Link] values greater than 1000 so that the
JVM is not busy waiting. When messages are not available, the process blocks,
allowing other processes to run.
Send Operations
Queue-send operations and Topic publish operations block the process for a short
duration during a SQL INSERT operation.
Receive Operations
Queue-receive operations and Topic-receive operations support the non-blocking
features of SQL/MX during receive operations only when the system property
sqlmx_nowait is set to on. The non-blocking features of SQL/MX are useful in multi-
threaded programs that use separate threads to receive messages simultaneously
from different sources or to perform processing while awaiting messages.
The system property sqlmx_nowait toggles the non-blocking function. The default
value is off. sqlmx_nowait can be set from the command line by using the -D option
(-Dsqlmx_nowait=on|off) or programmatically, before obtaining the first NSJMS
connection, by using the [Link]() method.
The sqlmx_nowait value is obtained from the environment only at the time of the first
JDBC/MX connection. The JDBC/MX driver is then configured with the value of the
sqlmx_nowait system property for any subsequent connections within the same
JVM.
After initiating the receive operation, NSJMS yields the thread control to the JVM.
When a message arrives, the JVM wakes up the thread and returns the message to
the application.
If sqlmx_nowait is set to on, users may want to set the [Link] value
to 1000+ milliseconds so the thread waits on messages for a longer period. The larger
timeout value can improve performance because the SQL operation is stopped and
restarted less frequently while awaiting a message; the longer timeout does not block
the process since other threads run during the time spent waiting for the message.
start_template.txt
start_template.txt ServerClass
Foreign JMS Protocol
stop_template.txt
stop_template.txt JMS Client API
NSJMS Bridge
[Link]
OSH: cd /usr/tandem/nsjms/version/bridge
OSH: export JAVA_HOME=/usr/tandem/java
OSH: cd /usr/tandem/nsjms/version
OSH: export NSJMS_HOME=/usr/tandem/nsjms/version
OSH: cd /usr/tandem/nsjms/version/bridge
Example 5-1 on page 5-4 shows where in the [Link] script the modifications should
be made.
if [[ -z $NSJMS_HOME ]] then
print "Environment variable NSJMS_HOME must be set prior to running
$0."
print "Set it to the path name of the NSJMS product directory."
return 3
fi
#
# Add supporting jar files here.
#
export BRIDGE_SUPPORT_JARS=
FOREIGN_PROVIDER_CLIENT_JAR_FILE_DIRECTORY_LOCATION:
FOREIGN_PROVIDER_CLIENT_JAR_FILE_DIRECTORY_LOCATION:
FOREIGN_PROVIDER_CLIENT_JAR_FILE_DIRECTORY_LOCATION:
FOREIGN_PROVIDER_CLIENT_JAR_FILE_DIRECTORY_LOCATION
#
#
#
export
CLASSPATH=$PWD:$CLASSPATH:$NSJMS_HOME/lib/[Link]:$NSJMS_HOME/lib/[Link]:
$NSJMS_HOME/lib/[Link]:$NSJMS_HOME/lib/[Link]:$BRIDGE_SUPPOR
T_JARS
echo java -classpath $CLASSPATH [Link] $*
java -classpath $CLASSPATH [Link] $*
Caution. All tasks can only be performed from within the configuration tool.
Add a Destination
The add dest command defines a destination and generates the
[Link] file.
Example
An example of using the configuration tool to add a destination named queue0 is
shown below. Bold text indicates user input.
Alter a Destination
The alter dest command alters the configured properties for an existing destination
and updates the [Link] file with the newly configured
properties.
Caution. If you alter the configured properties of a destination that is in use by a bridge, you
must update the bridge pathway configuration using the alter bridge command.
Example
An example of using the configuration tool to alter the JNDI Destination Name from
queue0 to queue99 is shown below. Bold text indicates user input.
Delete a Destination
The delete dest command deletes an existing destination and updates the
[Link] file.
Caution. If you delete a destination that is in use by a bridge, you must update the bridge to
specify an existing destination using the alter bridge command.
Example
An example of using the configuration tool to delete the destination named queue0
from the [Link] file is shown below. Bold text indicates user
input.
Example
An example of using the configuration tool to request information for all configured
destinations, Destination Name: *, is shown below. Bold text indicates user input.
Note. You must first add destinations using the add dest command before adding a bridge
using the add bridge command.
Example
An example of using the configuration tool to add a bridge Pathway configuration is
shown below. Bold text indicates user input.
Alter a Bridge
The alter bridge command alters an existing bridge Pathway configuration,
updates the [Link] file with the new values, and regenerates the
start and stop scripts.
Caution. The Database vol/subvol property is global to the Pathmon Process Name
and any change to the [Link] name/value combination will be implemented
across every server class running under the Pathmon Process Name. For information on
changing the [Link] for a specific server class, see
pathmon_process_name.server_class_name.properties File on page 5-28.
Example
An example of using the configuration tool to alter the batch size in the range 1 through
10 is shown below. Bold text indicates user input.
Delete a Bridge
The delete bridge command deletes an existing bridge Pathway configuration,
updates the [Link] file, and regenerates the start and stop scripts.
Example
An example of using the configuration tool to delete the bridge named [Link] is
shown below. Bold text indicates user input.
Examples
An example of using the configuration tool to request information about a specific
bridge, [Link], is shown below. Bold text indicates user input.
An example of using the configuration tool to request information about all currently
configured bridges, Pathmon Process Name [sampl]: *, is shown below. Bold text
indicates user input.
Start Script
The configuration tool replaces generic configuration placeholders contained in the
start_template.txt file with bridge Pathway configured values when the
executable Pathway start script (start_pathmon_name) is generated using the add
bridge, alter bridge, or delete bridge commands. The start script is used to
start a bridge within a Pathway environment (see Starting the Bridge on page 5-18).
The generic configuration placeholders replaced in the start_template.txt file are
shown in bold text in Example 5-2 on page 5-20). A sample executable Pathway start
script containing the bridge Pathway configured values in bold text is shown in
Example 5-3 on page 5-23).
#
# Check for NonStop Java - first T0083 then T2766. (For U64 support, Java SPR
# T2766H70 or above is supported).
#
JAVA_BINARY="$JAVA_HOME/bin/oss/posix_threads/java"
if [[ -f $JAVA_BINARY ]]; then
print "Found NonStop Java in $JAVA_BINARY"
else
JAVA_BINARY="$JAVA_HOME/bin/java"
if [[ -f $JAVA_BINARY ]]; then
print "Found NonStop Java in $JAVA_BINARY"
else
print "NonStop Java has not been installed on the system, please "
print "install NonStop Server for Java to the $JAVA_HOME directory "
print "and then run this script again. "
print ""
print "Exiting ... "
print ""
return 1
fi
fi
#
# Set G_HOMETERM to the terminal identifier on which standard
# output is displayed.
#
#
# Check for NonStop Java - first T0083 then T2766. (For U64 support, Java SPR
# T2766H70 or above is supported).
#
JAVA_BINARY="$JAVA_HOME/bin/oss/posix_threads/java"
if [[ -f $JAVA_BINARY ]]; then
print "Found NonStop Java in $JAVA_BINARY"
else
JAVA_BINARY="$JAVA_HOME/bin/java"
if [[ -f $JAVA_BINARY ]]; then
print "Found NonStop Java in $JAVA_BINARY"
else
print "NonStop Java has not been installed on the system, please "
print "install NonStop Server for Java to the $JAVA_HOME directory "
print "and then run this script again. "
print ""
print "Exiting ... "
print ""
return 1
fi
fi
#
# Set G_HOMETERM to the terminal identifier on which standard
# output is displayed.
#
eof
grep -q -i error $PWD/[Link]
if [[ $? -eq 0 ]] then
print "Error in starting pathcom, refer to [Link] for information"
else
print "Messaging Bridge environment was started."
print "Individual servers can take some time to activate."
fi
Stop Script
The configuration tool replaces a generic configuration placeholder contained in the
stop_template.txt file with a bridge Pathway configured value when the
executable Pathway stop script (stop_pathmon_name) is generated using the add
bridge, alter bridge, or delete bridge commands. The stop script is used to
stop a bridge within a Pathway environment (see Stopping the Bridge on page 5-18).
The generic configuration placeholder replaced in the stop_template.txt file is
shown in bold text in Example 5-4 on page 5-26. A sample executable Pathway stop
script containing the bridge Pathway configured values in bold text is shown in
Example 5-5 on page 5-26.
pathmon_process_name.properties File
The pathmon_process_name.properties file is generated using the add
bridge command and is regenerated by the alter bridge and delete bridge
commands. The file is read by the bridge at startup, and contains the two properties
listed below in addition to the properties contained in the [Link] file. For
information on the contents of the [Link] file, see page 2-12.
[Link]
Default: 60000
Values: milliseconds
Value milliseconds—The time (in milliseconds) the
Descriptions: receive() method waits for a message on the source
queue or topic.
Example: [Link]=60000
[Link]
Default: 60000
Values: milliseconds
Value milliseconds—The time (in milliseconds) between
Descriptions: when a connection is lost and an attempt is made to
reconnect.
Example: [Link]=60000
An example of the [Link] file generated during the Add a Bridge
Pathway Configuration with Server Class on page 5-10 is
server_class.[Link] File
The server_class.[Link] file is an optional file you create if you have
additional JNDI properties to specify for a specific server class in addition to the
general JNDI properties specified in the add dest command.
Note. The properties in the server_class.[Link] file are applied only to the
specified server class.
You create this file using an editor of your choice and populate the file with the
additional JNDI properties that you want to apply to the specified server class. The file
must be named
server_class.[Link]
where server_class is the name entered at the Pathway Server Class Name:
prompt in the add bridge command (for example, [Link]).
At startup, the JNDI values specified in the add dest command are passed to the
bridge process on the command line in the start script. The bridge process then
pathmon_process_name.server_class_name.properties
File
The pathmon_process_name.server_class_name.properties file is an
optional file you create if you want to specify property name/value pairs for a specific
server class. The bridge process uses the
pathmon_process_name.server_class_name.properties file to override or
add to the property name/value pairs contained in the
pathmon_process_name.properties file.
You create this file using an editor of your choice and populate the file with the property
name/value pairs that you want to apply to the specified server class. The file must be
named
pathmon_process_name.server_class_name.properties
where
pathmon_process_name is the name entered at the Pathmon Process
Name: prompt for the add bridge command
and
server_class_name is the name entered at the Pathway Server Class
Name: prompt for the add bridge command.
For example, [Link].
At startup, the bridge process reads the properties contained in the
pathmon_process_name.properties file. The bridge process then searches it’s
CLASSPATH for the pathmon_process_name.server_class_name.properties
file. If the file is found, the bridge process reads the properties contained in the
pathmon_process_name.server_class_name.properties file and applies
these properties to the specified server class in addition to the existing properties in the
pathmon_process_name.properties file.
For example, the bridge process reads in the properties in the below
[Link] file generated during the Add a Bridge Pathway Configuration
with Server Class on page 5-10.
The bridge process then searches its CLASSPATH and finds the below user created
[Link] file.
[Link]=$[Link]
Hardware
HP NonStop S-series server
Software
ITP Secure WebServer (T8997), Release 5
And one of these:
Java Servlets (T0094V20)
NonStop Servlets for JavaServer Pages (T1222V1X)
NonStop Servlets for JavaServer Pages (T1222V20)
2. Use the cd command to go to the directory where the ITP Secure WebServer
configuration file is located. For example:
OSH: cd /usr/tandem/webserver/conf
OSH: cd /usr/tandem/webserver/samples/Servlets
OSH: mkdir nsjms
OSH: cp /usr/tandem/nsjms/version/examples/JmsAdminServlet.html_
/usr/tandem/webserver/samples/Servlets/nsjms
OSH: cd /usr/tandem/webserver/conf
OSH: ./restart
[Link]
[Link]
2. Use the cd command to go to the directory where the ITP Secure WebServer
configuration file is located. For example:
OSH: cd /usr/tandem/webserver/conf
OSH: cd /usr/tandem/webserver/servlet_jsp/conf
OSH: cd /usr/tandem/webserver/servlet_jsp/webapps
OSH: mkdir nsjms
OSH: cp /usr/tandem/nsjms/version/examples/[Link]
/usr/tandem/webserver/servlet_jsp/webapps/nsjms
where /usr/tandem/nsjms/version/examples/[Link]
represents the examples directory of the NSJMS installation.
8. Using an editor of your choice, modify the [Link] file copied in
Step 7:
Locate the command:
<FORM METHOD="POST" NAME="AdminRequest"
ACTION="/servlet/[Link]">
Change the command to:
<FORM METHOD="POST" NAME="AdminRequest"
ACTION="servlet/JmsAdminServlet">
9. Create the NSJMS servlet directory
/usr/tandem/webserver/servlet_jsp/webapps/nsjms/WEB-INF by
executing these commands:
OSH: cd /usr/tandem/webserver/servlet_jsp/webapps/nsjms
OSH: mkdir WEB-INF
OSH: cd /usr/tandem/webserver/servlet_jsp/webapps/nsjms/WEB-INF
11. Copy the [Link] sample program file located in the NSJMS examples directory
to the NSJMS directory created in Step 10:
OSH: cp /usr/tandem/nsjms/version/examples/[Link]
/usr/tandem/webserver/servlet_jsp/webapps/nsjms/WEB-INF
OSH: cd /usr/tandem/webserver/conf
OSH: ./restart
13. The servlet can now be activated by accessing the [Link] file,
[Link]
through your web browser. For example:
[Link]
[Link]
2. Use the cd command to go to the directory where the ITP Secure WebServer
configuration file is located; for example:
OSH: cd /usr/tandem/webserver/conf
OSH: cp /usr/tandem/nsjms/version/lib/*.jar
/usr/tandem/webserver/servlet_jsp/common/lib
OSH: cd /usr/tandem/webserver/servlet_jsp/conf
OSH: cp /usr/tandem/nsjms/version/examples/[Link]
/usr/tandem/webserver/servlet_jsp/webapps/nsjms
where /usr/tandem/nsjms/version/examples/[Link]
represents the examples directory of the NSJMS installation.
9. Using an editor of your choice, modify the [Link] file copied in
Step 8, as:
Locate the command:
<FORM METHOD="POST" NAME="AdminRequest"
ACTION="/servlet/[Link]">
Change the command to:
<FORM METHOD="POST" NAME="AdminRequest"
ACTION="servlet/JmsAdminServlet">
10. Create the NSJMS servlet directory
/usr/tandem/webserver/servlet_jsp/webapps/nsjms/WEB-INF by
executing this command:
OSH: cd /usr/tandem/webserver/servlet_jsp/webapps/nsjms/WEB-INF
12. Copy the [Link] sample program file located in the NSJMS examples directory
to the NSJMS directory created in Step 11:
OSH: cp /usr/tandem/nsjms/version/examples/[Link]
/usr/tandem/webserver/servlet_jsp/webapps/nsjms/WEB-INF
OSH: cd /usr/tandem/webserver/conf
OSH: ./restart
14. The servlet can now be activated by accessing the [Link] file,
[Link]
through your web browser. For example:
[Link]
[Link]
Note. The administrative utility relies on the security features of the Guardian environment and
NonStop SQL/MX to protect the information in the NSJMS database. Therefore, use the same
user ID to manage the data as was used to create the database.
you can access and manage the NSJMS environment by using any of these
commands, which are described in detail in the following pages:
ADD HELP
ALTER INFO
DELETE STATS
EXIT
ADD Command
The ADD command adds a queue or topic to the database or NSJMS connection
factories to the JNDI space.
JNDI name }
name
is the name to be associated with the queue or topic to be added to the database.
Queue names and Topic names must be Java letters and digits. The first character
must be a Java letter and the length is limited to 100 characters.
EXPIRY millisecs
specifies the time (in milliseconds) after a message is sent until the message
expires. If the EXPIRY attribute value is set to zero, a message never expires. The
ID
specifies the location of the queue or topic in the NSJMS database.
Default If no ID is specified, the ID is generated by adding one
to the current highest ID.
Range 1 through 32767
Rules
The jndi attribute is not applicable for the NSJMS C++ API environment.
When queue or topic is specified, name is required.
When jndi is specified, name is invalid.
The expiry attribute value is used when no timetolive value is specified during
a send-message operation.
Examples
To add a new queue (named sales-queue) and set messages to expire 10
minutes after they are received:
nsjms->add queue sales-queue, expiry 600000
To add NSJMS connection factories to the JNDI space:
nsjms->add jndi
ALTER Command
The ALTER command alters the parameter of a queue or topic in the database.
name
is the name associated with an existing queue or topic whose parameters are to be
altered.
EXPIRY millisecs
specifies the time (in milliseconds) after a message is sent until the message
expires. If the EXPIRY attribute value is set to zero, a message never expires. The
expiry attribute value is used when no timetolive value is specified during a
send message operation.
Default 0
Units milliseconds
Range 0 through 9223372036854775807
Rules
When queue or topic is specified, name and expiry millisecs are required.
The expiry attribute value is used when no timetolive value is specified during
a send message operation.
Example
To alter a queue (named sales-queue) to have messages expire 10 minutes after
they are received:
nsjms->alter queue sales-queue, expiry 600000
DELETE Command
The DELETE command removes a queue, topic, message, or subscription from the
database, or NSJMS connection factories from the JNDI space.
TOPIC { name | * } |
expired | * } |
* } |
JNDI }
name
is the name associated with an existing queue or topic to be deleted from the
database. In addition, all messages and subscriptions associated with the queue or
topic are deleted.
*
is a wild-card character that deletes all queues, topics, messages, or subscriptions
from the database. If QUEUE or TOPIC is specified, all queues or topics and any
associated subscriptions or messages are deleted. If MESSAGE is specified, all
messages are deleted. If SUBSCRIPTION is specified, all subscriptions are
deleted.
id
is the unique ID that identifies a specific message to be deleted from the database.
queue-name
is the name of the queue from which all messages will be deleted. The queue itself
is not deleted from the database.
topic-name
is the name of the topic from which all messages will be deleted. The topic itself is
not deleted from the database.
expired
specifies that all messages that have an expiration date prior to the current date
are deleted from the database.
client-id
is the unique ID associated with an existing subscription to be deleted from the
database.
subscription-name
is the name associated with an existing subscription to be deleted from the
database.
Rules
The jndi attribute is not applicable for the NSJMS C++ API environment.
When an asterisk (*) is specified in the delete command, a confirmation message
appears before the command is run.
When deleting a queue or topic, a name or an asterisk (*) must be explicitly
specified.
When queue or topic is specified, the id attribute is invalid.
If queue-name or topic-name is specified, all messages and subscriptions
associated with the specified queue or topic are deleted.
Examples
To delete a topic named sales-topic:
nsjms->delete topic sales-topic
To delete all expired messages:
nsjms->delete message expired
To delete a message that has the message ID quotes_994790988290:
nsjms->delete message quotes_994790988290
To delete all messages:
nsjms->delete message *
To delete a subscription with a client ID of $xyz1 and a subscription name of
subxyz1:
nsjms->delete subscription $xyz1, subxyz1
To delete NSJMS connection factories from the JNDI space:
nsjms->delete jndi
EXIT Command
The EXIT command exits from the current administrative session.
EXIT
Example
To exit from the current administrative session:
nsjms->exit
HELP Command
The HELP command displays the syntax and meaning of administrative utility
commands invoked through a command-line interface.
HELP [ command ]
command
is one of these administrative utility commands for which help is desired:
ADD HELP
ALTER INFO
DELETE STATS
EXIT
Rules
If the HELP command is run without specifying command, available administrative
commands appear.
When command is specified, only information about command appears.
Examples
To display the syntax and use of every command:
nsjms->help
To display the syntax and use of the ADD command:
nsjms->help add
INFO Command
The INFO command provides information about a specified queue, topic, message, or
subscription.
TOPIC { name | * } |
expired |* } |
name
is the name associated with an existing queue or topic about which information is
requested.
*
is a wild-card character that causes information for all specified objects (QUEUE,
TOPIC, MESSAGE, or SUBSCRIPTION) to appear.
id
is the unique ID that identifies a specific message about which information is
requested.
queue-name
is the name of the queue containing the messages about which information is
requested.
topic-name
is the name of the topic containing the messages about which information is
requested.
expired
specifies that information will be returned from the database about all messages
with an expiration date prior to the current date.
client-id
is the unique ID associated with an existing subscription about which information is
requested.
subscription-name
is the name associated with an existing subscription about which information is
requested.
Rules
If a name is specified, information about the named queue or topic appears.
If queue-name or topic-name is specified, information about all messages in the
specified queue or topic appears.
When requesting information about a queue or topic, a name or an asterisk (*)
must be explicitly specified.
When queue or topic is specified, the id attribute is invalid.
When subscription is specified, if client-id and subscription-name are
specified, information about the subscription whose client ID and subscription
name match client-id and subscription-name appears. client-id and
subscription-name are valid only when used with each other.
Examples
The INFO QUEUE command returns a display such as:
Destination Name
identifies the name of the queue or topic about which information is requested.
Destination ID
identifies the location of the queue or topic in the NSJMS database.
Destination Expiry
identifies the time (in milliseconds) after a message is sent until the message
expires. The expiry attribute value is used when no timetolive value is specified
during a send message operation.
Destination Name
identifies the name of the queue or topic about which information is requested.
Destination ID
identifies the location of the queue or topic in the NSJMS database.
Destination Expiry
identifies the time (in milliseconds) after a message is sent until the message
expires. The expiry attribute value is used when no timetolive value is specified
during a send message operation.
#1
JMSMessageID: salesqueue_994790988290
JMSDestination: salesqueue
JMSDeliveryMode: 1-(Non-Persistent)
JMSTimestamp: 994790988290 (Tue Jul 10 11:49:48 PDT 2001)
JMSExpiration: 1625942988227 (NO EXPIRATION)
JMSRedelivered: false
JMSPriority: 1
JMSReplyTo: null
JMSCorrelationID: null
JMSType: TextMessage
Properties: No Properties Found
Message body: Request an estimate on S74000 processor.
1 message(s) found
The JMS header fields returned by the INFO MESSAGE command are:
JMSMessageID
identifies a specific message.
JMSDestination
identifies the queue or topic name for the specified message.
JMSDeliveryMode
identifies the JMS delivery mode. A value of 2 indicates a persistent delivery mode;
a value of 1 indicates a nonpersistent delivery mode.
JMSTimestamp
identifies when the specified message was sent in milliseconds. It is set
automatically by the message producer.
JMSExpiration
identifies when the specified message expires.
JMSRedelivered
identifies if the specified message was redelivered to the consumer. A value of
true indicates the specified message was redelivered; a value of false indicates
the specified message was not redelivered.
JMSPriority
identifies the specified message’s priority. A message can fall within two categories
of message priorities: Values of 0 through 4 are gradations of normal priority;
values of 5 through 9 are gradations of expedited priority.
JMSReplyTo
identifies a destination to which a reply to the specified message is sent. The
destination is supplied by the JMS client when the specified message is sent. A
value of null indicates the destination for replying to the specified message was
not specified at the time the message was sent.
JMSCorrelationID
is not currently supported by NSJMS. A value of null is returned in this field.
JMSType
identifies the type of message. The message type identifier is supplied by the JMS
client when the specified message is sent.
Properties
identifies additional headers which provide a mechanism for adding optional
header fields to the specified message.
Message body
identifies the type of information contained in the body of the specified message.
NSJMS supports five forms for the body of a message: StreamMessage,
MapMessage, TextMessage, ObjectMessage, and BytesMessage. When the body
of a message is in the TextMessage form, the text of the message appears.
The INFO SUBSCRIPTION command returns a display such as:
Client ID
identifies the JMS client to which the durable subscription belongs.
Subscription Name
identifies the name of the specified subscription.
Destination ID
identifies the location of the subscription in the NSJMS database.
Nolocal
identifies the value of the nolocal attribute. A value of 1 indicates messages
published to the topic on the same connection will not be delivered to this
subscriber. A value of 0 indicates messages published to the topic on the same
connection will be delivered to this subscriber.
Message ID
identifies the last acknowledged message.
STATS Command
The STATS command provides statistical information about queues, topics, or the
NSJMS service.
NSJMS [ , RESET ] }
name
is the name associated with an existing queue or topic about which statistical
information is desired.
*
is a wild-card character that causes statistical information about all queues or
topics to appear.
RESET
if present, specifies that all applicable statistical counters are reset to their initial
values after the command has run.
Rules
The STATS command is not applicable for the NSJMS C++ API environment.
The nsjms property [Link] in the [Link] file must be set to
true for statistical information to be returned
When requesting information about a queue or topic, a name or an asterisk (*)
must be explicitly specified.
If a name is specified, statistics for the named queue or topic appear.
Examples
The STATS QUEUE command returns a display such as:
Destination: orders
Destination: sales
Process ID: $xyz2
Stats Interval(min): 10
Msgs Sent: 390
Msgs Sent Rate(msg/sec): 0.65
Msgs Sent Mean(bytes): 4000
Msgs Recv: 360
Msgs Recv Rate(msg/sec): 0.60
Msgs Recv Mean(bytes): 2000
Largest Msg Sent(bytes): 1090
Largest Msg Recv(bytes): 6000
Summary Information:
Total Destinations: 1
Total Process Ids: 5
Total Msgs Sent: 3400
Total Msgs Recv: 2440
Destination: orders
Destination: sales
Destination: purchases
Summary Information:
Total Destinations: 3
Total Process Ids: 5
Total Msgs Sent: 3475
Total Msgs Recv: 2784
Destination
identifies a destination to which the statistics are being reported.
Process ID
identifies a process within this destination.
Msgs Sent
identifies the number of messages sent by this process.
Msgs Recv
identifies the number of messages received by this process.
Total Destinations
identifies the total number of destinations for which statistical information was
received.
This is an example of the previous sample request for information when you invoke the
administrative utility as a servlet through your web browser.
[Link]
This is an example of the previous sample reply returned through your web browser:
[Link]
SQLCI Examples
These examples show how SQLCI can be used to query and manage an NSJMS
database. In each example, $[Link] represents the volume and subvolume
where the NSJMS SQL tables were created.
To delete all messages which have expired, use these commands:
To display a list of destination names and message counts, use these commands:
To display a list of destination names and message counts for those destinations
that have more than 1000 messages, use these commands:
SQL/MX Messages
SQL/MX reports exception condition messages during the running of an NSJMS
TopicSubscriber or an NSJMS QueueReceiver. Exception conditions are returned to
the JMS client as a [Link] that is linked with a nested
[Link]. The fields returned in the SQLException area are
SQLCODE, SQLSTATE, CONDITION_NUMBER and MESSAGE_TEXT.
The SQLCODE field returns a value that describes error information after running an
embedded SQL statement:
Value Description
<0 An error occurred.
> 0 (<> 100) A warning occurred.
100 No data was found.
0 The statement completed successfully.
The SQLSTATE field returns a five-character variable string that has two parts. The first
part is a two-character class code, and the second part is a three-character subclass
code. An SQLSTATE value of 00000 indicates completion. For a listing of the class and
subclass values, see the SQL/MX Programming Manual for C and COBOL .
The CONDITION_NUMBER field returns the number of an exception condition.
The MESSAGE_TEXT field returns the SQL message number and the message text.
For example, this error message might be displayed if an exception occurs while
preparing an embedded SQL statement:
SQLCODE: -4081
SQLSTATE: 42000
condition number: 1
message text: *** ERROR[4081] SQL/MP error:
*** ERROR from SQL [-4004]: Object \KONA.$[Link] is not an SQL table
or view.
SQLCODE: -4082
SQLSTATE: 42000
condition number: 2
message text: *** ERROR[4082] Table \KONA.$[Link] does not exist or
is inaccessible.
SQLCODE: -8822
SQLSTATE: X0X08
condition number: 3
message text: *** ERROR[8822] Unable to prepare the statement.
at [Link](JmsMessage
[Link], Compiled Code)
at [Link]([Link],
Compiled Code)
at [Link]([Link], Compiled
Code)
For information about SQL messages, see the SQL/MX Messages Manual.
Cause. An attempt was made to add a queue or topic name that already exists.
Effect. The queue or topic name was not added.
Recovery. Reenter the command, specifying a queue or topic name that does not
already exist.
Expiry is required
NSJMS Err: Expiry millisecs is required
Cause. The attributes specified for the command are invalid. Valid command attributes
are displayed by attribute_list.
Effect. The command is not run.
Recovery. Reenter the command, using valid attributes.
Invalid Syntax
NSJMS Err: Invalid Syntax
Cause. The syntax for this command is invalid. A comma was expected where
command text was found.
Effect. The command is not run.
Recovery. Check the command syntax and reenter the command.
Cause. A security violation occurred when running the DELETE JNDI command.
Effect. The command is not run.
Recovery. Verify the user of the administrative utility has the appropriate permissions
to perform this operation.
Keyword Expected
NSJMS Err: Keyword Reset Expected
Missing Attribute
NSJMS Err: Invalid syntax - missing attribute
Cause. An attempt was made to display information about a message from a queue,
topic, message, or subscription that does not exist.
Effect. The message was not displayed.
Recovery. Reenter the command, specifying a queue, topic, message, or subscription
that contains messages.
SQL Error
NSJMS Err: SQL error connecting to database
Unknown Option
NSJMS Err: Unknown option: command
No Destination(s) Found
NSJMS Warn: No Destination(s) found
Cause. No destinations (queue or topic) were found that meet the specified criteria.
Effect. No information is returned for the specified command.
Recovery. This is an informational message. No action is required.
No Message(s) Found
NSJMS Warn: No message(s) found
Cause. No NSJMS messages were found that meet the specified criteria.
Effect. No information is returned for the specified command.
Recovery. This is an informational message. No action is required.
No Statistics Found
NSJMS Warn: No statistics found
No Subscription(s) Found
NSJMS Warn: No subscription(s) found
application program. One of the following: A software program written for or by a user for a
specific purpose. A computer program that performs a data processing function rather
than a control function.
application program interface (API). A set of functions or procedures that are called by an
application program to communicate with other software components.
class path. The location where the JVM and other Java programs that are located in the
/usr/tandem/java/bin directory search for class libraries (such as [Link]). You can
set the class path explicitly or with the CLASSPATH environment variable.
client. A software process, hardware device, or combination of the two that requests
services from a server. Often, the client is a process residing on a programmable
workstation and is the part of a program that provides the user interface. The
workstation client might also perform other portions of the program logic.
Disk Process 2 (DP2). The portion of the operating system software that performs read,
write, and lock operations on disk volumes. The disk process also implements
Enscribe and NonStop SQL/MP file types; creates TMF audit trail records; performs
logical REDO operations for Remote Duplicate Database Facility (RDF); and manages
disk space, disk controllers, and paths to the disks. This disk process provides
enhanced performance, throughput, recoverability, and reliability improvements in high-
volume, online transaction processing situations.
Document Type Definition (DTD). A specification of valid syntax for a class of XML
documents. A DTD specifies required elements and attributes, and permissible and
default values of attributes.
element. The basic unit of information in an XML document. An element has a name and
can have content and attributes.
exception. An event during program execution that prevents the program from continuing
normally; generally, an error. Java methods raise exceptions using the throw keyword
and handle exceptions using try, catch, and finally blocks.
HP Tandem Advanced Command Language (TACL). The user interface to the operating
system. The TACL product is both a command interpreter and a command language.
Users can write TACL programs that perform complex tasks or provide a consistent
user interface across independently programmed applications.
Hypertext Transfer Protocol (HTTP). The client-server TCP/IP protocol used on the World-
Wide Web for the exchange of HTML documents.
iTP Secure WebServer. The HP web server with which NonStop Server for Java integrates
using servlets.
jar. The Java Archive tool, which combines multiple files into a single Java Archive (JAR)
file. Also, the command to run the Java Archive Tool.
JAR file. A Java Archive file, produced by the Java Archive Tool, jar. The Java standard for
access to relational databases such as SQL/MP.
Java Message Service (JMS). A Java API that enables client applications to create, send,
receive, and read messages. See also NonStop Server for Java Message Service
(NSJMS).
Java Naming and Directory Interface (JNDI). A standard extension to the Java platform,
which provides Java technology-enabled application programs with a unified interface
to multiple naming and directory services.
Java Native Interface (JNI). The C-language interface used by C functions called by Java
classes. Includes an Invocation API that invokes a JVM from a C program.
Java Transaction API (JTA). The Sun Microsystems product that specifies standard Java
interfaces between a transaction manager and the parties involved in a distributed
transaction system: the resource manager, the application server, and the transactional
applications. For more information, see the Sun Microsystems JTA document
([Link]
Java Virtual Machine (JVM). The process that loads, links, verifies, and interprets Java
bytecode. The NonStop Server for Java Server for Java JVM has been extended with
a JIT Compiler.
JMS provider. A messaging system that implements the JMS API and includes
administrative and management functionality (See NonStop Server for Java Message
Service (NSJMS)).
jre. The Java run-time environment, which interprets (runs) Java bytecode. Also, the
command to run the Java run-time environment.
message. A request, report, or event that is created, sent, and received by JMS clients.
NonStop Server for Java Message Service (NSJMS). The JMS provider that provides an
implementation of the JMS API on a NonStop system. See also JMS provider.
NonStop Server for Java Message Service (NSJMS) C++ API. A JMS provider that
implements a subset of the functionality provided by the Sun JMS API, and is used by
C++ client applications running on a NonStop system to interoperate with other JMS
clients. See also JMS provider.
NSJMS C++ API. See NonStop Server for Java Message Service (NSJMS) C++ API.
namespace. A context for resolving names, used to prevent ambiguity (or “collisions”)
where a name can have different meanings in different situations. To qualify a name by
identifying the namespace expresses the idea that the name is used as defined in that
namespace.
scalability. The ability to increase the size and processing power of an online transaction
processing system by adding processors and devices to a system, systems to a
network, and so on, and to do so easily and transparently without bringing systems
down. Sometimes called expandability.
servlet. A server-side Java program that any World-Wide Web browser can access. It
inherits scalability and persistence from the Pathway CGI server that manages it.
The Java class named servlets runs in server environments such as World-Wide Web
servers. The Servlet API is defined in a draft standard by Sun Microsystems.
shell. The command interpreter used to pass commands to an operating system; the part of
the operating system that is an interface to the outside world.
throws. Java keyword used to define the exceptions that a method can raise.
TNS/E. Denotes fault-tolerant HP computers that support the operating system and that are
based on the Intel Itanium processor-based architecture. TNS/E systems run the
Itanium instruction set and can run TNS object files by interpretation or after
acceleration. TNS/E systems include all HP systems that use NSAL-x processors.
Contrast with TNS and TNS/R.
XML. Extensible Markup Language, a standard for tagging data in an HTML document so
as to provide semantic information about content elements.