Announcement Announcement Module
Collapse
No announcement yet.
Issue with tibco and secure queues Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with tibco and secure queues

    We are not able to use the JMS template to connect to secure queues using tibco EMS 4.x. Not sure if it is a configuration issue or a tibco issue. Does anyone know how to configure Spring JMS with tibco for secure access. Here is how we have it configured:

    <bean id="localTibcoJNDI" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
    <props>
    <prop key="java.naming.factory.initial">${java.naming.fa ctory.initial}</prop>
    <prop key="java.naming.provider.url">${java.naming.provi der.url}</prop>
    <prop key="java.naming.security.credentials">${jms.passw ord}</prop>
    <prop key="java.naming.security.principal">${jms.usernam e}</prop>
    </props>
    </property>
    </bean>

    <bean id="tibcoJmsDestinationResolver" class="org.springframework.jms.support.destination .JndiDestinationResolver">
    <property name="jndiTemplate" ref="localTibcoJNDI"/>
    </bean>

    <bean id="tibcoQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate" ref="localTibcoJNDI"/>
    <property name="jndiName" value="${jms.queueConnectionFactory}"/>
    </bean>

    <bean id="tibcoTopicConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate" ref="localTibcoJNDI"/>
    <property name="jndiName" value="${jms.topicConnectionFactory}"/>
    </bean>

  • #2
    What I had to do is add the following adapter to pass in the username and password on the connection, where "jmsConnectionFactory" below is your target connection factory.

    Code:
    <bean id="userCredentialsConnectionFactoryAdapter" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
    	    <property name="targetConnectionFactory">
    	        <ref bean="jmsConnectionFactory"/>
    	    </property>
    	   <property name="username" value="myusername" />
    	   <property name="password" value="mypassword" />
    </bean>

    Comment


    • #3
      Thanks. This worked. Thought I already replied. Much better then the custom solution we were using.

      Comment


      • #4
        Originally posted by ccanning View Post
        Thanks. This worked. Thought I already replied. Much better then the custom solution we were using.
        Hi, I am totally new to Spring-JMS Templates, and I am also trying to integrate it with TIBCO, could you please describe step by step the config files i would have to change and what are the changes :-), if that is too much, just a high level will do, i will try to figure out the rest... I am running the web app on WAS

        Comment


        • #5
          We don't use JMS templates, so i can't help you there, but you can use the two snippets of configuration to get access to your queues, BUT, since you are using WAS, you might be better off using it to configure Tibco and use JNDI for lookups.

          Comment


          • #6
            Thank you,
            How do i configure tibco on was for JMS?
            thank you for you snippets I am using them right now, haven't yet completed it, but I am reaching there.

            Comment


            • #7
              Here is an example of what I use to setup the ConnectionFactory for TIBCO. We use JNDI to lookup the factory and this was setup by our TIBCO EMS admins, so I can't help you there.

              Code:
              <bean id="jmsSingleConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory">
              		<property name="targetConnectionFactory" ref="userCredentialsConnectionFactoryAdapter" />
              	</bean>
              	
              	<bean id="userCredentialsConnectionFactoryAdapter" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
              	    <property name="targetConnectionFactory">
              	        <ref bean="jmsConnectionFactory"/>
              	    </property>
              	   	<property name="username" value="uname" />
              	   	<property name="password" value="pwd" />
              	</bean> 
              	
              	<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
              	    <property name="environment">
              	        <props>
              	            <prop key="java.naming.factory.initial">
              	            	com.tibco.tibjms.naming.TibjmsInitialContextFactory
              	            </prop>
              	            <prop key="java.naming.provider.url">
              	           		${jms.jndiUrl}
              	            </prop>
              	            <prop key="java.naming.security.principal">
              	            	uname    
              	            </prop>
              	            <prop key="java.naming.security.credentials">
              	            	pwd    
              	            </prop>
              	        </props>
              	    </property>
              	</bean>
              	
              	<bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
                  	   <property name="jndiTemplate">
                  	       <ref bean="jndiTemplate"/>
                  	   </property>
                  	   <property name="jndiName">
                      	   <value>GenericConnectionFactory</value>
                  	   </property>
              	</bean>
              Note this is using the SingleConnectionFactory in which you would have just 1 shared connection (no connection pooling). I have had pretty good luck with the SingleConnectionFactory. Also, read the documentation in the reference manual on Spring JMS. It is very helpful.

              In addition, the following might work if you don't want to use JDNI to lookup the connection Factory.

              Code:
              <bean id="factory" class="com.tibco.tibjms.naming.TibjmsFederatedXAConnectionFactory">
              		<property name="serverUrl" value="${jms.serverUrl}" />
              		<property name="userName" value="uname" />	
              		<property name="userPassword" value="pwd" />
              	</bean>
              	
              	<bean id="singleConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory">
              		<property name="targetConnectionFactory" ref="factory"></property>
              	</bean>

              Comment

              Working...
              X