2 Replies Latest reply on May 15, 2008 3:43 PM by Roger Joelsson

    Component servicemix-bean as a Binding Component: ERROR bouncing

    Roger Joelsson Novice

      Hi all,

       

      I'm using the servicemix-bean component for Java-based connectivity outside the NMR. Thus, my servicemix-bean-based component acts as a BC on the ESB. On this subject, I have two questions:

       

      1. Is this usage of servicemix-bean encouraged? I'm using it to access a Java-based interface only available by method calls, so creating a separate BC only performing the actual over-the-wire communication is not an option.

       

      2. It might happen that the external service (the one accessed through the Java method calls) for some reason rejects the call. In some of these cases I may want to retry the call, but in most cases I would not like to -- hence I would like set the MessageExchange's ExchangeStatus to ERROR (correct?). The ERROR state, as far as I've understood, is similar to the DONE state in the way the the communication is closed (correct?).

       

      Now to my actual second question:

      - What is the correct way of notifying caller (through another outbound BC) that the call failed? Should I create a new message within the servicemix-bean component, which I send onto the the NMR (after setting the original MessageExchange to ERROR)? Any hints on this matter are welcome!

       

      Regards,

      Roger

        • 1. Re: Component servicemix-bean as a Binding Component: ERROR bouncing
          Bruce Snyder Novice

           

          I'm using the servicemix-bean component for Java-based connectivity outside the NMR. Thus, my servicemix-bean-based component acts as a BC on the ESB. On this subject, I have two questions:

           

          1. Is this usage of servicemix-bean encouraged? I'm using it to access a Java-based interface only available by method calls, so creating a separate BC only performing the actual over-the-wire communication is not an option.

           

           

          This is not a problem at all. Using the servicemix-bean component allows you to access POJOs and other Java APIs using native Java.

           

           

          2. It might happen that the external service (the one accessed through the Java method calls) for some reason rejects the call. In some of these cases I may want to retry the call, but in most cases I would not like to -- hence I would like set the MessageExchange's ExchangeStatus to ERROR (correct?). The ERROR state, as far as I've understood, is similar to the DONE state in the way the the communication is closed (correct?).

           

           

          To a certain, yes.

           

           

          Now to my actual second question:

           

           

          Did you forget to post the question?

          • 2. Re: Component servicemix-bean as a Binding Component: ERROR bouncing
            Roger Joelsson Novice

            Grmbl, my last question disappeared somehow...

             

            Anyway, what I wanted to know is how to handle the situation in which my Java call somehow is unsuccessful. Thus, I want to set the current MessageExchange to ERROR, but I also want to report the error to an external receiver via another Outbound Binding Component. One idea is to send a new message, containing the error message, to that Binding Component. Is that a feasible solution?

             

            Regards,

            Roger