[jboss-user] [JBoss Messaging] - Message Delay (upto 9 hours) in JBoss Messaging 1.4.0 SP3 in JBoss cluster environment

Vijay Rawat do-not-reply at jboss.com
Fri Jul 30 08:00:19 EDT 2010


Vijay Rawat [http://community.jboss.org/people/vijayraw] created the discussion

"Message Delay (upto 9 hours) in JBoss Messaging 1.4.0 SP3 in JBoss cluster environment"

To view the discussion, visit: http://community.jboss.org/message/555175#555175

--------------------------------------------------------------

We are using JBoss cluster with two nodes and JBoss Messaging 1.4.0 SP3 as our JMS provider. We are facing message delay issue in our production environment. Logs indicates that message has been put in the queue but on the consumer side they are not consumed. They delays are quite long (upto 9-10 hours) or on restart it get consumed. We are using spring (DefaultMessageListenerContainer) on the consumer side. Each queue has only one consumer attached
 
Our Message Sending Code looks like this :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public void writeToQueue(Queue queue, JmsMessage message) throws JMSException {
        LOG.info("Entering with queue " + queue);
        Connection jmsConnection = null;
        try {
            jmsConnection = connectionFactory.createConnection();
            jmsConnection.start();
            // Create the session
            Session jmsSession = jmsConnection.createSession(message.isTransacted(),
                    Session.AUTO_ACKNOWLEDGE);
            // Create the JMS message producer which will post messages to the
            // destination;
            MessageProducer messageProducer = jmsSession.createProducer(queue);
            if (message.isPersistent()) {
                messageProducer.setDeliveryMode(DeliveryMode.PERSISTENT);
            } else {
                messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
            }
            MapMessage mapMessage = jmsSession.createMapMessage();
            for (Map.Entry<String, String> entry : message.getMessage().entrySet()) {
                mapMessage.setString(entry.getKey(), entry.getValue());
            }
            messageProducer.send(mapMessage);
            if (message.isTransacted()) {
                jmsSession.commit();
            }
        } catch (JMSException jex) {
            LOG.error(jex.getMessage(), jex);
            throw jex;
        } finally {
            if (jmsConnection != null) {
                try {
                    jmsConnection.close();
                } catch (JMSException ignore) {
                    LOG.error(ignore.getMessage(), ignore);
                }
            }
        }
        LOG.info("Published a message to queue " + queue);
    }
 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
 
Attached are the Configuration Files for JBoss Messaging
 
Unfortunately I could not replicate this problem in our QA or local environment.
 
If anybody has faced this problem, and have workaround for this, Pls let me know.
 
 

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/555175#555175]

Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2042]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100730/93ac245b/attachment-0001.html 


More information about the jboss-user mailing list