TIBCO RV Tutorial: How to Publish and Subscribe to RV Messages in TIBCO

By | March 10, 2014

In my previous post, I explained fundamentals of TIBCO RV and explained how RV works. In this step by step tutorial, I will explain how to publish reliable RV messages in TIBCO and then subscribe to Reliable RV messages.

In this tutorial, we will publish a reliable RV message on a subject using RV Publish activity and then we will subscribe the message in another process with RV subscriber activity and then write the received data to a text file.

Step 1: Create Reliable Rendezvous (RV) Transport:

Go to Add ResourceàRendezvousàRendezvous Transport  to create a new RV transport.  In the configuration of RV transport, specify RV Daemon, Network, and Service as shown in below screenshot:

configure reliable RV transport

In the advanced tab, choose Reliable as RV Type:

rv type reliable

 

Step 2: Create RV Publisher and RV Subscriber Processes:

In order to simulate Reliable RV publish subscribe, I created two processes. One process to publish Rendezvous message and other one to subscribe to Rendezvous message as shown below:

rv publish and rv subscribe processes

Step 3: Create XML Schema for message communication between RV Publisher and RV Subscriber:

Create a XSD (XML Schema) which will be used for RV message communication in this tutorial. I have created a simple XSD which sends only one parameter (name and designation). Schema is as given below:

rv message schema

Step 4: Configure Publish RV Message activity in Publisher Process:

Configure Publish Rendezvous Message activity by choosing the transport that we created in Step 1. Also specify the subject at which this activity will publish the message. In this example case, I have given the string “test.subject” in the subject field which means that any RV subscribers listening on this subject will get the message.

Below screenshot shows the configuration that I made for RV Publish activity:

publish reliable rv message configuration

In the input editor of Publish RV Message, select XML reference for the XSD schema that we created in Step 3 as shown in the screenshot below:

tibco publish rv input editor

Now we need to map inputs for our RV message that will be published through reliable RV. In this tutorial example case, I have given hard coded values for name and designation as shown below:

tibco publish rv input mapping

Step 4: Configure Rendezvous Subscriber Activity in Subscriber Process:

In the configuration tab of RV Subscriber activity in our subscriber process, choose the same RV transport as we used in our Publish Rendezvous Message activity in step 4. As we configured our RV publisher with the subject “test.subject”, we specify same subject in this subscriber so that it becomes a registered recipient of the messages published by that publisher.

Complete configuration of our RV Subscriber activity will be as shown in the below screenshot:

reliable  rv receiver configuration

In the Output Editor tab of RV subscriber activity, choose the same XSD as we chose for RV Publisher Input Editor Activity.

rv subscriber output editor

As you can see in below screenshot, Output tab of RV subscriber shows that once tested, it will give output data in the format specified in our XSD file, i.e. we will get name and designation in the output:

rv subscriber output

Next, we need to configure Write File activity which will be used to write the received data to a text file.  Configuration tab of Write File activity will be as shown below:

rv message write to file configuration

In the input tab of Write File activity, I have specified the file name “rv_message.txt” and also the xpath for the content to be written to file.

rv message write file input mapping

Xpath formula which concatenates name and designation with a line break is as below:

concat(“Name:”,$Rendezvous-Subscriber/ActivityOutput/body/pfx:Name,”&crlf;”,”Designation:”,$Rendezvous-Subscriber/ActivityOutput/body/pfx:Designation)

Step 5: Test RV Publish and RV Subscribe Processes in designer tester:

Now we have completed designing of both publisher and subscriber processes in TIBCO designer. After validating the project, we are good to go for testing it in designer tester. Load both processes in tester as shown below:

load rv publisher and rv subscriber processes in tibco designer tester

Now, click on the RV Publish Process and click on green colored Create a Job button in the tester. As you can see in below screenshot, both the processes have run successfully which means that RV message has been successfully published on a reliable transport and subscribed successfully as well.

tester rv processes run successful

As we can see in below screenshot, our publisher activity has published the message with the information that we mapped in its Input tab:

tibco publish rv test data values

We can see in below screenshot that our RV subscriber activity has also received the correct message on the given subject with the name and designation values with correct data:

tibco rendezvous subscriber output data values test

We can also verify from Input data tab of Write File activity that correct data has been written:

rv tester write file input data values

And at last, see the file created in the specified path and verify that data has been written the file:

output file content with rv message

 

Ajmal Abbasi

Ajmal Hussain Abbasi is a TIBCO Consultant By Profession with more than 6 years experience in TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Spotfire, TIBCO BE, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in Telecom sector by using his skills in Tibco Designer, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi is also experienced in developing solutions using Oracle PL/Sql, Linux and Java. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn

3 thoughts on “TIBCO RV Tutorial: How to Publish and Subscribe to RV Messages in TIBCO

  1. rahul

    Hi Sir,

    Can you please elaborate on the following

    1)RV Daemon
    2)RV Network
    3)RV Service

    Thanks in advance.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *