6 Replies Latest reply on Dec 10, 2012 9:00 AM by objectiser

    Some questions on ESB and BPEL usage

    andi.scharfstein

      As a software engineer without substantial integration experiences, I'm currently having a hard time wrapping my head around the bird's eye view of how my target architecture is supposed to look like in a real-world setting. I would be very grateful if somebody could check my current thinking on this and provide some input.

       

      My goal is to get a prototypical usage scenario up and running so I have touched all the components at least once. The scenario itself is somewhat simple: I want to model a business process where a few services are chained in a sequence to establish some metadata on a file, do some transformation on that data and lastly store file and metadata in an internal database.

       

      I am currently under the impression that this business process should be coordinated using BPEL. Is that correct, or would another technology be better suited to that kind of problem?

       

      Working from the premise that BPEL would the correct tool to use, I am faced with the problem of how to interface with the web services. If I were to use a standalone BPEL engine, I could enter those as partner links and talk directly to the services. Obviously that's not the way to go, instead I want to have SwitchYard handle the messaging. So how do the BPEL engine (the embedded RiftSaw in this particular case) and the ESB runtime communicate?

       

      Perusing the documentation, the examples given there and with the quickstarts seem to indicate that you have to invoke those services again by going through partner links. However, I am unclear on the precise definition of these links. Am I supposed to address the remote services as I would in the standalone BPEL case, or can I only enter services provided by SwitchYard if I want to get the ESB runtime involved? If it's the latter, am I correct in thinking that I would have to mirror in my ESB configuration the public API of the services I want to consume from the BPEL process? If it's the former, in what way are the messages routed through the SwitchYard ESB, i.e. where do I configure the exact way to access the web services?

       

      Sorry for these newbie questions, I have tried long and hard to get them answered by looking at the documentation and previous forum posts, but have not been able to turn up something useful. Thanks in advance for any and all answers!

        • 1. Re: Some questions on ESB and BPEL usage
          objectiser

          Hi Andi

           

          Whether or not BPEL is right for your use case is difficult to answer. Generally I would say that BPEL is useful when you need to do fairly straightforward coordination of web services. So for example, if you had a number of web services deployed within your organisation, then you could define a BPEL process to orchestrate these, and within the switchyard descriptor define those external services as references with WSDL bindings.

           

          However when dealing with services that may be all running within the same ESB, this could also be overkill, as it requires the specification of interfaces using WSDL as well as the additional definitions (such as partner links).

           

          So to answer your question - the embedded BPEL engine (riftsaw) can only invoke services (or references to external services) exposed within the ESB using a WSDL interface. If you look at the bpel-service/loan_approval example you can see that the reference for the risk-assessment service which is consumed by the loan service, is represented by a WSDL interface.

           

          Hope this helps.

           

          Regards

          Gary

          1 of 1 people found this helpful
          • 2. Re: Some questions on ESB and BPEL usage
            kcbabo

            +1 on what Gary said.  BPEL will work nicely if you are familiar/comfortable with BPEL and the integration points are web services.  Given the scenario you described above, possible alternatives would include using a Camel routing service or a BPMN 2 service.

            • 3. Re: Some questions on ESB and BPEL usage
              andi.scharfstein

              This clears up one confusion for me, thanks - it seems that BPEL is indeed the right tool for the job. Keith, thank you though for the pointers to possible alternatives

               

              What I still don't quite get is the partner linking issue. The loan_approval is a good example - the consumed risk assessment service is defined by its WSDL, which states:

               

              <wsdl:service name="riskAssessor">
                   <wsdl:port name="riskAssessor_Port" binding="tns:riskAssessor_Binding">
                        <soap:address location="http://127.0.0.1:8080/Quickstart_bpel_loan_approval/RiskAssessment" />
                   </wsdl:port>
              </wsdl:service>
              

               

              So we are referencing a remote service that happens to be deployed on localhost. Now my question is, what benefit do I get by using SwitchYard to host the BPEL engine? Are the messages sent to the remote service routed through the ESB runtime, or what? If they are, why do I have to reference the remote WSDL instead of the SY SCA component, and how can I control routing in this case? If the messages aren't sent by SY, couldn't I run the BPEL using a dedicated BPEL engine such as Apache ODE to achieve the same result? Basically, I don't see how RiftSaw and SwitchYard actually interact in this scenario, if at all.

               

              Sorry again if these are stupid questions, I'm really very new to this field.

              • 4. Re: Some questions on ESB and BPEL usage
                objectiser

                Hi Andi

                 

                Don't worry, these aren't stupid questions. I think the example is slightly misleading as the WSDL definitions still have soap binding/address details.

                 

                When the BPEL process definition is deployed in switchyard, it is not exposed as a web service, but as a switchyard service. So if you want it to be provided as a web service, then you would use a SwitchYard SOAP binding to present the Web service interface externally.

                 

                The same applies to partner links defined in the BPEL process definition - although they are associated with a WSDL definition, those externally consumed services are not actually represented by a SOAP/WS endpoint. They communicate to a SwitchYard Service Reference, which is associated with the WSDL definition, but only in an abstract way, i.e. the WSDL is purely there to define the interface/contract.

                 

                So the soap:address in this case is misleading - all messages are routed through SwitchYard, so think of the BPEL engine as being embedded within it.

                 

                Regards

                Gary

                • 5. Re: Some questions on ESB and BPEL usage
                  andi.scharfstein

                  Hi Gary,

                  thanks a lot for your answer, that's really helpful to know

                   

                  Just one more question: If the WSDL definitions are associated with SwitchYard Service References, where does the magic happen? That is to say, what configuration entries are used to establish this mapping?

                  • 6. Re: Some questions on ESB and BPEL usage
                    objectiser

                    Hi Andi

                     

                    Its just based on the port type - so the port type defined by the partner link type matches with the port type defined on the service reference's wsdl interface.

                     

                    Regards

                    Gary

                    1 of 1 people found this helpful