code: private Object encodedPayload(Object payload) {
          LOG.debug("About to encode payload: {}", payload);
          if(payload == null || payload instanceof InputStream || payload.getClass() == byte[].class) {
              LOG.debug("Payload is null or binary - encoding skipped.");
              return payload;
          }
          return payloadEncoding.encode(payload);
      }
docs: Helpers