Monday, August 13, 2012

OracleSOA Suite provides support for specifying multiple partner link endpoint Locations. This capability is useful for failover purposes if the first endpoint is down.
"endpointURI" is the property that we need to add in partner link reference to support multiple endpoint location.

e.g. <property name="endpointURI">endpoint</property>

Below is example partner link reference that supports multiple endpoint location.

<reference name="HelloWorld" ui:wsdlLocation="HelloWorld.wsdl">
    <interface.wsdl interface="http://xmlns.oracle.com/TestApplication/First/BPELProcess1#wsdl.interface(BPELProcess1)"/>
    <binding.ws port="http://xmlns.oracle.com/TestApplication/Second/BPELProcess1#wsdl.endpoint(bpelprocess1_client_ep/BPELProcess1_pt)"
                location="http://localhost:8001/soa-infra/services/default/First/bpelprocess1_client_ep?WSDL">
      <property name="endpointURI">http://localhost:8001/soa-infra/services/default/Second/bpelprocess1_client_ep</property>
    </binding.ws>
  </reference>

Location attribute in the binding.ws tag is default location for the partner link.

Endpoint inside “endpointURI” is the alternate endpoint URI.
e.g. <property name="endpointURI">http://localhost:8001/soa-infra/services/default/Second/bpelprocess1_client_ep</property>

I created two use cases to explain more on this. In first use case I have one alternate endpoint and in second one I have two alternate endpoints.

First Use case

We have 3 composites.

       1.)    TestComposite
       2.)   HelloWorld
       3.)   HelloWorldAlternate

TestComposite is calling HelloWorld composite but it should call HelloWorldAlternate composite which is alternate composite in case “HelloWorld” is down.

 Sample Partner Link reference

<reference name="HelloWorld" ui:wsdlLocation="HelloWorld.wsdl">
    <interface.wsdl interface="http://xmlns.oracle.com/TestApplication/HelloWorld/BPELProcess1#wsdl.interface(BPELProcess1)"/>
    <binding.ws port="http://xmlns.oracle.com/TestApplication/HelloWorld/BPELProcess1#wsdl.endpoint(bpelprocess1_client_ep/BPELProcess1_pt)"
                location="http://localhost:8001/soa-infra/services/default/HelloWorldAlternate/bpelprocess1_client_ep?WSDL">
      <property name="endpointURI">http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>
    </binding.ws>
  </reference>

 When both “HelloWorld” and “HelloWorldAlternate” composites are up then TestApplication will invoke “HelloWorld” partner link. That means it will take endpoint from “property”
o    <property name="endpointURI">http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>

           When HelloWorld is down then it will invoke “HelloWorldAlternate” partner link. That means it will take endpoint from location attribute of the binding.ws tag
o   location="http://localhost:8001/soa-infra/services/default/HelloWorldAlternate/bpelprocess1_client_ep?WSDL”

Second Use case

We can think about having more than one alternative endpoint for partner link.In this case we have 4 composite.

       1.)    TestComposite
       2.)   HelloWorld
       3.)   HelloWorldAlternate.
       4.)   HelloWorldSecondAlternate

TestComposite is calling HelloWorld composite but it should call HelloWorldAlternate or HelloWorldSecondAlternate composite which is alternate composite in case “HelloWorld” is down.

Sample Partner Link reference

<reference name="HelloWorld" ui:wsdlLocation="HelloWorld.wsdl">
    <interface.wsdl interface="http://xmlns.oracle.com/TestApplication/HelloWorld/BPELProcess1#wsdl.interface(BPELProcess1)"/>
    <binding.ws port="http://xmlns.oracle.com/TestApplication/HelloWorld/BPELProcess1#wsdl.endpoint(bpelprocess1_client_ep/BPELProcess1_pt)"
                location="http://localhost:8001/soa-infra/services/default/HelloWorldAlternate/bpelprocess1_client_ep?WSDL">
      <property name="endpointURI">http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>
    </binding.ws>
  </reference>

       When “HelloWorld”, “HelloWorldAlternate” and “HelloWorldSecondAlternate” is up then “TestApplication” will invoke “HelloWorld” partner link. That means it will take endpoint from second “property”
o    <property name="endpointURI">http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>
       When “HelloWorld” is down, “HelloWorldAlternate” and “HelloWorldSecondAlternate” is up then “TestApplication” will invoke “HelloWorldAlternate” partner link.
o    location="http://localhost:8001/soa-infra/services/default/HelloWorldAlternate/bpelprocess1_client_ep?WSDL”
       When “HelloWorld” is up, “HelloWorldAlternate” is up and “HelloWorldSecondAlternate” is down then “TestApplication” will invoke “HelloWorld” partner link.
o    <property name="endpointURI">http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>
       When “HelloWorld” is down, “HelloWorldAlternate” is up and “HelloWorldSecondAlternate” is down then “TestApplication” will invoke “HelloWorldAlternate” partner link.


Remember :Schema should be same for all the composites.



7 comments :

  1. how can I configure it to take "http://localhost:8001/soa-infra/services/default/HelloWorldSecondAlternate/bpelprocess1_client_ep" as default endpoint?.I need to override always the default enpoint.Setting endpointURI from invoke activity does not work in my case.

    Thanks in advance!
    FALCO

    ReplyDelete
    Replies
    1. Add below property at last (If you are using more than one property then you need to add below property at last, but if you have only one property then you can simple add this property) inside reference tag.

      http://localhost:8001/soa-infra/services/default/HelloWorldSecondAlternate/bpelprocess1_client_ep

      Vivek

      Delete
  2. Hi vivek,

    This is not regarding your post but a general thing. Could you please let me know where we use sequence activity in BPEL. Generally we have main and that it self is a sequence . I dont thik we would be needing a seperate sequence inside main. So where else would this be used.

    ReplyDelete
    Replies
    1. Sequence activity is used when we have requirement for certain activities to run in sequence. You need not to add sequence activity explicitly as when you add more than one activity under one section Jdeveloper itself add sequence activity.

      Delete
  3. Is this the same as dynamic partnerlink? Sry if its a lame question

    ReplyDelete
  4. I deployed two versions of bpel and tried routing from a caller process. I have shut down version 1 composite and used endpointURI to route to another composite. I am getting the following error.
    faultcode>env:Server
    Message Router for default/AddProcess!1.0*soa_89ad-4261-a4d4-f813a75e8fd2 is not able to process messages. The composite state is set to "off". The composite can be turned "on" by using the administrative consoles.


    <exception>Message Router for default/AddProcess!1.0*soa_89ad2f88-44ea-4261-a4d4-f813a75e8fd2 is not able to process messages. The composite state is set to "off". The composite can be turned "on" by using the administrative consoles.</exception>

    ReplyDelete
  5. Remember :Schema should be same for all the composites.

    Does this mean same name and namespace too?

    ReplyDelete