Hi Nipuni, Normally we are publishing event using org.wso2.carbon.databridge.agent.thrift.lb.LoadBalancingDataPublisher like this[1] and it worked without any problems.
And i'm not sure about this line[2] and it is special scenario. And i'm not had a chance to use that scenario. i'll try to use that scenario and monitor the outcome. [1] https://github.com/wso2/carbon-apimgt/blob/master/components/apimgt/org.wso2.carbon.apimgt.usage/org.wso2.carbon.apimgt.usage.publisher/src/main/java/org/wso2/carbon/apimgt/usage/publisher/APIMgtUsageDataBridgeDataPublisher.java#L122 [2] https://github.com/wso2/carbon-apimgt/blob/master/components/apimgt/org.wso2.carbon.apimgt.usage/org.wso2.carbon.apimgt.usage.publisher/src/main/java/org/wso2/carbon/apimgt/usage/publisher/APIMgtUsageHandler.java#L167 Thanks and Regards. On Fri, Nov 20, 2015 at 9:00 AM, Nipuni Perera <nip...@wso2.com> wrote: > Hi Sanjeewa, > > I checked the imports of the mentioned classes. As per my last reply " > org.wso2.carbon.tenant.usage.agent" is the artifact id while package name > is "org.wso2.carbon.usage.agent" (Note: no "tenant" part). So > org.wso2.carbon.tenant.usage.agent exports " > org.wso2.carbon.usage.agent.api" package only. > > And regarding publishing events, if APIM move to carbon-commons 4.5.0 > (which has API changes in data publishers), APIM stat publishing part may > need to implement from APIM side. (As carbon-multitenancy still use older > version of carbon-commons. Else we need to update carbon-multitenancy with > carbon-commons new version and rewrite data publishing part and export > required packages. (I am not sure about the recommended approach)). > > @Sameera/Kishanthan/Kalpa : Please share your thoughts on this. > > @Rukshan: Code may compile, but there can have runtime failures. Can we > test this scenario (publishing events) with APIM 1.10 to see if there are > any issues. > > Thanks, > Nipuni > > On Thu, Nov 19, 2015 at 8:57 PM, Sanjeewa Malalgoda <sanje...@wso2.com> > wrote: > >> >> >> On Thu, Nov 19, 2015 at 8:39 PM, Rukshan Premathunga <ruks...@wso2.com> >> wrote: >> >>> Hi, >>> >>> @Nipuni, we have compiling code at here[1] and there was no any issues. >>> >>> @Sanjeewa, we are moved from org.wso2.carbon.usage.agent to >>> org.wso2.carbon.tenant.usage.agent >>> right? Also, does it satisfied "DataPublisherUtil.isEnabledMetering()" at >>> here[2] and reached to here [1]? >>> >> Yes i missed that. However still we do have usage agent 2.1.2 dependency >> in root pom i thought still it was using. >> I think we need to remove it now. >> >> And if you carefully checked mentioned classes you can see following >> imports(it doesn't have org.wso2.carbon.tenant.usage.agent imports). >> >> import org.wso2.carbon.usage.agent.beans.APIManagerRequestStats; >> import org.wso2.carbon.usage.agent.util.PublisherUtils; >> >> So as i understood its using usage agent 2.1.2 in the build time(as it >> was there in root pom as dependency) and we don't get build failures. >> And as nipuni mentioned it should return run time error even if its build >> fine. >> >> Other question is if we don't have that publisher util class anymore what >> is the recommended implementation to publish events? >> Do we have already released implementation? >> >> Thanks, >> sanjeewa. >> >> >>> [1] >>> https://github.com/ruks/carbon-apimgt/blob/1.10.x.3/components/apimgt/org.wso2.carbon.apimgt.usage/org.wso2.carbon.apimgt.usage.publisher/src/main/java/org/wso2/carbon/apimgt/usage/publisher/APIMgtUsageHandler.java#L169 >>> [2] >>> https://github.com/ruks/carbon-apimgt/blob/1.10.x.3/components/apimgt/org.wso2.carbon.apimgt.usage/org.wso2.carbon.apimgt.usage.publisher/src/main/java/org/wso2/carbon/apimgt/usage/publisher/APIMgtUsageHandler.java#L162 >>> >>> Thanks and Regards. >>> >>> >>> >>> On Thu, Nov 19, 2015 at 8:03 PM, Nipuni Perera <nip...@wso2.com> wrote: >>> >>>> Hi all, >>>> >>>> I have listed the osgi bundles in a APIM-1.10 pack and could observe >>>> that (refer [1 for the result from osgi console]) it is using >>>> org.wso2.carbon.tenant.usage.agent_4.5.0. (which is release with >>>> carbon-multitenancy 4.5.0. I could not find a 2.1.2 jar from the osgi >>>> bundle list). >>>> According to the pom.xml in [2], all the pakcages in >>>> org.wso2.carbon.usage.agent >>>> has declared as private while only package org.wso2.carbon.usage.agent.api >>>> has exported. >>>> >>>> @Sanjeewa: As I have mentioned above the org.wso2. >>>> carbon.usage.agent.util.PublisherUtils class seems to be private and >>>> cannot use outside the bundle. If should give a runtime error while trying >>>> to publish events using APIMgtUsageHandler. >>>> @Amila : org.wso2.carbon.tenant.usage.agent is the artifact id and >>>> org.wso2.carbon.usage.agent is the package name. >>>> >>>> [1] osgi> ss | grep agent >>>> >>>> 215 ACTIVE org.wso2.carbon.databridge.agent.thrift_4.4.8 >>>> 289 ACTIVE org.wso2.carbon.identity.sso.agent_5.0.0 >>>> 446 ACTIVE org.wso2.carbon.tenant.throttling.agent_4.5.0 >>>> 447 ACTIVE org.wso2.carbon.tenant.usage.agent_4.5.0 >>>> 449 ACTIVE org.wso2.carbon.throttling.agent.stub_4.4.7 >>>> true >>>> osgi> >>>> osgi> >>>> osgi> >>>> osgi> ss | grep usage >>>> 189 ACTIVE org.wso2.carbon.apimgt.usage.client_4.3.1.SNAPSHOT >>>> 190 ACTIVE org.wso2.carbon.apimgt.usage.publisher_4.3.1.SNAPSHOT >>>> 447 ACTIVE org.wso2.carbon.tenant.usage.agent_4.5.0 >>>> >>>> >>>> [2] >>>> https://github.com/wso2/carbon-multitenancy/blob/v4.5.0/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/pom.xml >>>> >>>> Thanks, >>>> Nipuni >>>> >>>> On Thu, Nov 19, 2015 at 5:43 PM, Sanjeewa Malalgoda <sanje...@wso2.com> >>>> wrote: >>>> >>>>> In our APIMgtUsageHandler we use >>>>> publisherUtils(org.wso2.carbon.usage.agent.util.PublisherUtils) class to >>>>> publish events. >>>>> So we have dependency to org.wso2.carbon.usage.agent(2.1.2) jar. >>>>> At this point our commons version is 4.4.8 for APIM 1.10 release. >>>>> >>>>> So do you suggest to move commons 4.5.0 and use the publisher agent >>>>> available there? >>>>> >>>>> Thanks, >>>>> sanjeewa. >>>>> >>>>> On Thu, Nov 19, 2015 at 5:11 PM, Amila Maha Arachchi <ami...@wso2.com> >>>>> wrote: >>>>> >>>>>> Please check with Sanjeewa on whether APIM is using the old >>>>>> usage.agent component or is this a new one. I was under the impression >>>>>> that >>>>>> old agent is not used anywhere anymore. >>>>>> >>>>>> On Thu, Nov 19, 2015 at 4:58 PM, Rukshan Premathunga < >>>>>> ruks...@wso2.com> wrote: >>>>>> >>>>>>> Hi Amila, >>>>>>> >>>>>>> I think yes. I think both contain same package names. >>>>>>> >>>>>>> Thanks and Regards. >>>>>>> >>>>>>> On Thu, Nov 19, 2015 at 4:55 PM, Amila Maha Arachchi < >>>>>>> ami...@wso2.com> wrote: >>>>>>> >>>>>>>> Are org.wso2.carbon.usage.agent >>>>>>>> and org.wso2.carbon.tenant.usage.agent the same? >>>>>>>> >>>>>>>> On Thu, Nov 19, 2015 at 3:26 PM, Rukshan Premathunga < >>>>>>>> ruks...@wso2.com> wrote: >>>>>>>> >>>>>>>>> Hi Nipuni, >>>>>>>>> >>>>>>>>> APIM Still use the carbon-multitenancy like below. >>>>>>>>> >>>>>>>>> <dependency> >>>>>>>>> <groupId>org.wso2.carbon.multitenancy</groupId> >>>>>>>>> <artifactId>org.wso2.carbon.tenant.usage.agent</artifactId> >>>>>>>>> </dependency> >>>>>>>>> >>>>>>>>> can you lokking to this? >>>>>>>>> >>>>>>>>> >>>>>>>>> Thanks and Regards. >>>>>>>>> >>>>>>>>> On Thu, Nov 19, 2015 at 2:39 PM, Nipuni Perera <nip...@wso2.com> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi Amila, >>>>>>>>>> >>>>>>>>>> Thanks for the clarification. We are testing if products can use >>>>>>>>>> carbon-commons 4.5.0, without rewriting data publishers in >>>>>>>>>> carbon-deployment and carbon-multitenancy (as we don't have a >>>>>>>>>> requirement >>>>>>>>>> atm). Hence we will not updating usage.agent bundle in >>>>>>>>>> carbon-multitenancy >>>>>>>>>> as mentioned. >>>>>>>>>> We will consider removing the usage.agent bundle in future >>>>>>>>>> releases if it is not used anymore. >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Nipuni >>>>>>>>>> >>>>>>>>>> On Wed, Nov 18, 2015 at 7:25 PM, Amila Maha Arachchi < >>>>>>>>>> ami...@wso2.com> wrote: >>>>>>>>>> >>>>>>>>>>> Hi Nipuni, >>>>>>>>>>> >>>>>>>>>>> Those methods in usage.agent are not used now (not even the >>>>>>>>>>> usage.agent bundle). Ideally, we should get rid of the usage.agent >>>>>>>>>>> bundle. >>>>>>>>>>> These were used in the days of StratosLive. >>>>>>>>>>> >>>>>>>>>>> Regards, >>>>>>>>>>> Amila. >>>>>>>>>>> >>>>>>>>>>> On Tue, Nov 17, 2015 at 7:36 PM, Nipuni Perera <nip...@wso2.com> >>>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi, >>>>>>>>>>>> >>>>>>>>>>>> I am trying to update carbon-deployment with new data >>>>>>>>>>>> publishers introduced with carbon-commons 4.5.0 and >>>>>>>>>>>> carbon-analytics-common >>>>>>>>>>>> 5.0.6. I have rewritten the data publishers in carbon-deployment >>>>>>>>>>>> and need >>>>>>>>>>>> to test the changes with a AS pack, publishing >>>>>>>>>>>> webapp statistics. >>>>>>>>>>>> While building product-as I could see that >>>>>>>>>>>> carbon-multitenancy need to be updated with the new data >>>>>>>>>>>> publishers as >>>>>>>>>>>> well. I am working on updating carbon-multitenancy to use >>>>>>>>>>>> carbon-commons >>>>>>>>>>>> 4.5.0 and carbon-analytics-common 5.0.6. I am updating methods in >>>>>>>>>>>> : org.wso2.carbon.usage.agent.util.PublisherUtils. >>>>>>>>>>>> >>>>>>>>>>>> Will updating carbon-multitenancy a productive effort? Are we >>>>>>>>>>>> still using this utility methods to publish usage statistics? >>>>>>>>>>>> >>>>>>>>>>>> Thanks, >>>>>>>>>>>> Nipuni >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> Nipuni Perera >>>>>>>>>>>> Software Engineer; WSO2 Inc.; http://wso2.com >>>>>>>>>>>> Email: nip...@wso2.com >>>>>>>>>>>> Git hub profile: https://github.com/nipuni >>>>>>>>>>>> Blog : http://nipunipererablog.blogspot.com/ >>>>>>>>>>>> Mobile: +94 (71) 5626680 >>>>>>>>>>>> <http://wso2.com> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> *Amila Maharachchi* >>>>>>>>>>> Senior Technical Lead >>>>>>>>>>> WSO2, Inc.; http://wso2.com >>>>>>>>>>> >>>>>>>>>>> Blog: http://maharachchi.blogspot.com >>>>>>>>>>> Mobile: +94719371446 >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> Nipuni Perera >>>>>>>>>> Software Engineer; WSO2 Inc.; http://wso2.com >>>>>>>>>> Email: nip...@wso2.com >>>>>>>>>> Git hub profile: https://github.com/nipuni >>>>>>>>>> Blog : http://nipunipererablog.blogspot.com/ >>>>>>>>>> Mobile: +94 (71) 5626680 >>>>>>>>>> <http://wso2.com> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Dev mailing list >>>>>>>>>> Dev@wso2.org >>>>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Rukshan Chathuranga. >>>>>>>>> Software Engineer. >>>>>>>>> WSO2, Inc. >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> *Amila Maharachchi* >>>>>>>> Senior Technical Lead >>>>>>>> WSO2, Inc.; http://wso2.com >>>>>>>> >>>>>>>> Blog: http://maharachchi.blogspot.com >>>>>>>> Mobile: +94719371446 >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Rukshan Chathuranga. >>>>>>> Software Engineer. >>>>>>> WSO2, Inc. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> *Amila Maharachchi* >>>>>> Senior Technical Lead >>>>>> WSO2, Inc.; http://wso2.com >>>>>> >>>>>> Blog: http://maharachchi.blogspot.com >>>>>> Mobile: +94719371446 >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> *Sanjeewa Malalgoda* >>>>> WSO2 Inc. >>>>> Mobile : +94713068779 >>>>> >>>>> <http://sanjeewamalalgoda.blogspot.com/>blog >>>>> :http://sanjeewamalalgoda.blogspot.com/ >>>>> <http://sanjeewamalalgoda.blogspot.com/> >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Nipuni Perera >>>> Software Engineer; WSO2 Inc.; http://wso2.com >>>> Email: nip...@wso2.com >>>> Git hub profile: https://github.com/nipuni >>>> Blog : http://nipunipererablog.blogspot.com/ >>>> Mobile: +94 (71) 5626680 >>>> <http://wso2.com> >>>> >>>> >>> >>> >>> -- >>> Rukshan Chathuranga. >>> Software Engineer. >>> WSO2, Inc. >>> >> >> >> >> -- >> >> *Sanjeewa Malalgoda* >> WSO2 Inc. >> Mobile : +94713068779 >> >> <http://sanjeewamalalgoda.blogspot.com/>blog >> :http://sanjeewamalalgoda.blogspot.com/ >> <http://sanjeewamalalgoda.blogspot.com/> >> >> >> > > > -- > Nipuni Perera > Software Engineer; WSO2 Inc.; http://wso2.com > Email: nip...@wso2.com > Git hub profile: https://github.com/nipuni > Blog : http://nipunipererablog.blogspot.com/ > Mobile: +94 (71) 5626680 > <http://wso2.com> > > -- Rukshan Chathuranga. Software Engineer. WSO2, Inc.
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev