1 2 Previous Next 16 Replies Latest reply on Feb 3, 2010 4:40 AM by ataylor Go to original post
      • 15. Re: Problem sending messages from MDB on failover
        radhikasivaraj

        Hi,

         

        If I create a connection factory as shown below (by giving comma separated list of live, backup for intial context) instead of using JmsRemoteXA then I'm able to send reply messages (to backup node) from mdb even after failover.

         

         

        map.put("java.naming.provider.url", "live:1199,backup:1299")

         

         

        ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("XAConnectionFactory");

         

        Is it OK to create a connection factory as shown above for sending reply messages from MDB? Will it cause an issue if there is a temporary network failure while connecting to live node which would return a connection to backup node (in turn activating backup) instead of attempting to reconnect to live node? Can this be handled? Pls advice.

         

        Also I have another issue with the above approach where if I kill the live node when MDB is processing, then I get two reply messages from mdb (to reply queue) as I could see from log that the request message to MDB getting redelivered (after failover) and mdb process the requests twice and also sends the reply message twice. How do I handle this?

         

        Attached is the log and the MDB code.

        • 16. Re: Problem sending messages from MDB on failover
          ataylor

          You can do that but it isnt the correct way of doing it. When you use the default provider, i.e. JmsXA, the connections are pooled and work is also done as part of the same transaction as the MDB.

           

          Keep an eye on the JIRA we will fix it when we can.

          1 2 Previous Next