Contents


This chapter describes usage of C++ Runtime for connecting to FioranoMQ Server. The various sample programs illustrates the use of simple Point-To-Point and Publish-Subscribe operations.
PTP
This directory contains samples which demonstrate the following functionality over PTP using C++ Runtime.

  • Admin
  • Basic Send Receive
  • Browser
  • HTTP
  • Message Selector
  • Multi-thread PTP
  • RequestReply
  • Basic
  • TimedRequestReply
  • SSL
  • Transaction
  • cspBrowser
  • lms
  • nonJndi
  • revalidateConnections
  • serverlessMode
  • DeadMessageQueue
  • Message Compression - PerDestination
  • Message Compression - PerMessage

PubSub
This directory contains samples which demonstrate the following functionality over PubSub using C++ Runtime.

  • Admin
  • Basic Pub Sub
  • Durable Subscriber
  • HTTP
  • Message Selector
  • Multi-thread PubSub
  • RequestReply
  • Basic
  • TimedRequestReply
  • SSL
  • Transaction
  • cspBrowser
  • lms
  • nonJndi
  • revalidateConnections
  • serverlessMode
  • DeadMessageQueue
  • Message Compression - PerDestination
  • Message Compression - PerMessage

Unified
This directory contains samples which demonstrate the following functionality over Unified APIs using C++ Runtime.

  • NonJndi
  • Sendreceive

These samples are available in %FMQ_DIR%\clients\cpp\native\samples directory. The %FMQ_DIR%\clients\cpp\native\script directory contains a script called build_samples.bat (.sh for UNIX platform) which compiles the C++ programs.

Platforms Supported

Currently C++ libraries are supported on the following OS platforms: Windows, Linux (32 and 64 bit), Solaris x86, Solaris Sparc, and HP-UX.

Building and Running C++ Applications

FioranoMQ C++ library package comes with a comprehensive list of sample applications covering important features of PTP and PubSub messaging domains. The Non-java client library packages should be downloaded along with the FioranoMQ installer and extracted to the 'fmq' directory of Fiorano_Home.
For getting started with a basic send/receive sample, while compiling please ensure to link the required libraries and header files as mentioned in the script files under the scripts directory (located at $FMQ_DIR/clients/cpp/native/scripts for compiling C++ samples). In order to compile all the samples at one shot, please use the build_samples.bat(.sh for unix platform) or use the cppclientbuild.bat(.sh) for compiling a particular sample.
Both static and dynamic libraries are provided for all supported platforms. To run any C++ samples, set the LD_LIBRARY_PATH environment variable in ~/.bashrc profile to both C and C++ library directories for UNIX platforms,
Example: LD_LIBRARY_PATH = $FMQ_DIR/clients/c/native/lib:$FMQ_DIR/clients/cpp/native/lib
For Windows platform, set the PATH environment variable to the location of c/native/lib and cpp/native/lib folders.
Example: PATH=%FMQ_DIR%\clients\c\native\lib;%FMQ_DIR%\clients\cpp\native\lib
Note: For Message Compression support in Windows zlibwapi.lib/.dll provides dynamic linking with fmq cpprtl. In Linux & Solaris platforms, the same is provided by libz.a static library and libz.so shared object.The above libraries are present in the %FMQ_DIR%\clients\c\native\lib directory.

PTP Samples

Admin

This directory contains one sample program which illustrates basic JMS Administration API functionality using the FioranoMQ C++ Runtime Library.

  • AdminTest.cpp - Creates an Admin Connection with the MQServer and gets an MQAdminService object to create and delete Queues and QueueConnectionFacotries and retrieves information of users connected from the server.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the AdminTest by executing the AdminTest.exe executable file.

Basic

This directory contains two sample programs which illustrate JMS Send-Receive mechanism using the FMQ C++ Runtime Library.

  • Sender.cpp - Reads strings from standard input and sends the text messages on the queue "PrimaryQueue".
  • Receiver.cpp - Implements a synchronous blocking receiver, which listens on the queue "PrimaryQueue", and prints the text of the received text messages on the console.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Sender by executing the Sender.exe executable file.
  3. Run the receiver by executing the Receiver.exe file.

