Thanks on your answer,

I am aware that MDBs solve that problem, e.g the container takes care of that

but my problem is that part of our legacy code could not be executed in EJB container 
(threads, etc.) - so we have to use it in Web container
that's why MDB's are not the right solution here

we will eventually rewrite the code to use it in EJB container - but for now we're 
stuck to the Web container

> -----Original Message-----
> From: Johan Eltes [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 22, 2003 12:11 PM
> To: Darije Ramljak (ETK); [EMAIL PROTECTED]
> Subject: Re: JMS and exceptions - reconnecting to the Message
> Queue server
>
>
> J2EE 1.3 and above privides you with a standard solution:
> Message-driven
> beans. But you have to enter the world of EJBs to get the
> benefits. However,
> message driven EJBs requires very little general knowledge
> about EJB. You
> just need to develop the actual implementation class - no home/remote
> interfaces.
>
> /Johan
>
> Den 2003-01-22 09.28, skrev "Darije Ramljak (ETK)"
> <[EMAIL PROTECTED]>:
>
> > hi,
> >
> > I was wondering if there is an elegant solution to the
> following problem
> >
> > I have a JMS message listener set up to listen to the Queue
> > this all happens in the servlet that has load-on-startup
> attribute set to 1
> >
> > the problem is that if the MQ server crashes and then is restarted -
> > connections are lost and my listener is left hanging in the air
> >
> > there is ExceptionListener that can be set to listen for
> asynchronous
> > exceptions - so the solution could be to try to recconect
> to the queue and to
> > start the listener again in the onException() method of
> ExceptionListener
> >
> > the problem is now that the MQ server is not restarted
> immediatelly, but in a
> > range of 5-10 mins (even that is variable)
> >
> > maybe I could set the while loop to catch exceptions or
> ping the MQ server
> > (with sleep intervals) and only when the server responds to
> try to recconect
> > and exit the onException() method  - but somehow I think
> that this is not the
> > most elegant solution and the solution that is in the spirit of J2EE
> > programming
> >
> > TIA,
> >
> > Darije
> >
> >       _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> >       Darije Ramljak
> >       Senior Software Engineer
> >       IP Platforms & Applications (ETK/D/B/I)
> >       New Products Department
> >       Research & Development Center
> >
> >       Ericsson Nikola Tesla d.d.
> >       Krapinska 45, p.p. 93   Phone:  +385 1 365 3823
> >       HR-10002 Zagreb Fax:    +385 1 365 3610
> >       Croatia                                     Email:
> > [EMAIL PROTECTED]
> >
> >
> ==============================================================
> =============
> > To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> > of the message "signoff EJB-INTEREST".  For general help,
> send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to