Hello Darin,

I tried something similar earlier, but instead of making any modifications
to the JAX-RS implementation, we relied on creating a custom servlet for
the routing logic.

Basically the approach my project took was to have each version of the
JAX-RS endpoints exposed at a different URL, like for example
.../v1.0/myapi and ../v1.0/myapi and another servlet listening on .../myapi
that would 'forward' the servlet request to the correct version based on
the custom HTTP header.

Later we realized that it was much easier to just ask clients to directly
call the versioned URL instead of sending a custom HTTP header and going
via the routing servlet. :-)

Thanks
Anuj


On Fri, Jun 10, 2016 at 9:05 PM Darin Amos <[email protected]> wrote:

> Hello All,
>
> I would like to add a customization to Apache Wink that allows me to use a
> query parameter or custom header for routing in order to implement
> versioning. After reviewing the code it appears the best way to do this
> would be to extend the ResourceRegistry class and override/extend the
> method: filterDispatchMethods(ResourceInstance, List<? extends
> MethodRecord>,RuntimeContext)
>
> It appears the only way to do this would be to extend
> DeploymentConfiguration.initRegistries() by throwing away the instance of
> ResourceRegistry that is created, replacing it with my own instance.
>
> Does anyone have any thoughts or suggestions on a better way to do this?
>
> Thanks!
>
> Darin
>
>
>

Reply via email to