NonStop JMS C++ API Programmer's Guide
NSJMS C++ API Sample Client Applications
NonStop Server for Java Message Service C++ API Programmer’s Guide—526459-002
6-8
Pub/Sub Sample Applications
Pub/Sub Sample Applications
A Pub/Sub messaging application is a one-to-many messaging model that 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 can receive the message. A
topic retains a message until the message expires.
You can use the SimplePublisher.cpp on page 6-8 and SimpleConsumer.cpp on
page 6-11 client applications to demonstrate basic Pub/Sub sending and receiving of
messages using the NSJMS C++ API.
SimplePublisher.cpp
This SimplePublisher.cpp sample client application creates a Session and a
Producer, and begins to publish messages. The application expects a Topic Name to
be specified on the command line. If a Topic Name is not specified, an exception is
raised.