Browser

This directory contains two sample programs which illustrate basic JMS Browser functionality using the FioranoMQ C++ Runtime Library.

  • QSender.cpp - Reads strings from standard input and sends them on the queue "PrimaryQueue".
  • Browser.cpp - Implements a browser, which is used to browse the messages on the queue "PrimaryQueue", and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. For convenience, compiled versions of the sources are included in this directory. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Sender by executing the QSender.exe executable file. Send some messages before running the browser application
  3. Run the browser by executing the Browser.exe file.

Csp Browser

This directory contains two sample programs which illustrate basic JMS CspBrowser functionality using the FioranoMQ CPP Runtime Library.

  1. Sender.cpp

Reads strings from standard input and sends them on the queue "PrimaryQueue".

  1. Browser.cpp

Implements a browser, which is used to browse the messages on the cspcache, and prints out the received messages.
To run these samples using FioranoMQ, perform the following steps:

    1. Compile each of the source files.

The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cclientbuild.bat which compiles the CPP program.

    1. Run the Sender by executing the Sender.exe executable file. Send some messages before running the browser application.
    2. Run the asynchronous receiver by executing the Browser.exe file.

DeadMessageQueue

This directory contains three sample programs which illustrate functionality of Dead Message Queue using the FioranoMQ C Runtime Library.
Note: Before running the given sample, enable the following configuration through WMT:

  1. To use WMT, open a web browser and type http://localhost:1780
  2. Go to JMX > ConfigureFMQServer -> fiorano>mq->ptp->queuingSubSystem->EnableDMQOnAllQueues to true
  3. Sender.cpp - Reads strings from standard input and sends them on the queue "PrimaryQueue".Some messages expire after the TTL and are sent to "SYSTEM_DEADMESSAGES_QUEUE".
  4. Receiver.cpp - Implements an asynchronous listener, which listens on the queue "PrimaryQueue", and prints out the received messages.
  5. ReceiverDMQ.cpp - Implements an asynchronous listener, which listens on the queue "SYSTEM_DEADMESSAGES_QUEUE", and prints out the received messages and the actual destination of the messages.

To run this sample using FioranoMQ, perform the following steps:

  1. Compile the source file. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Sender by executing the Sender.exe executable file.
  3. Run the Receiver by executing the Receiver.exe executable file.
  4. Run the ReceiverDMQ by executing the ReceiverDMQ.exe executable file.

HTTP

This directory contains two sample programs which illustrate the use of HTTP protocol for basic JMS PTP functionality using the FioranoMQ C++ Runtime Library.

  • QReceiver.cpp - Receives messages asynchronously on primaryQueue. This program implements a synchronous listener to listen for messages published on the queue "PrimaryQueue".
  • QSender.cpp - Implements a client application publishing user specified data on primaryQueue. This program reads strings from standard input and publishes them on the Queue "PrimaryQueue".

To run this sample using FioranoMQ, perform the following steps:

  1. Compile the source file. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the HttpReceiver by executing the QReceiver.exe executable file.
  3. Run the HttpSender by executing the QSender.exe executable file.

LMS

This directory contains sample programs which illustrate the use of Large Message Support - LMS for basic JMS ptp functionality using the FioranoMQ CPP Runtime Library.

  1. LmSender.cpp

Accept filename to be send from standard input and send them on queue, "PrimaryQueue".

  1. LmReceiver.cpp

Implements an asynchronous listener, which listens on the queue "PrimaryQueue", and create a received message file (default output fileName, "received.zip").
To run this sample using FioranoMQ, perform the following steps:

  1. Compile the source file.

The %FMQ_DIR%\clients\CPP\native\scripts directory contains a script called cclientbuild.bat which compiles the CPP program.

  1. Run the LmReceiver by executing the LmReceiver.exe executable file.
  2. Run the LmSender by executing the LmSender.exe executable file.

