synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiranya Jayathilaka <hiranya...@gmail.com>
Subject Re: Issue with switch on/off LoadBalance and FailOver endpoints from Jconsole
Date Sat, 05 Feb 2011 13:10:11 GMT
On Fri, Feb 4, 2011 at 9:30 AM, indika kumara <indika.kuma@gmail.com> wrote:

> More thoughts on the use of indirect endpoints. Just my personal view ...
>
> I think it is a rare usecase that a user wants to use the same endpoint
> instance in two different groups. It is like calling the same service from
> different endpoint groups.
>
> What he really wants is to improve the readability, maintainability and
> reuse of the synapse.xml. It is the same as a Java method (or any other)
> with a lot of codes. We usually refactor such a method by groping code into
> a set of methods. If we want to reuse a method (any other) across classes,
> then we parameterized the method (Here I am referring to the capabilty of
> passing parameters or arguments). The capability of parameterization for a
> language construct is powerful and allow a maximum reuse.
>
> Defining an endpoint in-lined with all details such as error handing, etc
> is equal to a make the code inside a method large. It is possible to become
> many information redundant except the endpoint URI. A current indirect
> endpoint can only support improving readability and maintainability. But, it
> can not support true reuse (avoiding redundant information, reuse across
> endpoints). A parameterized endpoint can support both. For instance, an
> endpoint definition with a URI which is given as a parameter and an indirect
> endpoint refer such as endpoint with the name of the EP and the URI as a
> parameter.
>

I think we already support this with the DefaultEndpoint.

Thanks,
Hiranya


>
> ~ Indika
>
>
> On Thu, Feb 3, 2011 at 10:59 PM, indika kumara <indika.kuma@gmail.com>wrote:
>
>> + 1
>>
>> BTW, why do we use indirect endpoints?  if it is for reuse then what are
>> the reusable elements - an endpoint definition, an runtime endpoint instance
>> or both?  what kind of reuse an end user expects?
>>
>> If the child endpoint of ST_Quote_LB1 get inactive due to failures, should
>> that cause to stop ST_Quote_FO1 working? if the the runtime instance is
>> reused, then I believe It would happen. But, if we expect to reuse only the
>> endpoint definition, it should not happen. And for the latter case, the
>> switchoff of ST_Quote_LB1 (including its children) would not affect any
>> other endpoint. So, if we expected the reuse of endpoint definition, then,
>> the current implementation of the indirect endpoint is wrong.
>>
>> ~ Indika
>>
>> On Thu, Feb 3, 2011 at 12:11 PM, Miyuru Wanninayaka <miyurudw@gmail.com>wrote:
>>
>>> Hi all,
>>>
>>> As current implementation of LoadBalance and FailOver endpoints, when we
>>> turned off LB/FO endpoint from jconsole, what really happens is all child
>>> endpoints of FO/LB endpoints gets switched off. I think this behavior is
>>> wrong. Since FO/LB endpoint has a context, it's possible to keep status in
>>> that context and handle in send() method of LB/OF endpoints without turning
>>> off child endpoints.
>>>
>>> Also in shared indirect endpoint situations like this:
>>>
>>>     <endpoint name="ST_Quote_LB1">
>>>         <loadbalance
>>> algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
>>>             <endpoint key="*SimpleStockQuoteService_EP*"/>
>>>         </loadbalance>
>>>     </endpoint>
>>>     <endpoint name="ST_Quote_FO1">
>>>         <failover>
>>>             <endpoint key="*SimpleStockQuoteService_EP*"/>
>>>         </failover>
>>>     </endpoint>
>>>     <endpoint name="*SimpleStockQuoteService_EP*">
>>>         <address uri="
>>> http://localhost:9000/services/SimpleStockQuoteService"/>
>>>     </endpoint>
>>>
>>> turning off ST_Quote_LB1 will cause ST_Quote_FO1 to stop working.
>>>
>>> Any ideas?
>>>
>>> --
>>> Miyuru Wanninayaka
>>> Software Engineer - WSO2 Inc <http://wso2.com/>.
>>>
>>
>>
>


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

Mime
View raw message