<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-08-29 15:09 GMT+03:00 Erik Jan de Wit <span dir="ltr">&lt;<a href="mailto:edewit@redhat.com" target="_blank">edewit@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class=""><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><br></div><div>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.</div>

</div></blockquote><div><br></div><div>While I like the above suggestion regarding the message format, couldn&#39;t we be still on the same path, and use some &#39;advanced&#39; CDI injection mechanismn to inject a Version110SenderServiceImpl (or Version100ServiceImpl) ? Just curious</div>
</div></div></div></blockquote><div><br></div></div><div>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. </div>
<div><br></div><div>And because the json in this particular Endpoint is serialised into a Map&lt;String, Object&gt; 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. </div>
<div><br></div><div>I must say this is probably the most simple solution to this specific API change so I’m +1 on this one.</div><br></div><div>WDYT</div></div></blockquote><div><br></div><div>Another option that might work out of the box would be to use the jax-rs @Consumes annotation e.g <span class="" style="color:rgb(51,51,51);font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:12px;line-height:16.799999237060547px;white-space:pre">@Consumes</span><span class="" style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:12px;line-height:16.799999237060547px;white-space:pre">({</span><span class="" style="color:rgb(221,17,68);font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:12px;line-height:16.799999237060547px;white-space:pre">&quot;application/vnd.aerogear.v101+json&quot;</span><span class="" style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:12px;line-height:16.799999237060547px;white-space:pre">}) on the service endpoints</span>.      </div>
<div>So by making an abstract PushNotificationSenderEndpoint and and several PushNotificationSenderEndpointV101, PushNotificationSenderEndpointV102 with the right @Consumes annotation should work. I haven&#39;t tried it though </div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br></div><br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br></div></div>