static RoutableFactory createStatBucketReplyFactory() {
        return ProtobufCodecBuilder
                .of(StatBucketReply.class, DocapiInspect.StatBucketResponse.class)
                .encoder((apiReply) ->
                        DocapiInspect.StatBucketResponse.newBuilder()
                                .setResults(apiReply.getResults())
                                .build())
                .decoder(DocapiInspect.StatBucketResponse.parser(), (protoReply) ->
                        new StatBucketReply(protoReply.getResults()))
                .build();
    }
Implementation of MessageBus message request/response serialization built around Protocol Buffers.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories80.java