Now I have java code which starts tibco jms subscription with several steps:
Properties props = new Properties();
props.put("java.naming.provider.url", namingProvider);
props.put("java.naming.factory.initial", namingFactory);
props.put("java.naming.referral", namingReferral);
props.put("java.naming.security.credentials", securityCredentials);
props.put("java.naming.security.principal", securityPrincipal);
context = new InitialContext(props);
TopicConnectionFactory tfactory = (TopicConnectionFactory) context
.lookup(url + topic + ":tcf");
topicConnection = tfactory.createTopicConnection(user, password);
topicConnection.setExceptionListener(exceptionListener);
topicSession = topicConnection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
subscriber = topicSession.createSubscriber(
(Topic) context.lookup(url + topic + ":topic"),
SELECTOR, true);
subscriber.setMessageListener(messageListener);
topicConnection.start();
I want to use Spring for initialization, but I can't find how to configure jms in spring using initial context. Can you help me with it? Thanks!
Good Day Friends,
Step 1:
As of today you have to be registered to use https://download.tibco.com/tibco.
You can download a trial of EMS at http://tap.tibco.com/storefront/trialware/tibco-enterprise-message-service/prod15032.html. Once you install the trial the jars will be in the ems/8.0/lib directory.
Step 2:
Tibco jar files are not available @ Maven Repository.
Collect all tibco jar files from tibco ems installables.
Execute below command from command prompt to include tibco jars into local maven repository.
Step 3:
Commands:
mvn install:install-file -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar -Dfile=jms.jar mvn install:install-file -DgroupId=com.tibco -DartifactId=tibcrypt -Dversion=5.1.0 -Dpackaging=jar -Dfile=tibcrypt.jar mvn install:install-file -DgroupId=com.tibco -DartifactId=tibemsd_sec -Dversion=5.1.0 -Dpackaging=jar -Dfile=tibemsd_sec.jar mvn install:install-file -DgroupId=com.tibco -DartifactId=tibjms -Dversion=5.1.0 -Dpackaging=jar -Dfile=tibjms.jar mvn install:install-file -DgroupId=com.tibco -DartifactId=tibjmsadmin -Dversion=5.1.0 -Dpackaging=jar -Dfile=tibjmsadmin.jar mvn install:install-file -DgroupId=com.tibco -DartifactId=tibjmsapps -Dversion=5.1.0 -Dpackaging=jar -Dfile=tibjmsapps.jar mvn install:install-file -DgroupId=com.tibco -DartifactId=tibjmsufo -Dversion=5.1.0 -Dpackaging=jar -Dfile=tibjmsufo.jar mvn install:install-file -DgroupId=com.tibco -DartifactId=tibrvjms -Dversion=5.1.0 -Dpackaging=jar -Dfile=tibrvjms.jar
Maven Dependencies for Tibco EMS. Add it on you .pom file dependencies
Shown is the Spring file for tibco config.
Java File Implementation
It is working for me, Please ping me in case of any exceptions.
You can try something like this to get TopicConnectionFactory: