How to get all apended objects from a single key.

Skip to first unread message

Pritam kumar

Mar 9, 2021, 5:44:56 AMMar 9
to memcached

Hello Team,

I am using Memcached server (version -1.5.22) & spymemcached java client (version - 2.12.3) . In a scenario i have appended multiple objects in single existing key as like below i mentioned :-

User user = new User();

Object data = get(Key);

if (data != null) {
    append(key, user));
} else {
    set(key, 0, user));

I am able to find all the appended objects from the key using terminal (telnet 11211 & fetch data using get key). But when i am trying to get all the appended objects through java client it returns only 1st object which was set 1st time.

I am trying this like below :-

Object userData = get(key);

Please help me that How to get all the appended objects from the key through java client?

Any suggestions or help would be appreciated.



Mar 9, 2021, 6:37:28 PMMar 9
to memcached

Memcached only "thinks" in binary blobs. Append is just stacking the
new object at the end of the new object. If whatever you use to serialize
and de-serialize your objects doesn't understand this it won't return all
of the objects.

You'll need to modify the java client or otherwise provide it with a
custom deserializer.
> --
> ---
> You received this message because you are subscribed to the Google Groups "memcached" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> To view this discussion on the web visit
Reply all
Reply to author
0 new messages