IMHO the regular OSGi semantics should apply here as well, i.e. higher service ranking wins (if tie lower bundle id wins). That is also documented at https://sling.apache.org/documentation/the-sling-engine/servlets.html#servlet-resolution-order <https://sling.apache.org/documentation/the-sling-engine/servlets.html#servlet-resolution-order>
In any case this should only be the last criteria if selectors, extensions and method are the same for more then one servlet resolution candidate. Throwing an exception/refusing to register the servlet is wrong and would be a regression. Konrad > On 11. May 2022, at 17:14, Bertrand Delacretaz <bdelacre...@apache.org> wrote: > > Hi, > > I forgot if we discussed this already, if that's the case pointers are > welcome. > > Adrian Kozma created SLING-11315 about this, and I tentatively added a > new test [1] to explore the current behavior. > > It looks like the first registered servlet wins, but that might be > just by chance. > > Do people agree that Sling should refuse to register servlets that > have the same set of mount parameters as existing ones? > > I think that would help avoid difficult to troubleshoot situations. > > -Bertrand > > [1] > https://github.com/apache/sling-org-apache-sling-servlets-resolver/commit/1603a0ecb2ab8b4395560c0d53d9e5569b68a568