How to serialize/deserialize action requests to/from json?

hi group,

I was hunting through the java api for a way to serialize/deserialize
any action request to/from json (IndexRequest / DeleteRequest / etc.)
and could not find any, which I find surprising as the rest api does
parse json payload.

the context for such need is using a messaging bus (ie AMQP) to
execute indexing requests.
what I'm ending doing right now is using a bytearray payload, by using
the request.writeTo(StreamOutput) on the producer side and
request.readFrom(StreamInput) on the consumer side (which also
mandates parsing the StreamInput header first to figure out the
request type).

I would very very much prefer to use json as the payload, if only for
debugging/troubleshooting purposes.
anyone know how to accomplish that or have used another strategy?

thanks in advance,
Benny

There ins't a need for it in elasticsearch (serializing the action requests
to json), so its not implemented.

On Fri, Jun 1, 2012 at 10:14 AM, benny.sadeh benny.sadeh@gmail.com wrote:

hi group,

I was hunting through the java api for a way to serialize/deserialize
any action request to/from json (IndexRequest / DeleteRequest / etc.)
and could not find any, which I find surprising as the rest api does
parse json payload.

the context for such need is using a messaging bus (ie AMQP) to
execute indexing requests.
what I'm ending doing right now is using a bytearray payload, by using
the request.writeTo(StreamOutput) on the producer side and
request.readFrom(StreamInput) on the consumer side (which also
mandates parsing the StreamInput header first to figure out the
request type).

I would very very much prefer to use json as the payload, if only for
debugging/troubleshooting purposes.
anyone know how to accomplish that or have used another strategy?

thanks in advance,
Benny

I was looking for the same thing. I need to execute the same ES action
(index, create index, delete, etc.) in 3 separate environments (all
isolated and firewalled). We have a queue that spans environments, so it
would be easy to have a listener pull a request, build the action and
execute it. I can do this myself using Kryo or something similar, but
seems like I'm missing a really easy way to do it.

Let me know if I have.

J

On Sunday, June 3, 2012 5:52:09 AM UTC-4, kimchy wrote:

There ins't a need for it in elasticsearch (serializing the action
requests to json), so its not implemented.

On Fri, Jun 1, 2012 at 10:14 AM, benny.sadeh <benny...@gmail.com
<javascript:>> wrote:

hi group,

I was hunting through the java api for a way to serialize/deserialize
any action request to/from json (IndexRequest / DeleteRequest / etc.)
and could not find any, which I find surprising as the rest api does
parse json payload.

the context for such need is using a messaging bus (ie AMQP) to
execute indexing requests.
what I'm ending doing right now is using a bytearray payload, by using
the request.writeTo(StreamOutput) on the producer side and
request.readFrom(StreamInput) on the consumer side (which also
mandates parsing the StreamInput header first to figure out the
request type).

I would very very much prefer to use json as the payload, if only for
debugging/troubleshooting purposes.
anyone know how to accomplish that or have used another strategy?

thanks in advance,
Benny

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9d430ff8-6fdd-4755-8a83-f3cb9c1dd6fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.