NonStop JMS C++ API Programmer's Guide

NonStop Server for Java Message Service C++ API Programmer’s Guide526459-002
6-1
6
NSJMS C++ API Sample Client
Applications
This section contains NSJMS C++ API sample client applications along with brief
descriptions of the Point-to-Point (PTP) and Publish/Subscribe (Pub/Sub) messaging
models.
Source code files for the sample client applications described in this section are
provided as part of the NSJMS C++ API software package. They reside (by default) in
the /usr/tandem/nsjms/T2811-version/examples directory. Note that the
sample client applications are subject to change in future release version updates
(RVUs).
PTP Sample Applications
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.
You can use the SimpleSender.cpp and SimpleReceiver.cpp on page 6-4 sample client
applications to demonstrate basic PTP sending and receiving of messages using the
NSJMS C++ API.
SimpleSender.cpp
This SimpleSender.cpp sample client application creates a Session and a Producer,
and begins to publish messages. The application expects a Queue Name and a
Message Count as arguments. If a Queue Name and a Message Count are not
specified, an exception is raised.
Note. For details about how to compile and bind programs written in the HP C++ programming
language, see Building NSJMS C++ API Client Applications
on page 5-12 or the C/C++
Programmer’s Guide.