Use the following Spring config:
<bean id="jmsDestination" class="com.tibco.tibjms.TibjmsQueue">
<constructor-arg value="queue.sample" />
</bean>
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory" ref="tibcoConnectionFactory"/>
<property name="username" value="admin"/>
<property name="password" value=""/>
</bean>
<bean id="tibcoConnectionFactory" class="com.tibco.tibjms.TibjmsConnectionFactory">
<property name="serverUrl" value="tcp://hostname:7222"/>
<property name="userName" value="admin"/>
<property name="userPassword" value=""/>
</bean>
<bean id="jmsProducerTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="defaultDestination" ref="jmsDestination"/>
</bean>
Then in the code, publish a message like this:
jmsProducerTemplate.send(new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
return session.createTextMessage(dataString);
}
});
This will publish directly to the Tibco queue, to use the JNDI of your WebLogic see this post: Configuration of tibco jms with Spring