Hi All,

I am not able to figure out why my messages are not
being sent back to
the queue on a session rollback. I am not using MDB's.
Following is
how I am setting up my connection to a Topic

        //ConnectionFactory (using
TopicConnectionFactory)
        TopicConnection connection =
connectionFactory.createTopicConnection(username,password);

        connection.setClientID(clientId);

       TopicSession session =
connection.createTopicSession(true,0);

       TopicSubscriber subscriber =
session.createDurableSubscriber(topic,subscriptionName);

In a while loop, I have the call to receive messages:

 Message msg = subscriber.receive(1000);

after receiving a message, I process it, and call
session.commit(). But, if I run into
problems while processing the message, I am calling
session.rollback(). But, I don't
see the messages being persisted back into the db
table (JMS_MESSAGES) after the
call to session.rollback(). I was hoping that they
would be, so that when the consumer
is re-started, these messages can be re-delivered.
What could be going wrong? I thought
that if I create a topic session with 'transacted' set
to true, I will be able to restore messages
in case of processing errors...

Also, in the above situation, how can I configure the
number of 're-try' attempts? In an MDB,
one can do that in the deployment descriptor...but, in
a situation like the one above, how do I
tell the messaging server to 're-try' 3 or 4 times,
before sending the message to DLQ.... 

Please help!


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

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


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to