Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-1151

BinaryDocument read when saved by legacy app with flags==0

    XMLWordPrintable

Details

    • Story
    • Resolution: Won't Do
    • Major
    • .backlog
    • 2.5.2
    • None
    • None

    Description

      Legacy application saved some binary data to couchbase via memcached protocol.

      We can not change that application.

      We need to read that data from Java.

      We call

      CouchbaseAsyncBucket.get(id, BinaryDocument.class)

      it finds BinaryTransformer to get our data.

      BUT

      BinaryTransformer insists on certain flags and so fails:

      protected BinaryDocument doDecode(String id, ByteBuf content, long cas, int expiry, int flags,
          ResponseStatus status) throws Exception {
          if (!TranscoderUtils.hasBinaryFlags(flags)) {
              throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non-binary " +
                  "document for id " + id + ", could not decode.");
          }
      

       

      We worked around by registering our custom transcoder = we have workaround and are happy there.

      BUT

      we feel that if one wants binary document, and so states in .get(id, BinaryDocument.class) then they want binary data and do not actually need this additional check.

      Please consider dropping it.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            daschl Michael Nitschinger
            paf Alexander Petrossian (PAF)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty