<div dir="ltr"><div><div><div><div>With the upcoming transcoding support [1], each cache will have a MimeType configured for key and value. This will allow, for example, to <br></div><div>differentiate from a byte[] that is a JPEG image, a gzipped text, some UTF-8 bytes, Jboss marshalled object, protostream marshalled message and so on.<br></div><div>At runtime, it'll be possible to read and write to/from the cache specifying a different MimeType and the appropriate transcoder will convert the values on demand. <br></div><div><br></div><div>Gustavo<br></div><div><br>[1] <a href="https://issues.jboss.org/browse/ISPN-7417">https://issues.jboss.org/browse/ISPN-7417</a><br><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 24, 2017 at 9:27 AM, Sebastian Laskawiec <span dir="ltr"><<a href="mailto:slaskawi@redhat.com" target="_blank">slaskawi@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hey Guys!<div><br></div><div>I'm currently reworking REST interface and I'm scratching my head looking how we deal with Serializable [1][2]. </div><div><br></div><div>The scenario assumes that server knows that cache stores a Serializable instance and moreover, it knows how to deserialize it (and convert it to XML/JSON, but that's the trivial part). I might be wrong, but I think both assumptions are questionable if not wrong. At first, how to distinguish a serialized instance of a class the server received [3] from a standard byte array? I can imagine someone using "Content-type: application/x-java-serialized-<wbr>object" but it's very error prone. It also leads to the question number two - how the server will know that type of instance it is? This knowledge is essential for deserialization.</div><div><br></div><div>I think the serialization/deserialization should be really done on the client side (but as I mentioned before, maybe I don't see some important use cases). I would like to remove it from refactored REST server.</div><div><br></div><div>What do you think?</div><div><br></div><div>Thanks,</div><div>Sebastian</div><div><br></div><div>[1] <a href="https://github.com/infinispan/infinispan/blob/master/server/rest/src/main/java/org/infinispan/rest/Server.java#L267-L313" target="_blank">https://github.com/<wbr>infinispan/infinispan/blob/<wbr>master/server/rest/src/main/<wbr>java/org/infinispan/rest/<wbr>Server.java#L267-L313</a></div><div>[2] <a href="https://github.com/infinispan/infinispan/blob/master/server/rest/src/test/java/org/infinispan/rest/IntegrationTest.java#L636-L639" target="_blank">https://github.com/<wbr>infinispan/infinispan/blob/<wbr>master/server/rest/src/test/<wbr>java/org/infinispan/rest/<wbr>IntegrationTest.java#L636-L639</a></div><div>[3] Note that the input param here is byte[] <a href="https://github.com/infinispan/infinispan/blob/master/server/rest/src/main/java/org/infinispan/rest/Server.java#L458" target="_blank">https://github.com/infinispan/<wbr>infinispan/blob/master/server/<wbr>rest/src/main/java/org/<wbr>infinispan/rest/Server.java#<wbr>L458</a></div></div><span class="gmail-HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div><div><div dir="ltr"><p class="gmail-m_5491805907089486153inbox-inbox-fullname-container" style="box-sizing:border-box;color:rgb(0,0,0);font-family:overpass,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:uppercase"><span class="gmail-m_5491805907089486153inbox-inbox-firstname-container" style="box-sizing:border-box">SEBASTIAN</span><span class="gmail-m_5491805907089486153inbox-inbox-Apple-converted-space"> </span><span class="gmail-m_5491805907089486153inbox-inbox-lastname-container" style="box-sizing:border-box">ŁASKAWIEC</span></p><p class="gmail-m_5491805907089486153inbox-inbox-position-container" style="box-sizing:border-box;color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:10px;margin:0px 0px 4px;text-transform:uppercase"><span class="gmail-m_5491805907089486153inbox-inbox-position" style="box-sizing:border-box">INFINISPAN DEVELOPER</span></p><p class="gmail-m_5491805907089486153inbox-inbox-legal-container" style="box-sizing:border-box;font-family:overpass,sans-serif;margin:0px;font-size:10px;color:rgb(153,153,153)"><a class="gmail-m_5491805907089486153inbox-inbox-redhat-anchor" href="https://www.redhat.com/" style="box-sizing:border-box;color:rgb(0,136,206);margin:0px;text-decoration:none" target="_blank">Red Hat<span class="gmail-m_5491805907089486153inbox-inbox-Apple-converted-space"> </span><span style="box-sizing:border-box">EMEA</span></a></p><table style="box-sizing:border-box;color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:medium" border="0"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td style="box-sizing:border-box" width="100px"><a href="https://red.ht/sig" style="box-sizing:border-box" target="_blank"><img style="box-sizing: border-box;" src="https://www.redhat.com/files/brand/email/sig-redhat.png" width="90" height="auto"></a></td></tr></tbody></table></div></div>
</font></span><br>______________________________<wbr>_________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/infinispan-<wbr>dev</a><br></blockquote></div><br></div></div></div></div></div></div></div>