Message Compression

This directory contains two folders PerDestination and PerMessage

PerDestination

This directory contains three sample programs which illustrate the message compress/uncompress abstraction supplied by the JMS API using a C++ Sender application and Receiver application.

  1. Sender.cpp - Sends a file as a compressed message to the server on the "CompressedQueue".
  2. Receiver.cpp - Implements an asynchronous listener, which listens on the queue CompressedQueue". Receives the message sent by the sender in the uncompressed original form and writes the data in the message to a file.
  3. CreateQueue.cpp - Creates a queue called "CompressedQueue" that has compression enabled on it which means that all messages sent on this queue will be compressed by default.

To run this sample using FioranoMQ, perform the following steps:

  1. Compile the source file. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the CreateQueue by executing the CreateQueue.exe executable file.
  3. Run the Sender by executing the Sender.exe executable file.
  4. Run the Receiver by executing the Receiver.exe executable file.

PerMessage

This directory contains two sample programs which illustrate the message compress/uncompress abstraction supplied by the JMS API using a C++ Sender application and Receiver application

  1. Sender.cpp - Sends a file as a compressed message to the server on the "PrimaryQueue". Compression is enabled for every message and the default compression level and strategy are used.
  2. Receiver.cpp - Implements an asynchronous listener, which listens on the queue "PrimaryQueue". Receives the message sent by the sender in the uncompressed original form and writes the data in the message to a file.

To run this sample using FioranoMQ, perform the following steps:

  1. Compile the source file. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Sender by executing the Sender.exe executable file.
  3. Run the Receiver by executing the Receiver.exe executable file.

MsgSel

This directory contains two sample programs which illustrate the use of message selectors using the FioranoMQ C++ Runtime Library.

  • QSelSender.cpp - Selector sends messages with the string property "name" and an int property "value", set differently for 3 consecutive messages.
  • SelReceive.cpp - Implements a synchronous listener, which listens on the queue "primaryqueue" for the messages which match the criteria specified in the message selector, and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Sender by executing the QSelSender.exe executable file.
  3. Run the synchronous receiver by executing the QSelReceive.exe file.

Mtptp

This directory contains one sample programs which illustrate basic JMS Sender/Receiver functionality using the FioranoMQ C++ Runtime Library multithreading support.

  • mtPtp.cpp - The multithreaded version of basic PTP. Single Sender is created, sends 10 text messages on PrimaryQueueand a single receiver blocking receive with timewait of 1 second reads the messages. Each executes on a separate thread. On receipt of 10 messages, the receiver notifies the main thread to end. Sender and Receiver threads are joined to the main thread.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the mtPtp by executing the mtPtp.exe executable file.

NonJndi

This directory contains samples to create Queue connection Factory and Queue without using JNDI:

  1. Sender.cpp

Implements a client application publishing user specified data on "SampleQueue" created without using JNDI in persistent mode. It reads strings from standard input and publishes them on the queue, "SampleQueue"

  1. Receiver.cpp

Implements an asynchronous listener, which listens on the queue "SampleQueue", and prints out the received messages.
To run these samples using FioranoMQ, perform the following steps:

    1. Compile each of the source files.

The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.

    1. Run the Sender by executing the Sender.exe executable file.
    2. Run the asynchronous receiver by executing the Receiver.exe file.

Reqrep

This directory contains two folders Basic and timeout

Basic

This directory contains two samples which illustrate JMS Request-Reply mechanism over Queues.

  • QueueRequestor.cpp - Reads strings from standard input and sends the text messages on the queue "PrimaryQueue".
  • QueueReplier.cpp - Implements an asynchronous listener, which listens on the queue "PrimaryQueue", and replies to the received message. The reply is sent on TemporaryQueue.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Replier by executing the QueueReplier.exe executable file.
  3. Run the requestor by executing the QueueRequestor.exe file.

