Use TibcoRV connector with Mule ESB
Installation
Prerequisites
Priori to following the current tutorial, you must have installed
- a Java JDK/JRE 1.5+, with a parameter JAVA_HOME already set
- a TibcoRV 8.1, with a parameter TIBRV_HOME already set. You can consult a short tutorial here to perform this.
Main
- Get Zip version of “Mule ESB Full Distribution”, version 2.2.1, on this page.
- Unzip the content in a folder, eg: C:\exe\mule-standalone-2.2.1
- Add a environment variable MULE_HOME and update your path, eg:
set MULE_HOME=C:\win32app\mule-standalone-2.2.1 set PATH=%PATH%;%MULE_HOME%\bin
- To check the Mule is well installed, you can launch the “Hello World” application:
%MULE_HOME%\examples\hello\hello.bat
Specific for TibcoRV
- Get mule-transport-tibcorv-2.2.1.jar, available at this link.
- Copy it into %MULE_HOME%/lib/mule
- Get the jar %TIBRV_HOME%\lib\tibrv.jar
- Copy and rename it into %MULE_HOME%/lib/opt/tibrvj-8.1.2.jar
- Tip: to know the exact version of the Jar you have just copied, you can open it, explore and decompile the class com.tibco.tobrv.tibrvj_id. The exact version must appear.
- Copy %MULE_HOME%/conf/wrapper.conf as %MULE_HOME%/conf/wrapper.conf.old
- Edit %MULE_HOME%/conf/wrapper.conf:
- replace
wrapper.java.library.path.1=%LD_LIBRARY_PATH% wrapper.java.library.path.2=%MULE_HOME%/lib/boot
with:
wrapper.java.library.path.1=%LD_LIBRARY_PATH% wrapper.java.library.path.2=%MULE_HOME%/lib/boot wrapper.java.library.path.3=%TIBRV_HOME%/bin
- replace
Here is for the very configuration.
“Hello world” for “TibcoRV via Mule”
Configuration file for Mule/TibcoRV “Hello World”
Code below is commented. Save it into a file named mule-config.xml.
<?xml version="1.0" encoding="UTF-8" ?> <mule xmlns="http://www.mulesource.org/schema/mule/core/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:management="http://www.mulesource.org/schema/mule/management/2.2" xmlns:tibcorv="http://www.mulesource.org/schema/mule/tibcorv/2.2" xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2" xsi:schemaLocation="http://www.mulesource.org/schema/mule/management/2.2 http://www.mulesource.org/schema/mule/management/2.2/mule-management.xsd http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd http://www.mulesource.org/schema/mule/tibcorv/2.2 http://www.mulesource.org/schema/mule/tibcorv/2.2/mule-tibcorv.xsd http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd"> <!-- The TibcoRV we're listening is on the IP#127.0.0.1 --> <tibcorv:connector name="myTibcoConnector" network="127.0.0.1"/> <model name="fromTibco2stout"> <service name="fromTibco"> <inbound> <!-- We follow all subjects, on the TibcoRV connector defined above--> <tibcorv:inbound-endpoint connector-ref="myTibcoConnector" subject="*"/> </inbound> <echo-component/> <outbound> <pass-through-router> <!-- Messages received are displayed on standard output --> <stdio:outbound-endpoint address="stdio://OUT"/> </pass-through-router> </outbound> </service> </model> </mule>
Run TibcoRV
Launch the daemon
Launch the daemon on localhost on port 7580:
%TIBRV_HOME\bin\rvd -http 7580
Launch a listener
Possibly, you can run a listener in a separate frame, in order to double check whether messages are sent and received in the right way, independantly of what happens on Mule side.
Listen to all messages with subject mySubject on localhost:7580
%TIBRV_HOME\bin\tibrvlisten.exe" -network localhost mySubject
Launch the Mule
- Now run the ESB:
%MULE_HOME%\bin\mule.bat -config path\to\file\mule-config.xml
- Send a message:
%TIBRV_HOME\bin\tibrvsend.exe -network 127.0.0.1 mySubject HelloWorld
- Expected outputs:
- On sending frame:
Publishing: subject=mySubject "HelloWorld"
- On listening frame:
tibrvlisten: Listening to subject mySubject 2010-01-21 17:51:43 (2010-01-21 16:51:43.109000000Z): subject=mySubject, message={DATA="HelloWorld"}
- On Mule ESB frame:
INFO 2010-01-21 17:53:02,860 [Bus] org.mule.transport.tibrv.TibrvMessageReceiver: message received on: * INFO 2010-01-21 17:53:02,860 [fromTibco.4] org.mule.transport.tibrv.TibrvMessageAdapter: The newThreadCopy method in AbstractMessageAdapter is being used directly. This code may be susceptible to 'scribbling' issues with messages. Please consider implementing the ThreadSafeAccess interface in the message adapter. INFO 2010-01-21 17:53:02,860 [fromTibco.4] org.mule.component.simple.LogComponent: ******************************************************************************** * Message received in service: fromTibco. Content is: '{ * * DATA="HelloWorldOfTheWorld" }' * ******************************************************************************** INFO 2010-01-21 17:53:02,860 [connector.stdio.0.dispatcher.3] org.mule.transport.stdio.StdioMessageDispatcher: Connected: endpoint.outbound.stdio://OUT {DATA=HelloWorldOfTheWorld, __send__subject__=mySubject}
- On sending frame: