Wednesday, July 11, 2012

Class Endpoints in Synapse

In Apache synapse, there are predefined endpoints , which can be used as service endpoints to send out the message from the mediation engine. Currently available endpoints are;
  • Address Endpoint
  • Default Endpoint 
  • WSDL endpoint
  • Load balance Endpoint 
  • Failover Endpoint 
  • Dynamic Load balance Endpoint

Anyway, Synapse does not support to extend the endpoint capability to add a custom endpoint according to the user needs as in mediators.(ie: class mediator)
To have such a feature, same like class mediator functionality, class endpoint concept has been implemented. The patch has been provided to the synapse project.

To add a class endpoint in the mediation flow, user should add following configuration;
<endpoint name="CustomEndpoint">
                    <class name="org.apache.synapse.endpoint.CustomEndpoint">
                                 <parameter name="foo">XYZ</parameter>*
                    </class>
</endpoint>
The "CustomEndpoint" class implementation should be the child class of the AbstractEndpoint class. Using this type of class endpoints, user can add his own message sending logic or can load a custom synapse environment for a particular endpoint.

Related post: http://vvratha.blogspot.com/2013/06/class-endpointssample.html

3 comments:

  1. Hi,

    this feature is very interesting for me. I would like to do a ws-discovery and policy intersection in a custom endpoint. I would like to use this kind of endpoint in wso2 esb.

    Is it possible to download the newly created classes anywhere, and integrate them into wso2 esb already? If yes, where can I find them (I couldn't locate them in synapse svn?).

    Could you provide me with details how I can use this endpoint in wso2 esb? Do I have to built esb from source or are there some extensible mechanisms?

    ReplyDelete
  2. This patch haven't been committed to synapse trunk yet.(Commiters will go through and commit)

    Yes, this is commited to wso2 branch.
    You can find it here[1]..
    If you want to directly try that with synapse, take the checkout and build the synapse.

    We plan to do our next wso2esb major release(V4.5.0) most probably at the end of august.(Which will contain this class endpoint feature)

    If you want to try that with wso2esb, yes you have to build the product, which may be difficult to you..You have to take the checkout from here and need to build everything in order..[2]

    [1]http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/dependencies/synapse/2.1.0-wso2v6/
    [2]http://svn.wso2.org/repos/wso2/carbon/

    ReplyDelete
  3. You can try with the following milestone esb pack
    http://svn.wso2.org/repos/wso2/people/miyuru/WSO2ESB-4.5.0-M3-DevBuild/

    ReplyDelete