TimedOut

This directory contains two sample programs which illustrate Timed Request-Reply mechanism over Queues using the FioranoMQ C++ Runtime Library.

  • TimedQueueRequestor.cpp - Reads strings from standard input and sends the text messages on the queue "PrimaryQueue". The Requestor waits for a specified time for the reply. If the reply is not received within the stipulated time requestor times out.
  • TimedQueueReplier.cpp - Implements an asynchronous listener, which listens on the queue "PrimaryQueue", and replies on a TemporaryQueue.

To run these samples using FioranoMQ, perform the following:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the replier by executing the QueueReplier.exe executable file.
  3. Run the timed requestor by executing the TimedQueueRequestor.exe file.

RevalidateConnections

This directory contains two sample programs which illustrate connection revalidation functionality using the FioranoMQ CPP Runtime Library.

  1. Sender.cpp

Reads strings from standard input and use it to send a request message on the topic "PrimaryQueue". Also, revalidate the connection with the server.

  1. Receiver.cpp

Implements an asynchronous listener, which listens on the queue "PrimaryQueue", and prints out the received messages. Also, revalidate the connection with the server.
To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files.

The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.

  1. Run the Sender by executing the Sender.exe executable file.
  2. Run the Receiver by executing the Receiver.exe file.

ServerlessMode

This directory contains two sample programs which illustrate server less mode implementation of JMS Sender/Receiver functionality using the FioranoMQ C++ Runtime Library.

  1. Sender.cpp

Reads strings from standard input and sends them on the topic "PrimaryQueue".

  1. Receiver.cpp

Implements an asynchronous listener, which listens on the topic "PrimaryQueue", and prints out the received messages.
To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files.

The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.

  1. (b) Run the Sender by executing the Sender.exe executable file.
  2. (c) Run the asynchronous Receiver by executing the Receiver.exe file.

SSL

This directory contains two sample programs which illustrate the basic JMS Send/Receive functionality over Secure Socket Layer using the FioranoMQ C++ Runtime Library.

  • Sender.cpp - Reads strings from standard input and sends them on the queue "PrimaryQueue".
  • Receiver.cpp - Implements a synchronous listener, which listens on the queue "PrimaryQueue", and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Sender by executing the Sender.exe executable file.
  3. Run the synchronous receiver by executing the Receiver.exe file.

Transaction

This directory contains a sample programs which illustrate JMS Transaction functionality using the FioranoMQ C++ Runtime Library.

  • QTransaction.cpp - Implements the sender and receiver, and uses the commit/rollback functionality to demonstrate JMS Transactions

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the sample by executing the QTransaction.exe executable file. For proper results from the sample, ensure that there are no messages in the primaryQueue.

PubSub Samples

Admin

This directory contains one sample program which illustrates basic JMS Administration API functionality using the FioranoMQ C++ Runtime Library.

  • AdminTest.cpp - Creates an Admin Connection with the MQServer and gets an MQAdminService object to create and delete Topics and TopicConnectionFacotries and retrieves information of users connected from the server.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the AdminTest by executing the AdminTest.exe executable file.

Basic

This directory contains two sample programs which illustrate basic JMS Publisher/Subscriber functionality using the FioranoMQ C++ Runtime Library.

  • Publisher.cpp - Reads strings from standard input and sends them on the topic "PrimaryTopic".
  • Subscriber.cpp - Implements a synchronous listener, which listens on the topic "PrimaryTopic", and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Publisher by executing the Publisher.exe executable file.
  3. Run the synchronous subscriber by executing the Subscriber.exe file.

CspBrowser

This directory contains two sample programs which illustrate basic JMS CspBrowser functionality using the FioranoMQ CPP Runtime Library.

  1. Publisher.cpp: Reads strings from standard input and sends them on the queue "PrimaryTopic".
  2. Browser.cpp: Implements a browser, which is used to browse the messages on the cspcache, and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cclientbuild.bat which compiles the CPP program.
  2. Run the Sender by executing the Publisher.exe executable file. Send some messages before running the browser application
  3. Run the asynchrounous receiver by executing the Browser.exe file.

