2 Replies Latest reply on Apr 14, 2004 10:56 AM by sunh11373

    tibco JMS and JTA

    sunh11373 Newbie


      Try to use tibco JMS with JTA, does anyone have experience?

      It seems that the session is not aware of the global transaction started by
      the JTA and always write to the destination queue.

      Here is a piece of code

      * @see javax.jms.MessageListener#onMessage(javax.jms.Message)
      public void onMessage(Message msg) {
      try {

      TextMessage orderMsg = (TextMessage)msg;
      m_logger.info("Received Order from Queue: " + orderMsg.getText());

      QueueSender queueSender = m_queueSession.createSender(m_queue);
      TextMessage message = m_queueSession.createTextMessage();
      message.setText(orderMsg.getText() + "@" + System.currentTimeMillis());
      m_logger.info("Publishing message: " + message.getText());

      } catch (JMSException e) {
      } catch (Exception ee) {

      * Creates the EJB object.
      * @ejb:create-method
      public void ejbCreate() {

      try {
      m_jndiContext = new InitialContext();
      m_queueFactory = (QueueConnectionFactory)m_jndiContext.lookup("tibjmsnaming://localhost/XAQueueConnectionFactory");
      m_queue = (Queue)m_jndiContext.lookup("tibjmsnaming://localhost/queue/EntitlementQueue");
      m_queueConnection = m_queueFactory.createQueueConnection();

      // I have tried "transactional flag = 'true' as well
      m_queueSession = m_queueConnection.createQueueSession(false,

      } catch (Exception ne) {
      throw new EJBException(ne);


        • 1. Re: tibco JMS and JTA
          Adrian Brock Master

          JTA integration is not automatic, you need to plug tibco's XAConnectionFactory
          in jboss's JMS resource adapter.

          There is an example in the FAQ topic at the top of this forum on
          how to configure a remote JBossMQ using JMSRA.
          "How do I access a remote jboss connection factory using a managed connection pool."

          What you will need to change is the way it accesses jndi.
          There are three ways to do this:

          1) Implement your own version of the ProviderAdapterClass
          org.jboss.jms.jndi.JBossMQProvider, which performs the jndi operations.
          If you look at the code you will find it is fairly trivial.

          2) Bind tibco's jndi context into jboss's jndi context using the
          org.jboss.naming.ExternalContext mbean, you will see this discussed a lot
          in these forums or if you want to avoid the fumbling of a lot of posts
          it is better explained in the admin docs.

          3) Use tibco specifc apis to bind their objects into jboss's jndi, there is an example
          of this for Oracle referenced in the FAQ topic. The same patch section on sourceforge
          contains an example for MQSeries/WebsphereMQ.

          Once you get this to work, please post back the working configuration.


          • 2. Re: tibco JMS and JTA
            sunh11373 Newbie


            Thanks for the advise. I worked this out with your first suggestion. Will try others if I have time. Attached is the working configuration:

            ====== jms-ds.xml ===========

            <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
            <attribute name="ProviderName">TIBCOJMSProvider</attribute>
            <attribute name="ProviderAdapterClass"> com.tibco.tibjms.appserver.jboss.JBossAdapter </attribute>
            <attribute name="QueueFactoryRef">BHXAQueueConnectionFactory</attribute>
            <attribute name="TopicFactoryRef">BHXATopicConnectionFactory</attribute>
             <adapter-display-name>JMS Adapter</adapter-display-name>
             <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
             <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:TIBCOJMSProvider</config-property>



            Thanks for the support again