13 Replies Latest reply on Sep 27, 2001 8:04 PM by cptnkirk

    JMS ExceptionListeners not working

      I've written a program which passivly listens to a Queue and processes messages based on a selector. In order to know when the Queue goes down, I rely on registering an ExceptionListener. I'm using jbossmqbeta1, and it seems that exceptions are never fired to this exception listener. I've registered a listener, killed the Queue and then waited for minutes for an exception to occur with no luck. Is this a known bug, has it been fixed in a later version? Under what conditions would jbossmq fire such an exception to such a listener?

        • 1. Re: JMS ExceptionListeners not working
          hchirino

          When you kill the queue, do you mean that you stop kill the JBossMQ server??

          • 2. Re: JMS ExceptionListeners not working

            Yes. This actually shuts down the server gracefully due to the shutdown hooks. However a more likely test would be machine power outage or network loss. This would not be able to be cleaned up via a shutdown hook. In either case the event doesn't seem to get fired.

            • 3. Re: JMS ExceptionListeners not working

              Hi, I am cind of curious here. The old behaviour was this. Connect to a remote JBossMQ, take the the remote JBossMQ server down. The following two thing happened:

              1. If the server never sent any messages to the listening client, the client would never get any exceptions reported and would hang forever.
              2. If a message had been sent to the client, the exception listener would get called.

              Have you tested if not even scenario 2 works any more?

              //Peter

              • 4. Re: JMS ExceptionListeners not working

                I believe that both scenarios now hang. In order to test I've sent one (and only one message), which is received, and then take the remote server down. Client hangs forever.

                If I then start the remote server back up, it still hangs forever.

                I'd propose that both scenarios should work. If the client is able to create a QueueConnection and thus a QueueReceiver then the client should be notified if the remote queue goes down regardless of if it has already received messages.

                • 5. Re: JMS ExceptionListeners not working
                  hchirino

                  Hi guys... yes.. its been a known problem. I think the best way to solve this is to have the clients send occational 'ping' messages to the server.

                  So many thing todo.. so little time.
                  I don't know when I'll be able to implement this..
                  Anybody in a big hury??

                  Regards,
                  Hiram

                  • 6. Re: JMS ExceptionListeners not working
                    hchirino

                    OK... so I poped this bug to the top of my priority list and I fixed it...

                    The ping has been implemented..

                    Fix has been commited to the HEAD branch.

                    • 7. Re: JMS ExceptionListeners not working

                      Thanks very much for the quick work. I've checked out the latest code, however there is a build error. :(

                      Not in your latest code, but somewhere else. Guess I'll wait until this get's fixed as well. Is there a planned release date of JBossMQ1.0?

                      Thanks again.

                      • 8. Re: JMS ExceptionListeners not working

                        I've verified that ExceptionListeners do indeed work now. Is the ping rate configurable (I.e settable to say 5-10 seconds instead of what it is now)?

                        Thanks again.

                        -Jim

                        • 9. Re: JMS ExceptionListeners not working
                          hchirino

                          Not yet.. but should not be hard thing to do. But the question is what interface do you want to configure it with. (It's not part of the JMS API) so how???

                          - A configuration parameter of the ConnectionFactory??
                          - A system property??

                          Regards,
                          Hiram

                          • 10. Re: JMS ExceptionListeners not working
                            hchirino

                            Hey I made it configurable via the ConnectionFactory.

                            So you can adjust it by editing the MBean section (in jbossmq-service.xml) of the conection factory you use.

                            Regards,
                            Hiram

                            • 11. Re: JMS ExceptionListeners not working

                              I saw that. That probably would have been my suggestion. :)

                              Now from what I understand the whole ILService will have a PingPeriod, and all named connection factories will have that value as well. Is it possible to have multiple ILServices with the same type, and thus have multiple connection factories with possibly different PingPeriods?

                              I ask because if it were possible to set up a connection factory which I could use for asynch consumers vs synch consumers, I could set the asynch ping rate very high and the synch rate lower.

                              If I have an important asynch listener, it's important to be notifed of a failure quickly so it can reregister its interest and any possible selectors it might have. For synchronus listeners this isn't that much of a problem as it should figure out the error right away just by its nature.

                              If this isn't possible, I'll fine. After all this isn't a feature that's even tuneable anywhere else.

                              Thanks again,
                              Jim

                              • 12. Re: JMS ExceptionListeners not working
                                hchirino

                                Yes, you can start multiple receivers of the same type.. Just copy down the OIL MBean section and change the MBean name to something different (JNDI names must be different too).

                                Regards,
                                Hiram

                                • 13. Re: JMS ExceptionListeners not working

                                  Read my message about QueueConnection.close not cleaning up all threads. Could this be a result of the ping code?