Dursub

This directory contains two sample programs which illustrate basic JMS DurableSubscriber functionality using the FioranoMQ C++ Runtime Library.

  • DurPublisher.cpp - Reads strings from standard input and publishes PERSISTENT messages on the topic "PrimaryTopic".
  • DurSubscriber.cpp - Implements a durable subscriber using the client ID "DS_Client_1" and durable subscriber name "Sample_Durable_Subscriber", listening on the topic "PrimaryTopic".

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Start the DurableSubscriber program first, so that the subscriber can register with the FioranoMQ Server.
  3. Next, start the Publisher_d program. When the program comes up, type in a few strings, pressing the Enter key after each string. The string is published and is received by the Durable Subscriber started in step (2) above.
  4. Now, shut down the Durable Subscriber, but keep typing in messages into the Publisher program. These messages are automatically stored by the FioranoMQ Server, since a Durable Subscriber was previously registered on the topic to which the messages are being published.
  5. After a while, restart the DurableSubscriber program. On restart, you would find that all messages that were published during the time that the durable subscriber was down are now made available to the subscriber.
  6. Repeat steps (4) and (5) over. Each time, you would find that all messages published during the time that the Subscriber is down are immediately made available to the Subscriber when it restarts.

HierarchicalTopics

This directory contains two sample programs which illustrate basic JMS Publisher/Subscriber functionality using the FioranoMQ CPP Runtime Library.

  1. Publisher.cpp: Reads strings from standard input and sends them on the hierarchical topics.
  2. Subscriber.cpp: Receives messages from hierarchical topics.
  3. createHierarchicalTopics.cpp: Creates required hierarchical topics that are used in Publisher and Subscriber.

To run these samples using FioranoMQ, perform the following steps:
Compile each of the source files.

  1. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the CPP program.
  2. Run createHierarchicalTopics that creates topics
  3. Run the Publisher by executing the Publisher.exe executable file.
  4. Run the asynchrounous subscriber by executing the Subscriber.exe file.

HTTP

This directory contains four sample programs which illustrate the use of HTTP protocol for basic JMS PubSub functionality using the FioranoMQ C++ Runtime Library.

  • Subscriber.cpp - Receives messages synchronously published on "PrimaryTopic". This program implements an synchronous listener to listen for messages published on "PrimaryTopic".
  • Publisher.cpp - Implements a client application publishing user specified data on "PrimaryTopic". This program reads strings from standard input and publishes them on "PrimaryTopic".

To run this sample using FioranoMQ, perform the following steps:

  1. Compile the source file. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the HttpSubscriber by executing the Subscriber.exe executable file.
  3. Run the HttpPublisher by executing the Publisher.exe executable file.

LMS

This directory contains sample programs which illustrate the use of Large Message Support - LMS for basic JMS ptp functionality using the FioranoMQ CPP Runtime Library.

  1. LmPublisher.cpp: Accept filename to be send from standard input and send them on queue, "PrimaryTopic".
  2. LmSubcriber.cpp: Implements an asynchronous listener, which listens on the queue "PrimaryTopic", and creates a received message file (default output fileName, "received.zip").

To run this sample using FioranoMQ, perform the following steps:

  1. Compile the source file. The %FMQ_DIR%\clients\CPP\native\scripts directory contains a script called cclientbuild.bat which compiles the CPP program.
  2. Run the Receiver by executing the LmSubscriber.exe executable file.
  3. Run the Sender by executing the LmPublisher.exe executable file.

Message Compression

This directory contains two folders PerDestination and PerMessage.

PerDestination

