[infinispan-dev] Problem with HotRod cache updates

Radim Vansa rvansa at redhat.com
Thu Mar 6 07:25:01 EST 2014


For such questions, please, use forum. Mailing list is intended for 
developers' discussions.

The three bytes come from JBoss Marshalling, where the key type has to 
be marshalled as well. In this case the 3 and 62 identify that it's a 
java.lang.String and 4 is the string's length (variable-size encoded).

If you want to access the cache both using HotRod and locally, please, 
use compatibility mode [1][2]

Radim

[1] 
http://infinispan.org/docs/6.0.x/user_guide/user_guide.html#_interoperability_between_embedded_and_remote_server_endpoints
[2] 
http://infinispan.org/docs/6.0.x/infinispan_server_guide/infinispan_server_guide.html#_protocol_interoperability

On 03/05/2014 11:14 PM, Mark Kowaliszyn wrote:
> Hi,
>
> I am using the RemoteCacheManager to access a cache on my cluster. Getting an entry and updating it on the client works no problem, however on the server, the cache receives an entry with a byte array cache key, rather than the original string I put.
>
> My server results in the following listener output when the cache put occurs:
>
> DEBUG 0305-16:49:16:789 Cache (thermostatCache) entry modified: [3, 62, 4, 49, 48, 48, 48] (local=true) {foundation.infinispan.listener.CacheLoggingListener.entryModified} [HotRod-HotRodServerServerWorker-19]({})
> DEBUG 0305-16:49:16:794 ++++ string: [B at 690edaf3, new string: >1000 {foundation.infinispan.listener.CacheLoggingListener.entryModified} [HotRod-HotRodServerServerWorker-19]({})
>
> The cache key in question is "1000".  The output above is from a cache listener and the output is from CacheModifiedEvent.getKey().  I have some additional output to first do a toString() on the key, and a new string decoding the byte array. There are a few bytes prefixing the byte array which are not part of the cache key. In the cut/paste here, there are 2 characters missing, the "new string" has 2 unprintable character one before and one after the ">" character.
>
> What are the extra bytes in key? Why is the key inserted as bytes and not a string?
>
> The end effect is that my cluster cache gets a new junk entry in the cache with every client put. I did not see any documentation where it indicated I might need a custom key serializer. I am using strings for cache keys, nothing special.
>
> Updating the cache from the cluster-local cache works perfectly.
>
> Thanks,
> Mark
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


-- 
Radim Vansa <rvansa at redhat.com>
JBoss DataGrid QA



More information about the infinispan-dev mailing list