1 2 3 Previous Next 64 Replies Latest reply on Feb 25, 2008 9:23 AM by Haagen Hasle

    How to use exceptions

    Haagen Hasle Novice

      It seems to me that whenever I throw an ActionProcessingException from one of my Actions, the ESB automagically tries to invoke the Service again, to see if it works better the next time. This is not the behaviour I want.. Is it possible to turn this off? Or is there another exception I should use, that won't trigger this kind of behaviour in the ESB?

      Regards, Haagen

        • 1. Re: How to use exceptions
          Haagen Hasle Novice

          Or am I mistaken here, is it perhaps the timeout of the ServiceInvoker that triggers a retry? Or something else entirely?

          Regards, Haagen

          • 2. Re: How to use exceptions
            Mark Little Master

            If you generate an exception from the Action, the ESB will try to send back an error/fault message. Are you seeing this?

            • 3. Re: How to use exceptions
              Haagen Hasle Novice

              Yes, I've seen them. That part works great, especially after you added the FaultMessageException. (I've used tree different versions of the ESB so far and it keeps getting better - keep up the good work! :)

              I guess my question should be phrased different. What I don't understand is: Under which conditions are a message resent to a Service?


              Regards, Haagen

              • 4. Re: How to use exceptions
                Mark Little Master

                If you register multiple services in the registry for the same service name then the ESB will attempt to send the same request to each of the services until it gets a response (which would include a fault message). If it decides to fail-over to another service in this way, you should see something on INFO though, so you might want to try enabling that.

                • 5. Re: How to use exceptions
                  Mark Little Master

                   

                  "haagenhasle" wrote:
                  (I've used tree different versions of the ESB so far and it keeps getting better - keep up the good work! :)


                  On behalf of the team: thanks :-)

                  • 6. Re: How to use exceptions
                    Haagen Hasle Novice

                    There has got to be more scenarios where the ESB re-sends the Message to the Service? I only have one Service registered under the same name (Unless the Registry has tricked me in some way.. That is at least the way it is in the jboss-esb.xml.) What about when a synchronous ServiceInvoker-call times out? (replyMessage = serviceInvoker.deliverSync(requestMessage, _TIMEOUT); )

                    I have a Service in my ESB that sometimes takes a long time.. The Service is not idempotent, and what I saw was that I returned a response that clearly suggested that the first call had timed out, and it was the response from the second one that I got back. Does this sound correct?

                    What I would like to do is to turn of this resending-behaviour, and have the ESB return an errormessage instead if a timeout occurs.

                    Regards, Haagen

                    • 7. Re: How to use exceptions
                      Mark Little Master

                      If a timeout goes off then the ServiceInvoker (which most/all code now uses) will treat this as an error and behave as I mentioned previously.

                      Are you seeing any warnings/infos about unresponsive EPRs?

                      • 8. Re: How to use exceptions
                        Haagen Hasle Novice

                        I know I've seen several such warnings before, do they cause a message to be resent? (I'll check to see if they appear during a timeout too..)

                        Under which conditions are a message sent again?


                        Regards, Haagen

                        • 9. Re: How to use exceptions
                          Haagen Hasle Novice

                          On the same topic; I've observed that when I debug my application from Eclipse (I've turned on remote debugging in JBoss), if I stop at a breakpoint in an action, look at some variables, then press F8 to contine, it stops at the same breakpoint again and again - several times!

                          This (timeout/resend-business) is obviously an aspect of JBossESB that I haven't understood yet.. Can anyone try to explain it to me, or point me to url or perhaps a java-sourcefile that can help enlighten me?

                          Regards, Haagen

                          • 10. Re: How to use exceptions
                            Mark Little Master

                             

                            "haagenhasle" wrote:
                            I know I've seen several such warnings before, do they cause a message to be resent? (I'll check to see if they appear during a timeout too..)


                            They don't cause a message to be resent, but they indicate that one will be resent if there are multiple services mentioned in the registry with the same service name.


                            Under which conditions are a message sent again?


                            I thought I already mentioned that above: failure to deliver (e.g., comms failure), timeout. But receiving a fault message will not cause a redelivery.

                            • 11. Re: How to use exceptions
                              Mark Little Master

                               

                              "haagenhasle" wrote:
                              This (timeout/resend-business) is obviously an aspect of JBossESB that I haven't understood yet.. Can anyone try to explain it to me, or point me to url or perhaps a java-sourcefile that can help enlighten me?


                              What do you need explaining? The timeout is at the client/sender side for synchronous (RPC) invocations, and basically causes the sender to block for the specified period of time while waiting for a response. If the response does not arrive within that time period the ESB assumes that there is a problem and will throw an appropriate exception. If you're using raw Couriers then you will see that exception. If you are using the ServiceInvoker then the exceptioin is caught and treated in the same way as a comms failure, in that the SI then iterates over any other services it may have received from the registry under the same service name.

                              • 12. Re: How to use exceptions
                                Tom Fennelly Master

                                As a test, try adding the following config property to the "core" section of your jbossesb-properties.xml (in jbossesb.sar):

                                <property name="org.jboss.soa.esb.dls.redeliver" value="false"/>
                                


                                This turns off the Dead Letter Service, which will attempt redelivery on failures. Bounce your server after this config mod. Not sure if that's required, but no harm.

                                • 13. Re: How to use exceptions
                                  Mark Little Master

                                  Yes, good point: if a timeout goes off then the DLS will be used to later redeliver.

                                  Timeouts are used to suspect failures. (Not specific to ESB: most distributed systems do this). If the value of the timeout is wrong then you'll get wrong suspicions.

                                  Until we have a failure suspector in the ESB, you can either a) increase the timeout, or b) mark messages as not going to the DLS on timeout (we'd have to do that).

                                  • 14. Re: How to use exceptions
                                    Haagen Hasle Novice

                                     

                                    "mark.little@jboss.com" wrote:
                                    What do you need explaining? The timeout is at the client/sender side for synchronous (RPC) invocations, and basically causes the sender to block for the specified period of time while waiting for a response. If the response does not arrive within that time period the ESB assumes that there is a problem and will throw an appropriate exception. If you're using raw Couriers then you will see that exception. If you are using the ServiceInvoker then the exceptioin is caught and treated in the same way as a comms failure, in that the SI then iterates over any other services it may have received from the registry under the same service name.


                                    I guess what I don't understand is why I see several resent messages in my ESB-application, based on what you say that shouldn't happen. I only have one Service registered with a given name. If I understand you correctly, that means the ESB won't resend a message that has timed out, because there are no "alternative services".

                                    The only reason I see for this behaviour is that I do in fact have several Services registered under the same name, but how can that be? I only use unique names in the jboss-esb.xml file, and I do a proper shutdown every time, I don't use Ctrl-C to shut down the server anymore. Can old Service-definitions be in the registry anyway?

                                    Regards, Haagen

                                    1 2 3 Previous Next