Hi,

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());
            queueSender.send(message);
            queueSender.close();

            
        } catch (JMSException e) {
            e.printStackTrace();
        } catch (Exception ee) {
            ee.printStackTrace();
        }
    }

    /**
     * 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, 
                      javax.jms.Session.AUTO_ACKNOWLEDGE);
            m_queueConnection.start();

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


thanks

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3829700#3829700

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3829700


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to