NonStop JMS C++ API Programmer's Guide
Introduction to the NSJMS C++ API
NonStop Server for Java Message Service C++ API Programmer’s Guide—526459-002
1-3
NSJMS C++ API Interoperability with NSJMS
Clients can send or receive messages from one product and then receive or send
messages using the other product.
All message types are supported along with access methods for JMS headers and
properties. ObjectMessages are supported, although the message body is returned
as a byte array instead of as a Java object.
MapMessage and StreamMessage object access methods are not provided. For
example, getObject(), readObject(), setObject(), and writeObject()
are not provided. The item must be retrieved using the correct type, or using
getString() and readString().
Message methods which return enumerations are not provided. For example,
getProperties() and getMapNames() are not provided.
JMS connections do not exist in the NSJMS C++ API. When creating a Session
object clients will specify the NSJMS properties file to be used. The Session object
is used to create the other interface objects (Messages, Consumers, and
Producers). The Producer and Consumer objects are used to send and receive
messages, respectively. Consumer receive calls allow a timeout value (which may
be zero for nowait). A message listener (upcall) interface is not provided.
Consumers are created to be destructive (for dequeue access) or non-destructive
(queue browsing or topic subscribing).
Transactions and acknowledge mode are not part of the NSJMS C++ API, but
externally defined transactions are supported. They must be established using an
external API, such as HP NonStop Transaction Management Facility (TMF) or HP
NonStop Tuxedo, which will establish a TMF transaction for the process.
Operations that require an active TMF transaction are the Producer::send()
and the Consumer::receive(). If a transaction is aborted, messages sent
under the aborted transaction are affected as:
Messages sent under a transaction that aborts are not sent.
Messages received with a destructive consumer, for example, queue access,
are not deleted and are received again if the transaction under which they were
received is aborted.
Messages received from a durable subscription are received again if the
transaction under which they were received is aborted.
Messages received with non-destructive, non-durable access are received
again if the transaction under which they were received is aborted.
Unlike NSJMS, the objects returned by the NSJMS C++ API must be explicitly
freed in order to release resources. The session object includes freeXXX()
methods which are used to free resources for Messages, Consumers, and
Producers. For example,