Message Listener or MDB???
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sanjeev_Kasarabada
Posted On:   Tuesday, July 30, 2002 03:48 PM

Hi, Message There was an earlier question of similar kind but was not informative enough. I have a scenario where I have to pick an Object Message from Queue and send it to RMI server. THis communication happens in the onMessage() handler of the MDB. This is basically using Asynchromous messaging set up. It may happen that server is down and message can't be sent. An exception is thrown and the message is lost. I am using Weblogic 7.0 JMS Server. I need to process the message at a later time when the RMI server is back up. I don't want to loose the message. How can I do this with the existing set up using an MDB?? I want the message to be redelivered when the server is back up I thought that by using   More>>

Hi,



Message There was an earlier question of similar kind but was not informative enough.
I have a scenario where I have to pick an Object Message from Queue and send it to RMI server. THis communication happens in the onMessage() handler of the MDB. This is basically using Asynchromous messaging set up. It may happen that server is down and message can't be sent. An exception is thrown and the message is lost. I am using Weblogic 7.0 JMS Server.


I need to process the message at a later time when the RMI server is back up. I don't want to loose the message. How can I do this with the existing set up using an MDB?? I want the message to be redelivered when the server is back up


I thought that by using Message Listeners I can have more control on creating message listeners only when the RMI server is up and running and also there are messages to be processed in the Queue. Since MDB's are created once there are messages to serve in the queue there is now way to avoid but to process the message and which results in the message being lost.


Any help is greatly appreciated.


Thanks,


Sanjeev

   <<Less

Re: Message Listener or MDB???

Posted By:   Gautam_Marwaha  
Posted On:   Tuesday, July 30, 2002 10:27 PM

You can avoid messages being lost using PERSISTENT delivery mode, which I think is the default. Further to ensure that messages are consumed, you may set the acknowledgement mode.

In your scenario when the RMI server may be down, you can use MDBs. If you use container managed txns in MDBs, when an exception occurs in onMessage you can set the txn for rollback using setRollbackOnly() which will allow re-delivery of the message (i.e. mark message for re-delivery). Further you may set an appropriate re-delivery delay for the JMS server to attempt re-delivery only when the delay period has elapsed. This would be useful if the RMI server remains down for an extended period of time.

About | Sitemap | Contact