You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Chandrashekhar Kotekar <sh...@gmail.com> on 2014/07/21 16:23:39 UTC

Fwd: How to send data in avro format from web service

Hi,

I woud like to know if it is possible to send data in avro format to and
from jersey based web services.

Regards,
Chandrash3khar Kotekar
Mobile - +91 8600011455

Re: How to send data in avro format from web service

Posted by Michael Pigott <mp...@gmail.com>.
(That assumes both the client and server have access to the schema, which
can also be also be sent over as JSON
<http://avro.apache.org/docs/1.7.6/api/java/org/apache/avro/Schema.html#toString()>
.)


On Mon, Jul 21, 2014 at 2:56 PM, Michael Pigott <
mpigott.subscriptions@gmail.com> wrote:

> Hi,
>     You can use a JsonEncoder
> <http://avro.apache.org/docs/1.7.6/api/java/org/apache/avro/io/JsonEncoder.html> to
> create a JSON representation, which Jersey appears to support
> <https://jersey.java.net/documentation/latest/media.html#json>.  If you
> are hoping for XML, I am currently working on AVRO-457
> <https://issues.apache.org/jira/browse/AVRO-457>, and it will probably be
> a couple of weeks before I finish.
>
> Regards,
> Mike
>
>
> On Mon, Jul 21, 2014 at 10:23 AM, Chandrashekhar Kotekar <
> shekhar.kotekar@gmail.com> wrote:
>
>> Hi,
>>
>> I woud like to know if it is possible to send data in avro format to and
>> from jersey based web services.
>>
>> Regards,
>> Chandrash3khar Kotekar
>> Mobile - +91 8600011455
>>
>>
>

Re: How to send data in avro format from web service

Posted by Michael Pigott <mp...@gmail.com>.
Hi,
    You can use a JsonEncoder
<http://avro.apache.org/docs/1.7.6/api/java/org/apache/avro/io/JsonEncoder.html>
to
create a JSON representation, which Jersey appears to support
<https://jersey.java.net/documentation/latest/media.html#json>.  If you are
hoping for XML, I am currently working on AVRO-457
<https://issues.apache.org/jira/browse/AVRO-457>, and it will probably be a
couple of weeks before I finish.

Regards,
Mike


On Mon, Jul 21, 2014 at 10:23 AM, Chandrashekhar Kotekar <
shekhar.kotekar@gmail.com> wrote:

> Hi,
>
> I woud like to know if it is possible to send data in avro format to and
> from jersey based web services.
>
> Regards,
> Chandrash3khar Kotekar
> Mobile - +91 8600011455
>
>

Re: How to send data in avro format from web service

Posted by Chandrashekhar Kotekar <sh...@gmail.com>.
Ohk. Thanks a lot for help, Michael and William.


Regards,
Chandrash3khar Kotekar
Mobile - +91 8600011455


On Tue, Jul 22, 2014 at 1:07 AM, William Briggs <wr...@gmail.com> wrote:

> It's extremely straightforward to implement your own MessageBodyReader,
> and plug it into your Jersey app to convert messages with appropriate mime
> types  (avro/binary for binary payloads and probably application/json or,
> less standards-compliant, avro/json for JSON payloads). As Michael Pigott
> noted, you can easily return serialized Avro records using the JsonEncoder.
>
> Regards,
> Will
>
>
> On Mon, Jul 21, 2014 at 10:23 AM, Chandrashekhar Kotekar <
> shekhar.kotekar@gmail.com> wrote:
>
>> Hi,
>>
>> I woud like to know if it is possible to send data in avro format to and
>> from jersey based web services.
>>
>> Regards,
>> Chandrash3khar Kotekar
>> Mobile - +91 8600011455
>>
>>
>

Re: How to send data in avro format from web service

Posted by William Briggs <wr...@gmail.com>.
It's extremely straightforward to implement your own MessageBodyReader, and
plug it into your Jersey app to convert messages with appropriate mime
types  (avro/binary for binary payloads and probably application/json or,
less standards-compliant, avro/json for JSON payloads). As Michael Pigott
noted, you can easily return serialized Avro records using the JsonEncoder.

Regards,
Will


On Mon, Jul 21, 2014 at 10:23 AM, Chandrashekhar Kotekar <
shekhar.kotekar@gmail.com> wrote:

> Hi,
>
> I woud like to know if it is possible to send data in avro format to and
> from jersey based web services.
>
> Regards,
> Chandrash3khar Kotekar
> Mobile - +91 8600011455
>
>