[aerogear-dev] REST-based API Versioning

Erik Jan de Wit edewit at redhat.com
Fri Aug 29 08:09:19 EDT 2014

> Other option is to have 2 jax-rs classes, but to make that work they will have to have 2 different paths. So you would have to ‘redirect’ / change the path in the servlet filter based on the accept header. Which feels like kinda of a hack to me.
> While I like the above suggestion regarding the message format, couldn't we be still on the same path, and use some 'advanced' CDI injection mechanismn to inject a Version110SenderServiceImpl (or Version100ServiceImpl) ? Just curious

Right with CDI qualifiers you could select a specific version of the same implementation see SenderServiceImpl for an example of this it has all the PushNotificationSenders and selects them based on the variantType. 

And because the json in this particular Endpoint is serialised into a Map<String, Object> we don’t even have to have 2 different versions of the SenderServiceImpl or have CDI qualifiers we ‘just’ need to have a Strategy based on version that converts the Map into a Message object. 

I must say this is probably the most simple solution to this specific API change so I’m +1 on this one.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20140829/3be25808/attachment-0001.html 

More information about the aerogear-dev mailing list