Unable to decode JSON document, returns flag 0x112

The way to get it is to use a custom transcoder. It was in the “2.x SDKs” (in quotes because go-lang for instance was net-new, so it was a 1.x) that we standardized the flags and transcoder handling. The legacy was inherited from various open source memcached projects and we devised a way to be compatible with the legacy but move toward consistency.

In the legacy, .NET and Java didn’t inter-operate. Since you have one foot in both worlds (.NET 1.x and Java 2.x), you’re seeing this.

Interestingly enough, this just came up in another thread here on the forums in recent days:

The example there from @unhuman is, as I mention in the thread, not so much of a hack as an intended part of the interface for extension. A transcoder can be configured to convert your .NET legacy documents into whatever’s appropriate here in the Java 2.x SDK.

You might ask why we don’t do that automatically? The problem is the legacy and open source memcached clients have varying behavior. There’s no way we can automatically figure it out, unfortunately.

You need to know a bit about what created the document in order to unpack it correctly. Or, you need to duck-type-transcode it, which is too expensive from a performance perspective.

The good news is that if you’re all in the future, everything interoperates great and if you have one foot in the past we still have an interface (the transcoder) that lets you do what you need to.

1 Like