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 TIBCO RV 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 Resources –> 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:
In the advanced tab, choose Reliable as RV Type:
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:
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:
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:
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:
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:
Step 5: 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:
In the Output Editor tab of RV subscriber activity, choose the same XSD as we chose for RV Publisher Input Editor Activity.
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:
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:
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.
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 6: 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:
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.
As we can see in below screenshot, our publisher activity has published the message with the information that we mapped in its Input tab:
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:
We can also verify from Input data tab of Write File activity that correct data has been written:
And at last, see the file created in the specified path and verify that data has been written the file:
Exelent tutorial thanks
Very straight and Excellent explaination. Thanks a lot.
Hi Sir,
Can you please elaborate on the following
1)RV Daemon
2)RV Network
3)RV Service
Thanks in advance.
Very straight and Excellent explaination. Thanks a lot.
Is it possible to have multiple subscribers listening to one publisher and one subject?
For example:
I have tried this kind of scenario:
Publisher: subject- test.subject.*
Subscriber1: subject- test.subject.one
Subscriber2: subject- test.subject.two
Subscriber3: subject- test.subject.three
But getting error:
Cannot activate TIBRV listener for subject: [test.subject.*]
caused by: TibrvException[error=23,message=Subject collision detected].