Re: How to use rest api to put an object into cache?

2016-06-28 Thread Vladimir Ozerov
Hi Kevin,

Yes, currently REST protocol interpret everything as String. At this moment
you can use *ConnectorMessageInterceptor *interface. Once you implement and
configure it, you will start receiving callback for all keys and values
passed back and forth. So you can encode you object as a String somehow and
then convert it to real object inside interceptor. And the opposite: before
returning object from cache you can convert it to some String form.

This is not very convenient, though it will allow you to go further without
awaiting any tickets to be implemented.

Vladimir.

On Mon, Jun 27, 2016 at 6:42 PM, Alexey Kuznetsov 
wrote:

> Hi Kevin.
>
> >> 1.   Does Rest API only support String as key and value? When I
> try to use Integer as key, and gives null result.
> See: https://issues.apache.org/jira/browse/IGNITE-3345
>
> >> 2.   Assume I have a key object and value object, If I want to
> store this object in server side cache, Do I have to store them as json
> format string, and parse it on client side?
> >> In this case, How can I set read/write through to enable database
> interaction?
>
> See: https://issues.apache.org/jira/browse/IGNITE-962
>
> It seems both your questions is not implemented yet.
>
> IGNITE-3345 - could be easily implemented IMHO. Do you interested to
> contribute?
>
>
> --
> Alexey Kuznetsov
> GridGain Systems
> www.gridgain.com
>


Re: How to use rest api to put an object into cache?

2016-06-27 Thread Alexey Kuznetsov
Hi Kevin.

>> 1.   Does Rest API only support String as key and value? When I try
to use Integer as key, and gives null result.
See: https://issues.apache.org/jira/browse/IGNITE-3345

>> 2.   Assume I have a key object and value object, If I want to store
this object in server side cache, Do I have to store them as json format
string, and parse it on client side?
>> In this case, How can I set read/write through to enable database
interaction?

See: https://issues.apache.org/jira/browse/IGNITE-962

It seems both your questions is not implemented yet.

IGNITE-3345 - could be easily implemented IMHO. Do you interested to
contribute?


-- 
Alexey Kuznetsov
GridGain Systems
www.gridgain.com


How to use rest api to put an object into cache?

2016-06-25 Thread Zhengqingzheng
Hi there,
I tried to use REST API to put object into an cache, but failed. I notice that 
there was a discussion between 
vkulichenko
 and Tony .
(See Link: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-put-a-POJO-bean-value-to-cache-by-rest-api-td3639.html#a3651
)
I still have some questions regards to this problem:

1.   Does Rest API only support String as key and value? When I try to use 
Integer as key, and gives null result.

2.   Assume I have a key object and value object, If I want to store this 
object in server side cache, Do I have to store them as json format string, and 
parse it on client side? In this case, How can I set read/write through to 
enable database interaction?


Best regards,
Kevin