Hi Lakmal,

Why is polling better than having a Topology listener?

thanks,
dimuthu

On Fri, Oct 10, 2014 at 10:18 AM, Lakmal Warusawithana <[email protected]>
wrote:

> Hi Roshan,
>
> On Thu, Oct 9, 2014 at 10:12 PM, Roshan Deniyage <[email protected]> wrote:
>
>> * Adding the missing images.*
>>
>> Hi All,
>>
>> Currently I’m working with php application type support for wso2
>> appfactory product. The scenario is as follows,
>>
>> Multi-Tenant Cartridge Case
>>
>> The existing supported application types (ex: java web application) work
>> with in-container multi-tenancy support which means those applications run
>> inside wso2 application server, deployed inside one cartridge instance of
>> stratos (of course with many for clustering).
>>
>> Based on the current “dev setup” and “production deployment”, when new
>> tenant is created with app factory, relevant tenant is created in the
>> wso2-as of the shared cartridge instance illustrated as follows.
>>
>> The sample is for dev cloud without LB. (same as dev setup). The
>> cartridge instance could be spawned before tenant is created. Hence, the
>> “Public IP address” or the “DNS name” is know.
>> [image: Inline image 1]
>>
>> ​
>>
>>
>> Single Tenant Cartridge Case
>>
>> But, in the “php application type” case, no multi-tenant cartridges are
>> there, we have to use single tenant cartridges with “apache http server”.
>> In this case, Need to spawn a new instance when a new tenant is created.
>> The workflow would be as follows.
>>
>> ​[image: Inline image 2]
>>
>>
>>
>> Generating Application URL of Single Tenant Application Types
>>
>> But the problem in single-tenant case is, the Public IP or the DNS name
>> of the newly spawned cartridge is unknow. Or in case of clustering, the
>> Public IP or the DNS name of the LB is unknow. Hence, In order to get the
>> Public IP of entry point, I propose the following workflow.
>> ​
>> [image: Inline image 3]​
>>
>>
>> The purpose of this design is to get the “Public IP of DNS Name” of the
>> newly spawned cartridge or the LB of the cartridge cluster (If cluster is
>> present). The logic is as follows,
>>
>>    1.
>>
>>    When server is started App-Fac’s “StratosMemberActivated Listener” is
>>    subscribed to topic in active mq.
>>    2.
>>
>>    Tenant user create new single tenant type application.
>>    3.
>>
>>    App-Fac do the necessary logic and then, subscribed to new cartridge
>>    via stratos controller.
>>    4.
>>
>>    When cartridge is spawning it sends events to topic in active mq and
>>    when cartridge is activated, it send the “MemberActivated Event” to the
>>    topic.
>>    5.
>>
>>    App-Fac receives the “MemberActivated Event” and get the “Public IP”
>>    of the cartridge or the LB.
>>    6.
>>
>>    App-Fac generates the “Application URL” using received public IP and
>>    store in the registry.
>>    7.
>>
>>    When user request the “Application URL” of the newly created
>>    application, App-Fac get the url from registry.
>>
>>
>>
>> In this feature, upto figure :02 is already done and the application url
>> generation has designed based on the figure: 03.
>>
>> NOTE : In order to get the cartridge’s Public IP or DNS name (or LB
>> Public IP if clustering is present), there are 3 options.
>>
>>
>>    1.
>>
>>    Subscribe to topic in stratos and get the relevant information.
>>    2.
>>
>>    Stratos can provide a REST API and app-fac can pool to get the
>>    information.
>>    3.
>>
>>    Cartridge agent can be modified to send information to provided url
>>    of app-fac.
>>
>>
>> From above 3 approaches, the first one is selected.
>>
>> I expect your valuable comment on this design and approach to generate
>> url of the applications deployed with single tenant cartridges, Any comment
>> would be appreciated.
>>
>
>
> I would like to propose go with option #2. Because this is a valid
> scenario for external users. Without implementing AppF specific code, you
> can provide propose enhancement to apache Stratos code based.  Please send
> a pull request.
>
>
>>
>> Thanks,
>>
>>
>> Roshan Deniyage
>> Associate Technical Lead
>> WSO2, Inc: http://wso2.com
>>
>> Mobile    :  +94 777636406
>> Twitter    :  *https://twitter.com/roshku <https://twitter.com/roshku>*
>> LinkedIn :  https://www.linkedin.com/in/roshandeniyage
>>
>>
>>
>>
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> Lakmal Warusawithana
> Vice President, Apache Stratos
> Director - Cloud Architecture; WSO2 Inc.
> Mobile : +94714289692
> Blog : http://lakmalsview.blogspot.com/
>
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
Dimuthu Leelarathne
Architect & Product Lead of App Factory

WSO2, Inc. (http://wso2.com)
email: [email protected]
Mobile : 0773661935

Lean . Enterprise . Middleware
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to