Announcement Announcement Module
No announcement yet.
JmsTemplate with Tibco Queue Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JmsTemplate with Tibco Queue

    I'm having problems getting messages to send, and can't quite figure out what I'm doing wrong. I think I'm close (I hope).

    If I set jndiName on the internalJmsQueueConnectionFactory to "QueueConnectionFactory", I get errors, but if it's "ConnectionFactory", it works, yet doesn't send messages. I know there's some stuff going on behind the scenes that I have no clue about.

        <!-- JNDI Environment Template -->
        <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
            <property name="environment">
                    <prop key="java.naming.factory.initial">com.tibco.tibjms.naming.TibjmsInitialContextFactory</prop>
                    <prop key="java.naming.provider.url">tcp://</prop>
                    <prop key="">...</prop>
                    <prop key="">...</prop>
        <!-- JMS Topic Connection Factory -->
        <bean id="internalJmsQueueConnectionFactory"  class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiTemplate" ref="jndiTemplate"/>
            <property name="jndiName" value="QueueConnectionFactory" />
    	 <bean id="authJmsQueueConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
    	   <property name="targetConnectionFactory" ref="internalJmsQueueConnectionFactory" />
    	   <property name="username" value="..." />
    	   <property name="password" value="..." />	 
        <!-- JMS Destination Resolver -->
        <bean id="jmsDestinationResolver" class="">
            <property name="jndiTemplate" ref="jndiTemplate" />
            <property name="cache" value="true" />
        <bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate">
            <property name="connectionFactory" ref="authJmsQueueConnectionFactory" />
            <property name="destinationResolver" ref="jmsDestinationResolver" />
            <property name="defaultDestinationName" value="" />
            <property name="receiveTimeout" value="20000" />

    public class SpringJMS {
        public static void main(String[] args) throws InterruptedException, IOException {
            ApplicationContext context = new FileSystemXmlApplicationContext("/conf/SpringJMS-context.xml");
            JmsTemplate t = (JmsTemplate)context.getBean("jmsQueueTemplate");
            t.send(new MessageCreator() {
    			public Message createMessage(Session s) throws JMSException {
    				TextMessage tm = s.createTextMessage();
    				tm.setText("Sample Message");
    				return tm;

  • #2
    hi i need to send messages to Tibco queue too...
    Did u resolve your problem? I need some help please.