On Mon, Mar 13, 2017 at 2:07 AM, Fazlan Nazeem <[email protected]> wrote:

> Hi,
>
> According to the generated code, we are implementing Microservice
> Interface for each of the currently listed microservice. I assume because
> of this each of these class is considered as a separate microservice. This
> results in a large microservice count.
>
> @Sanjeewa,
> Could we use an Application class and create a MicroserviceRunner(3
> instances, each for publisher,store and admin) instance and deploy each of
> those granular level apis(i.e APIsAPI, ApplicationsApi) via the Runner to
> achieve what Abimaran is proposing? I assume this way we don't have to
> implement Microservice interface. We used to do this in the beginning stage
> of C5 implementation, but we moved away for some reason.
>

In the beginning, the Application class was used for fatjar mode. I'm not
sure if we can do the same in osgi mode.

[+Thusitha]

Thanks,
Bhathiya


>
>
> On Mon, Mar 13, 2017 at 12:04 PM, Abimaran Kugathasan <[email protected]>
> wrote:
>
>> Hi Sanjeewa,
>>
>>
>> On Mon, Mar 13, 2017 at 11:55 AM, Sanjeewa Malalgoda <[email protected]>
>> wrote:
>>
>>> Yes azeez we can change it if need. If need we can get all services into
>>> one service class by having same tag for all resources defined within
>>> swagger definition then it will create only one service class for all paths
>>> defined. But i believe having different service classes for different
>>> service is more cleaner than having all in one service class.
>>>
>>
>>
>> My worry is, why we need to create separate micro service instance for
>> each path defined, not about having separate class for each service.
>>
>> Can we have separate class and one service? Like one micro service per
>> context, but separate classes for each path?
>>
>>
>>>
>>> Thanks,
>>> sanjeewa.
>>>
>>> On Sun, Mar 12, 2017 at 6:27 AM, Afkham Azeez <[email protected]> wrote:
>>>
>>>> This should be something to do with Swagger to MSF4J generation, right
>>>> Sanjeewa?
>>>>
>>>> On Thu, Mar 9, 2017 at 1:05 PM, Abimaran Kugathasan <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> Currently, for each path defined in swagger yaml, MSF4J creates new
>>>>> micro service. This leads increasing memory consumption, booting up time.
>>>>>
>>>>> If I gave the real stats, for API Manager 3.0, initial booting time
>>>>> was lesser than 2 seconds with 4 micro services, after adding more REST 
>>>>> API
>>>>> paths (for the same swagger ymal definition), the booting time was
>>>>> increased to 6.1 seconds. Following micro-services are defined at the
>>>>> moment in API Manager which will grow in future.
>>>>>
>>>>>
>>>>> [2017-03-09 12:44:43,399]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.keymana
>>>>> ger.KeymanagerService@566ffc20
>>>>> [2017-03-09 12:44:43,405]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.keymana
>>>>> ger.KeymanagerService@566ffc20
>>>>> [2017-03-09 12:44:43,436]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.admin.PoliciesApi@3868a733
>>>>> [2017-03-09 12:44:43,463]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.admin.PoliciesApi@3868a733
>>>>> [2017-03-09 12:44:43,578]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.ApisApi@3d75ed80
>>>>> [2017-03-09 12:44:43,642]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.ApisApi@3d75ed80
>>>>> [2017-03-09 12:44:43,701]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.ApplicationsApi@516acba6
>>>>> [2017-03-09 12:44:43,740]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.ApplicationsApi@516acba6
>>>>> [2017-03-09 12:44:43,776]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.EndpointsApi@52efb978
>>>>> [2017-03-09 12:44:43,808]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.EndpointsApi@52efb978
>>>>> [2017-03-09 12:44:43,838]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.EnvironmentsApi@55df6f78
>>>>> [2017-03-09 12:44:43,869]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.EnvironmentsApi@55df6f78
>>>>> [2017-03-09 12:44:43,916]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.LabelsApi@986a887
>>>>> [2017-03-09 12:44:43,956]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.LabelsApi@986a887
>>>>> [2017-03-09 12:44:43,991]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.PoliciesApi@18cb6f74
>>>>> [2017-03-09 12:44:44,029]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.PoliciesApi@18cb6f74
>>>>> [2017-03-09 12:44:44,071]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.SubscriptionsApi@3740316c
>>>>> [2017-03-09 12:44:44,109]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.publisher.SubscriptionsApi@3740316c
>>>>> [2017-03-09 12:44:44,151]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.ApisApi@19ca2c53
>>>>> [2017-03-09 12:44:44,194]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.ApisApi@19ca2c53
>>>>> [2017-03-09 12:44:44,244]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.ApplicationsApi@66c70660
>>>>> [2017-03-09 12:44:44,290]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.ApplicationsApi@66c70660
>>>>> [2017-03-09 12:44:44,339]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.PoliciesApi@50ba8085
>>>>> [2017-03-09 12:44:44,380]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.PoliciesApi@50ba8085
>>>>> [2017-03-09 12:44:44,424]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.SubscriptionsApi@18da9675
>>>>> [2017-03-09 12:44:44,474]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.SubscriptionsApi@18da9675
>>>>> [2017-03-09 12:44:44,525]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.TagsApi@1e835f96
>>>>> [2017-03-09 12:44:44,573]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.apimgt.rest.ap
>>>>> i.store.TagsApi@1e835f96
>>>>> [2017-03-09 12:44:44,843]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesServerSC}
>>>>> - All microservices are available
>>>>> [2017-03-09 12:44:44,844]  INFO {org.wso2.carbon.transport.htt
>>>>> p.netty.internal.NettyTransportServiceComponent} - All
>>>>> CarbonNettyServerInitializers are available
>>>>> [2017-03-09 12:44:44,856]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.uuf.httpconnec
>>>>> tor.msf4j.UUFMicroservice@1a3c0a9c
>>>>> [2017-03-09 12:44:44,856]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.uuf.httpconnec
>>>>> tor.msf4j.UUFMicroservice@1a3c0a9c
>>>>> [2017-03-09 12:44:44,857]  WARN {org.wso2.carbon.kernel.intern
>>>>> al.startupresolver.StartupComponentManager} - You are trying to add
>>>>> an available capability org.wso2.msf4j.Microservice from
>>>>> bundle(org.wso2.carbon.uuf.httpconnector.msf4j:1.0.0.m13) to an
>>>>> already activated startup listener component wso2-microservices-server in
>>>>> bundle(msf4j-core:2.1.1). Refer the Startup Order Resolver documentation
>>>>> and validated your configuration
>>>>> [2017-03-09 12:44:44,857]  INFO {org.wso2.carbon.uuf.httpconne
>>>>> ctor.msf4j.internal.MSF4JHttpConnector} - UUF app '
>>>>> org.wso2.carbon.apimgt.web.store' is available at '/store'.
>>>>> [2017-03-09 12:44:44,859]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.uuf.httpconnec
>>>>> tor.msf4j.UUFMicroservice@3178a583
>>>>> [2017-03-09 12:44:44,859]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.uuf.httpconnec
>>>>> tor.msf4j.UUFMicroservice@3178a583
>>>>> [2017-03-09 12:44:44,859]  WARN {org.wso2.carbon.kernel.intern
>>>>> al.startupresolver.StartupComponentManager} - You are trying to add
>>>>> an available capability org.wso2.msf4j.Microservice from
>>>>> bundle(org.wso2.carbon.uuf.httpconnector.msf4j:1.0.0.m13) to an
>>>>> already activated startup listener component wso2-microservices-server in
>>>>> bundle(msf4j-core:2.1.1). Refer the Startup Order Resolver documentation
>>>>> and validated your configuration
>>>>> [2017-03-09 12:44:44,860]  INFO {org.wso2.carbon.uuf.httpconne
>>>>> ctor.msf4j.internal.MSF4JHttpConnector} - UUF app
>>>>> 'org.wso2.carbon.apimgt.web.publisher' is available at '/publisher'.
>>>>> [2017-03-09 12:44:44,861]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.uuf.httpconnec
>>>>> tor.msf4j.UUFMicroservice@2d9caac3
>>>>> [2017-03-09 12:44:44,861]  INFO 
>>>>> {org.wso2.msf4j.internal.MicroservicesRegistryImpl}
>>>>> - Added microservice: org.wso2.carbon.uuf.httpconnec
>>>>> tor.msf4j.UUFMicroservice@2d9caac3
>>>>>
>>>>> Do we really need to create new micro service for each path? What's
>>>>> the reason behind this?
>>>>>
>>>>> Some of the services below can be combined to one, for example
>>>>> org.wso2.carbon.apimgt.rest.api.publisher.ApisApi,
>>>>> org.wso2.carbon.apimgt.rest.api.publisher.ApplicationsApi,
>>>>> org.wso2.carbon.apimgt.rest.api.publisher.EndpointsApi,
>>>>> org.wso2.carbon.apimgt.rest.api.publisher.EnvironmentsApi,
>>>>> org.wso2.carbon.apimgt.rest.api.publisher.LabelsApi,
>>>>> org.wso2.carbon.apimgt.rest.api.publisher.SubscriptionsApi can be
>>>>> combined to one micro service, since they can be functionally categorized
>>>>> together as publisher micro service.
>>>>>
>>>>> org.wso2.carbon.apimgt.rest.api.store.ApisApi,
>>>>> org.wso2.carbon.apimgt.rest.api.store.ApplicationsApi,
>>>>> org.wso2.carbon.apimgt.rest.api.store.PoliciesApi,
>>>>> org.wso2.carbon.apimgt.rest.api.store.SubscriptionsApi,
>>>>> org.wso2.carbon.apimgt.rest.api.store.TagsApi can be combined to one
>>>>> micro service, since they can be functionally categorized together as 
>>>>> store
>>>>> micro service.
>>>>>
>>>>> Also, we need to eliminate micro service on which runs on HTTP and
>>>>> need to have only HTTPs as default. If someone needs to serve through 
>>>>> HTTP,
>>>>> they can enable through a configuration.
>>>>>
>>>>> Your responses are much appreciated.
>>>>>
>>>>> --
>>>>> Thanks
>>>>> Abimaran Kugathasan
>>>>> Senior Software Engineer - API Technologies
>>>>>
>>>>> Email : [email protected]
>>>>> Mobile : +94 773922820 <077%20392%202820>
>>>>>
>>>>> <http://stackoverflow.com/users/515034>
>>>>> <http://lk.linkedin.com/in/abimaran>
>>>>> <http://www.lkabimaran.blogspot.com/>  <https://github.com/abimarank>
>>>>> <https://twitter.com/abimaran>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Afkham Azeez*
>>>> Senior Director, Platform Architecture; WSO2, Inc.; http://wso2.com
>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>> * <http://www.apache.org/>*
>>>> *email: **[email protected]* <[email protected]>
>>>> * cell: +94 77 3320919 <077%20332%200919>blog: *
>>>> *http://blog.afkham.org* <http://blog.afkham.org>
>>>> *twitter: **http://twitter.com/afkham_azeez*
>>>> <http://twitter.com/afkham_azeez>
>>>> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
>>>> <http://lk.linkedin.com/in/afkhamazeez>*
>>>>
>>>> *Lean . Enterprise . Middleware*
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> *Sanjeewa Malalgoda*
>>> WSO2 Inc.
>>> Mobile : +94713068779 <+94%2071%20306%208779>
>>>
>>> <http://sanjeewamalalgoda.blogspot.com/>blog
>>> :http://sanjeewamalalgoda.blogspot.com/
>>> <http://sanjeewamalalgoda.blogspot.com/>
>>>
>>>
>>>
>>
>>
>> --
>> Thanks
>> Abimaran Kugathasan
>> Senior Software Engineer - API Technologies
>>
>> Email : [email protected]
>> Mobile : +94 773922820 <+94%2077%20392%202820>
>>
>> <http://stackoverflow.com/users/515034>
>> <http://lk.linkedin.com/in/abimaran>
>> <http://www.lkabimaran.blogspot.com/>  <https://github.com/abimarank>
>> <https://twitter.com/abimaran>
>>
>>
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> Thanks & Regards,
>
> Fazlan Nazeem
>
> *Software Engineer*
>
> *WSO2 Inc*
> Mobile : +94772338839
> <%2B94%20%280%29%20773%20451194>
> [email protected]
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
*Bhathiya Jayasekara*
*Senior Software Engineer,*
*WSO2 inc., http://wso2.com <http://wso2.com>*

*Phone: +94715478185*
*LinkedIn: http://www.linkedin.com/in/bhathiyaj
<http://www.linkedin.com/in/bhathiyaj>*
*Twitter: https://twitter.com/bhathiyax <https://twitter.com/bhathiyax>*
*Blog: http://movingaheadblog.blogspot.com
<http://movingaheadblog.blogspot.com/>*
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to