I think what is trying to be achieved here is to iterate through all existing versions of a given API and subscribe to all applications that those API versions have subscribed to in the latest version.
For example, *foo:1.0.0* is subscribed to by *Application1* and *foo:2.0.0* is subscribed to by *Application2*. So with current logic *foo:3.0.0* will be subscribed to by both *Application1* and *Application2*. The problem is when both* foo:1.0.0* and *foo:2.0.0* are subscribed to *Application1*.Then when publishing *foo:3.0.0 *we get the "Subscription Already Exists" exception thrown in the JIRA ticket. Instead of blindly trying to insert and triggering the exception we can check to see if there is already an entry for a given ApiID, ApplicationID and TierID in the AM_SUBSCRIPTION table. If there is already(as we can see in the above example which is valid) then we simply should not add the subscription. No rxt or DB changes needed, WDYT? On 22 July 2015 at 13:56, Nuwan Dias <[email protected]> wrote: > Adding this to the rxt is the correct way IMO. But we have to be careful > when fixing this for API Manager 1.9.1. We cannot do migrations for 1.9.1. > Hence cannot introduce rxt changes. Since the error trace is harmless, I > think we should comment and ignore the error for 1.9.1 and make it a point > to fix properly in 1.10. > > Thanks, > NuwanD. > > On Wed, Jul 22, 2015 at 1:54 PM, Sanjeewa Malalgoda <[email protected]> > wrote: > >> Adding new field to rxt would be ideal IMO. I noticed some users already >> reported this issue. >> >> Thanks, >> sanjeewa. >> >> On Wed, Jul 22, 2015 at 1:00 PM, Ruwan Abeykoon <[email protected]> wrote: >> >>> Hi Uvindra, >>> What if we keep the "parent" apiID in the asset itself, rather than in >>> new DB column. (by adding the field to api.rxt) >>> >>> Cheers, >>> Ruwan >>> >>> On Wed, Jul 22, 2015 at 12:44 PM, Uvindra Dias Jayasinha < >>> [email protected]> wrote: >>> >>>> The correct way I can think of solving this is to store the apiID of >>>> the version that is being copied from in the newly created api object so >>>> that we can make the association later on when we are publishing the new >>>> api version. >>>> >>>> This means we will need to add a new column to the AM_API table to >>>> store this, hence Im trying to see if there is an alternative. >>>> >>>> >>>> >>>> On 22 July 2015 at 12:38, Uvindra Dias Jayasinha <[email protected]> >>>> wrote: >>>> >>>>> Thanks for the suggestion Ruwan, but we are not on ES yet and wont be >>>>> for sometime so we wont be able to exploit that feature. >>>>> >>>>> On 22 July 2015 at 12:32, Ruwan Abeykoon <[email protected]> wrote: >>>>> >>>>>> Hi Uvindra, >>>>>> We are having same issue and being solved in AppM 1.1.0. We were >>>>>> informed that ES 2.0 has grouping capability. So we may be exploit that >>>>>> to >>>>>> correlate versions. We plan to back-port some ES 2.0 functions to ES 1 >>>>>> branch to get this done. >>>>>> >>>>>> SajithAR working on this. >>>>>> >>>>>> Cheers, >>>>>> Ruwan >>>>>> >>>>>> >>>>>> On Wed, Jul 22, 2015 at 12:21 PM, Uvindra Dias Jayasinha < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> This applies to API Manager 1.9.0, but this is true for previous >>>>>>> versions as well. When trying to fix the following ticket[1] I came >>>>>>> across >>>>>>> this scenario, >>>>>>> >>>>>>> 1. API named *"foo"* with versions *"1.0.0"* and *"2.0.0"* has >>>>>>> existing subscriptions. >>>>>>> 2. Create a new version of the same API *"3.0.0"* from *"2.0.0"*. >>>>>>> 3. Publish API *"foo:3.0.0"* with the "Require Re-Subscription" >>>>>>> option disabled. >>>>>>> 4. What should happen is that the subscriptions of *"foo:2.0.0"* >>>>>>> should be applied to *"foo:3.0.0" *automatically >>>>>>> >>>>>>> >>>>>>> The problem is step *2 *and *3* above are separate so there is >>>>>>> currently no association between *"foo:2.0.0"* and *"foo:3.0.0"*. >>>>>>> >>>>>>> So how do we determine which API version *"foo:3.0.0"* was created >>>>>>> from so that we can transfer that APIs subscriptions at the time of >>>>>>> publishing? >>>>>>> >>>>>>> Is there a way to do this without adding a new attribute to the >>>>>>> newly created API to indicate whihc version it was copied from? >>>>>>> >>>>>>> [1] https://wso2.org/jira/browse/APIMANAGER-3971 >>>>>>> -- >>>>>>> Regards, >>>>>>> Uvindra >>>>>>> >>>>>>> Mobile: 777733962 >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Dev mailing list >>>>>>> [email protected] >>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> *Ruwan Abeykoon* >>>>>> *Architect,* >>>>>> *WSO2, Inc. http://wso2.com <http://wso2.com/> * >>>>>> *lean.enterprise.middleware.* >>>>>> >>>>>> email: [email protected] >>>>>> phone:(+94) 777739736 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Regards, >>>>> Uvindra >>>>> >>>>> Mobile: 777733962 >>>>> >>>> >>>> >>>> >>>> -- >>>> Regards, >>>> Uvindra >>>> >>>> Mobile: 777733962 >>>> >>>> _______________________________________________ >>>> Dev mailing list >>>> [email protected] >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>>> >>> >>> >>> -- >>> >>> *Ruwan Abeykoon* >>> *Architect,* >>> *WSO2, Inc. http://wso2.com <http://wso2.com/> * >>> *lean.enterprise.middleware.* >>> >>> email: [email protected] >>> phone:(+94) 777739736 >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> >> *Sanjeewa Malalgoda* >> WSO2 Inc. >> Mobile : +94713068779 >> >> <http://sanjeewamalalgoda.blogspot.com/>blog >> :http://sanjeewamalalgoda.blogspot.com/ >> <http://sanjeewamalalgoda.blogspot.com/> >> >> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Nuwan Dias > > Technical Lead - WSO2, Inc. http://wso2.com > email : [email protected] > Phone : +94 777 775 729 > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, Uvindra Mobile: 777733962
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
