Return-Path: Delivered-To: apmail-synapse-dev-archive@www.apache.org Received: (qmail 79863 invoked from network); 6 Feb 2011 10:36:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Feb 2011 10:36:24 -0000 Received: (qmail 44599 invoked by uid 500); 6 Feb 2011 10:36:24 -0000 Delivered-To: apmail-synapse-dev-archive@synapse.apache.org Received: (qmail 44416 invoked by uid 500); 6 Feb 2011 10:36:22 -0000 Mailing-List: contact dev-help@synapse.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@synapse.apache.org Delivered-To: mailing list dev@synapse.apache.org Received: (qmail 44409 invoked by uid 99); 6 Feb 2011 10:36:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Feb 2011 10:36:21 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of indika.kuma@gmail.com designates 209.85.161.42 as permitted sender) Received: from [209.85.161.42] (HELO mail-fx0-f42.google.com) (209.85.161.42) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Feb 2011 10:36:14 +0000 Received: by fxm11 with SMTP id 11so5332707fxm.15 for ; Sun, 06 Feb 2011 02:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=XUgionF0w56yzKm42GT/XRv3YCcK0qT1x7KOhyDDLI4=; b=DLpHclcS85WYSpHcy+b+jdzN4wDThL/LP1JT0kPcUnuYL5ASR8051k6G0FiYC1eEOt AhvoSECCrEhfgJXBNBDQIEoKLgK0n6eKr+0sLctiWCnS1Mnolho4QIRgIC+dhWepR8Bq Ieu/+zOu2GCbe6E8hZ3ZHLxEb93dqSENVVlnE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WNNNdKcisGdugvrVxVXXDpUVJ4xZfsRz8UCqnE4uTlD0z+z16bvbzjrhL73GGgBdsg 3SyTyINzNMLRNDfFrrs/UF7K0+q03Cpkd8L3/9yfhM/NiE8GYNFo5JoFWikJGxF+knfa HnIprOdJOKxw/ENExnzKUhRG5jYtkeY08H7pA= MIME-Version: 1.0 Received: by 10.223.104.145 with SMTP id p17mr13532023fao.105.1296988554356; Sun, 06 Feb 2011 02:35:54 -0800 (PST) Received: by 10.223.97.4 with HTTP; Sun, 6 Feb 2011 02:35:54 -0800 (PST) In-Reply-To: References: Date: Sun, 6 Feb 2011 16:35:54 +0600 Message-ID: Subject: Re: Issue with switch on/off LoadBalance and FailOver endpoints from Jconsole From: indika kumara To: dev@synapse.apache.org Content-Type: multipart/alternative; boundary=001636c5b15b0f7903049b9aae07 X-Virus-Checked: Checked by ClamAV on apache.org --001636c5b15b0f7903049b9aae07 Content-Type: text/plain; charset=ISO-8859-1 Thanks Hiranya about information about default endpoint. Just to get informed. Does the default endpoint work only with dynamic address? Would it support a scenario where the user knows all the endpoint address and want to define those endpoints in a way that the redundancy is avoided. Ideally, he mostly wants to change the endpoint address but needs to reuse all other details such as error handling. Thanks, Indika On Sat, Feb 5, 2011 at 7:10 PM, Hiranya Jayathilaka wrote: > > > On Fri, Feb 4, 2011 at 9:30 AM, indika kumara 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 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 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: >>>> >>>> >>>> >>> algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin"> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>
>>>> >>>> >>>> turning off ST_Quote_LB1 will cause ST_Quote_FO1 to stop working. >>>> >>>> Any ideas? >>>> >>>> -- >>>> Miyuru Wanninayaka >>>> Software Engineer - WSO2 Inc . >>>> >>> >>> >> > > > -- > 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 > --001636c5b15b0f7903049b9aae07 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Thanks Hi= ranya about information about default endpoint.


Just to g= et informed. =A0Does the default endpoint work only= with dynamic address? =A0Would it support a scenario where the user knows all the endpoint address and want to define those endpoints in a way that the redundancy is avoided. Ideally, he mostly wants= to change the endpoint address but needs to reuse all other details such as er= ror handling.


Thanks,

Indika

On Sat, Feb 5, = 2011 at 7:10 PM, Hiranya Jayathilaka <hiranya911@gmail.com> wrote:


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 endpoi= nt instance in two different groups. It is like calling the same service fr= om 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) w= ith 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 p= assing parameters or arguments). The capability of parameterization for a l= anguage construct is powerful and allow a maximum reuse.

Defining an endpoint in-lined with all details such as error handing, e= tc is equal to a make the code inside a method large. It is possible to bec= ome many information redundant except the endpoint URI. A current indirect = endpoint can only support improving readability and maintainability. But, i= t can not support true reuse (avoiding redundant information, reuse across = endpoints). A parameterized endpoint can support both. For instance, an end= point definition with a URI which is given as a parameter and an indirect e= ndpoint refer such as endpoint with the name of the EP and the URI as a par= ameter.

I think we already support this with= the DefaultEndpoint.

Thanks,
Hiranya
=A0

~ Indika


= On Thu, Feb 3, 2011 at 10:59 PM, indika kumara <indika.kuma@gmail.com<= /a>> wrote:
+ 1

BTW, why do we use indirect endpoints?=A0 if it is for reuse the= n what are the reusable elements - an endpoint definition, an runtime endpo= int instance or both?=A0 what kind of reuse an end user expects?

If= the child endpoint of ST_Quote_LB1 get inactive due to failures, should th= at cause to stop ST_Quote_FO1 working? if the the runtime instance is reuse= d, then I believe It would happen. But, if we expect to reuse only the endp= oint definition, it should not happen. And for the latter case, the switcho= ff of ST_Quote_LB1 (including its children) would not affect any other endp= oint. So, if we expected the reuse of endpoint definition, then, the curren= t implementation of the indirect endpoint is wrong.

~ Indika

Hi all,

As current implementation of LoadBalance and FailOver endpoi= nts, when we turned off LB/FO endpoint from jconsole, what really happens i= s all child endpoints of FO/LB endpoints gets switched off. I think this be= havior is wrong. Since FO/LB endpoint has a context, it's possible to k= eep status in that context and handle in send() method of LB/OF endpoints w= ithout turning off child endpoints.

Also in shared indirect endpoint situations like this:

=A0=A0=A0= <endpoint name=3D"ST_Quote_LB1">
=A0=A0=A0=A0=A0=A0=A0 = <loadbalance algorithm=3D"org.apache.synapse.endpoints.algorithms.R= oundRobin">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <endpoint key=3D"SimpleStockQu= oteService_EP"/>
=A0=A0=A0=A0=A0=A0=A0 </loadbalance><= br>=A0=A0=A0 </endpoint>
=A0=A0=A0 <endpoint name=3D"ST_Qu= ote_FO1">
=A0=A0=A0=A0=A0=A0=A0 <failover>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <endpoint key=3D"SimpleStockQu= oteService_EP"/>
=A0=A0=A0=A0=A0=A0=A0 </failover>
= =A0=A0=A0 </endpoint>
=A0=A0=A0 <endpoint name=3D"Simpl= eStockQuoteService_EP">
=A0=A0=A0=A0=A0=A0=A0 <address ur= i=3D"http://localhost:9000/services/SimpleStockQuoteService<= /a>"/>
=A0=A0=A0 </endpoint>

turning off ST_Quote_LB1 will cause ST_Q= uote_FO1 to stop working.

Any ideas?

--
Miyuru Wanninayaka
Software Engineer -
WSO2 Inc.





-- Hiranya Jayathilaka
Senior Software Engineer;

WSO2= Inc.;=A0 http://wso2.org=
E-mail: hiranya@wso2.= com;=A0 Mobile: +94 77 633 3491
Blog: h= ttp://techfeast-hiranya.blogspot.com

--001636c5b15b0f7903049b9aae07--