3 Replies Latest reply on Feb 14, 2014 12:46 PM by kamilpl

    Void methods and exception handling

    kamilpl

      In current version of SY (1.1.0) if I have void method in service Switchyard treats it as InOnly method. It is quite inconvenient when this method throws an exception, because this exception is not propagated to calling method (Exeption is catched by switchyard bus and droped). Am I miss something? Is there any way to force Switchyard to treat method as InOut without adding any return value (leaving method as void)? Do you plan to change this behaviour in future version of Switchyard?

        • 1. Re: Void methods and exception handling
          kcbabo

          The exception is actually reported via the bus, it's more a matter of whether the implementation type you are using surfaces the exception.  For example, if you are using a bean service, an instance of ReferenceInvoker can be used to query any exception thrown during an in-only.

           

          Support for robust in-only has been discussed is under consideration for a future release.  If you have a use case other than what I outlined above, please let us know so that we can make sure it's taken into account.

          • 2. Re: Void methods and exception handling
            kcbabo

            You might be interested in the following enhancement, which allows you to configure the visibility of faults/errors within in-only exchanges:

            [SWITCHYARD-1950] for IN_ONLY, ClientProxyBean and camel OutboundHandler doesn't propagate a fault to the consumer - JBo…

             

            That will be in 2.0 for sure as Tomo has already submitted the pull request.  The idea with this enhancement is that runtime errors which are not represented in the service contract still might be of interest to consumers, so we want to make the behavior configurable on a per-application basis.  Robust-In-Only support is still a desirable feature in the future, which would allow the service contract to explicitly define an application-level fault.

            1 of 1 people found this helpful
            • 3. Re: Void methods and exception handling
              kamilpl

              Great to hear that. I hope that this exception propagation will be available also for service references, not only for reference invoker. Do you have any estimation when SY 2.0 will be released? You have made a great job with this project. It realy simplifies writing SOA applications.