This directory contains three sample programs which illustrate the message compress/uncompress abstraction supplied by the JMS API using a C++ Publisher application and Subscriber application.

  1. TPublisher.cpp - Sends a file as a compressed message to the server on the "CompressedTopic".
  2. TSubscriber.cpp - Implements an asynchronous listener, which listens on the topic "CompressedTopic". Receives the message sent by the producer in the uncompressed original form and writes the data in the message to a file.
  3. CreateTopic.cpp - Creates a topic called "CompressedTopic" that has compression enabled on it which means that all messages sent on this topic will be compressed by default.

To run this sample using FioranoMQ, perform the following steps:

  1. Compile the source file. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the CreateTopic by executing the CreateTopic.exe executable file.
  3. Run the TPublisher by executing the TPublisher.exe executable file.
  4. Run the TSubscriber by executing the TSubscriber.exe executable file.

 

PerMessage

This directory contains two sample programs which illustrate the message compress/uncompress abstraction supplied by the JMS API using a C++ Publisher application and Subscriber application

  1. TPublisher.cpp - Sends a file as a compressed message to the server on the "PrimaryTopic". Compression is enabled for every message and the default compression level and strategy are used.
  2. TSubscriber.cpp - Implements an asynchronous listener, which listens on the topic "PrimaryTopic". Receives the message sent in the uncompressed original form and writes the data in the message to a file.

To run this sample using FioranoMQ, perform the following steps:

  1. Compile the source file. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the TPublisher by executing the TPublisher.exe executable file.
  3. Run the TSubscriber by executing the TSubscriber.exe executable file.

 

Msgsel

This directory contains two sample programs which illustrate the use of message selectors using the FioranoMQ C++ Runtime Library.

  • SelSend.cpp - Selector sends messages with the string property "name" and an int property "value", set differently for 3 consecutive messages.
  • SelRecv.cpp - Implements a synchronous listener, which listens on the topic "PrimaryTopic" for the messages which match the criteria specified in the message selector, and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Sender by executing the SelSend.exe executable file.
  3. Run the synchronous receiver by executing the SelRecv.exe file.

 

Mtpubsub

This directory contains one sample programs which illustrate basic JMS Publish/Subscribe functionality using the FioranoMQ C++ Runtime Library multithreading support.

  • mtPubSub.cpp - The multithreaded version of basic PubSub. Single Publisher is created, publishes 10 text messages on 'PrimaryTopic'and a single subscriber blocking receive with timewait of 1 second reads the messages. Each executes on a separate thread. On receipt of 10 messages, the subscriber notifies the main thread to end. Publisher and Subscriber threads are joined to the main thread.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the mtPubSub by executing the mtPubSub.exe executable file.

 

NonJndi

This directory contains samples to create Topic connection Factory and Topic without using JNDI:

  1. Publisher.cpp: Reads strings from standard input and publishes them on the topic "SampleTopic" created without using JNDI.
  2. Subscriber.cpp: Implements an asynchronous listener, which listens on the topic "SampleTopic", and prints out the received messages.

To run these samples using FioranoMQ, perform the following step:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Publisher by executing the Publisher.exe executable file.
  3. Run the asynchrounous subscriber by executing the Subscriber.exe file.

Reqrep

This directory contains two folders basic and timeout.

Basic

This directory contains two sample programs which illustrate JMS Request-Reply mechanism over Topics using the FioranoMQ C++ Runtime Library.

  • TopicRequestor.cpp - Reads strings from standard input and sends the text messages on the topic "PrimaryTopic".
  • TopicReplier.cpp - Implements an asynchronous listener, which listens on the topic "PrimaryTopic", and replies to the received. The reply is sent on TemporaryTopic.

To run these samples using FioranoMQ, perform the following:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Replier by executing the TopicReplier.exe executable file.
  3. Run the requestor by executing the TopicRequestor.exe executable file.

TimedOut

This directory contains two sample programs which illustrate Timed Request-Reply mechanism over Topics using the FioranoMQ C++ Runtime Library.

  • TimedTopicRequestor.cpp - Reads strings from standard input and sends the text messages on the topic "PrimaryTopic". The Requestor waits for a specified time for the reply. If the reply is not received within the stipulated time requestor times out.
  • TopicReplier.cpp - Implements an asynchronous listener, which listens on the topic "PrimaryTopic", and replies on a TemporaryTopic.

