Hi Miyuru,

On Thu, Apr 29, 2010 at 5:44 PM, Miyuru <[email protected]> wrote:

> Hi all,
>
> This mail is regarding https://issues.apache.org/jira/browse/SYNAPSE-567.
> Currently when we defining leaf endpoints of loadbalance/failover endpoint
> we have to explicitly define full url of the endpoint.
> However in most loadbalance/failover scenarios endpoints are like
> {IP_X}:{PORT_A}/services/MyService
> {IP_Y}:{PORT_B}/services/MyService
> {IP_Z}:{PORT_C}/services/MyService
>
>  Proposed solution is, configure addresss endpoint like this
>
> <endpoint>
>     <address uri="https://localhost:8852/$INCOMING_URL_PATH";>
>     </address>
> </endpoint>
>
>
I'm not convinced that this approach makes it 'easier' to configure a load
balance endpoint. From the user perspective the user has to repeatedly
specify the string '$INCOMING_URL_PATH' in the address endpoints instead of
'services/MyService'.

And besides we currently have a very clean design for endpoints.They simply
represent EPRs to which messages can be sent to - and that's all they do.
IMO message processing logic such as URL rewriting should be done
separately. May be what we are looking for is a URL rewrite mediator which
can deal with regular expressions and URL rewrite rules. Such a mediator
should provide access to the segments of the original URL through
expressions such as ${host}, ${port}, ${path} etc. Then one can do a simple
URL rewrite as follows:

<URLRewrite expression="${protocol}://some.host:8080/${path}"/>
<send/>

Now this is a more generic thing that we can use anywhere in the Synapse
configuration (sequences, proxies etc).

Thanks,
Hiranya


> and replace path of the url ("services/MyService") with $INCOMING_URL_PATH.
> Is this a proper solution? Else we can upgrade default endpoint to rewrite
> address using regular expression which is more flexible solution.
>
> Any ideas?
>
> Thanks,
> --
> Miyuru Daminda Wanninayaka
> Software Engineer - WSO2 Inc.
>



-- 
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: [email protected];  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Reply via email to