To run these samples using FioranoMQ, perform the following:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the replier by executing the TopicReplier.exe executable file.
  3. Run the timed requestor by executing the TimedTopicRequestor.exe file.

RevalidateConnections

This directory contains two sample programs which illustrate connection revalidation functionality using the FioranoMQ CPP Runtime Library.

  1. Publisher.cpp: Reads strings from standard input and use it to send a request message on the topic "PrimaryTopic". Also, revalidate the connection with the server.
  2. Subscriber.cpp: Implements an asynchronous listener, which listens on the queue "PrimaryTopic", and prints out the received messages. Also, revalidate the connection with the server.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Publisher by executing the Publisher.exe executable file.
  3. Run the Subscriber by executing the Subscriber.exe file.

ServerlessMode

This directory contains two sample programs which illustrate server less mode implementation of JMS Publisher/Subscriber functionality using the FioranoMQ C++ Runtime Library.

  1. Publisher.cpp: Reads strings from standard input and sends them on the topic "PrimaryTopic".
  2. Subscriber.cpp: Implements an asynchronous listener, which listens on the topic "PrimaryTopic", and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Publisher by executing the Publisher.exe executable file.
  3. Run the asynchrounous subscriber by executing the Subscriber.exe file.

SSL

This directory contains two sample programs which illustrate basic JMS Publisher/Subscriber functionality using the FioranoMQ C++ Runtime Library.

  • Publisher.cpp - Reads strings from standard input and sends them on the topic "PrimaryTopic".
  • Subscriber.cpp - Implements a synchronous listener, which listens on the topic "PrimaryTopic", and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the Publisher by executing the Publisher.exe executable file.
  3. Run the asynchronous subscriber by executing the Subscriber.exe file.

Transaction

This directory contains a sample programs which illustrate JMS Transaction functionality using the FioranoMQ C++ Runtime Library.

  • Transaction.cpp - Implements the sender and receiver, and uses the commit/rollback functionality to demonstrate JMS Transactions

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\cpp\native\scripts directory contains a script called cppclientbuild.bat which compiles the C++ program.
  2. Run the sample by executing the Transaction.exe executable file. For proper results from the sample, ensure that there are no messages in the primaryTopic

Unified Samples

NonJndi

This directory contains samples to create Unified connection Factory, Topic, and Queue without using JNDI:

  1. UnifiedProducer.cpp: Reads strings from standard input and sends them on to the queue "SampleQueue" and to the topic "SampleTopic".
  2. UnifiedConsumer.cpp: Implements an asynchronous listener, which listens on the queue "SampleQueue" and on the topic "SampleTopic" and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\c\native\scripts directory contains a script called cclientbuild.bat which compiles the C++ program.
  2. Run the Sender by executing the UnifiedProducer.exe executable file.
  3. Run the asynchronous receiver by executing the UnifiedConsumer.exe file.

SendReceive

This directory contains two sample programs which illustrate basic JMS Send/Receive functionality using the FioranoMQ C++ Runtime Library.

  1. UnifiedProducer.cpp: Reads strings from standard input and sends them on to the queue "PrimaryQueue" and to the topic "PrimaryTopic".
  2. UnifiedConsumer.cpp: Implements an asynchronous listener, which listens on the queue "PrimaryQueue" and on the topic "PrimaryTopic" and prints out the received messages.

To run these samples using FioranoMQ, perform the following steps:

  1. Compile each of the source files. The %FMQ_DIR%\clients\c\native\scripts directory contains a script called cclientbuild.bat which compiles the C++ program.
  2. Run the Sender by executing the UnifiedProducer.exe executable file.
  3. Run the asynchrounous receiver by executing the UnifiedConsumer.exe file.

 

Adaptavist ThemeBuilder EngineAtlassian Confluence