static RoutableFactory createGetBucketListReplyFactory() {
        return ProtobufCodecBuilder
                .of(GetBucketListReply.class, DocapiInspect.GetBucketListResponse.class)
                .encoder((apiReply) -> {
                    var builder = DocapiInspect.GetBucketListResponse.newBuilder();
                    for (var info : apiReply.getBuckets()) {
                        builder.addBucketInfo(DocapiInspect.BucketInformation.newBuilder()
                                .setBucketId(toProtoBucketId(info.getBucketId()))
                                .setInfo(info.getBucketInformation()));
                    }
                    return builder.build();
                })
                .decoder(DocapiInspect.GetBucketListResponse.parser(), (protoReply) -> {
                    var reply = new GetBucketListReply();
                    for (var info : protoReply.getBucketInfoList()) {
                        reply.getBuckets().add(new GetBucketListReply.BucketInfo(
                                fromProtoBucketId(info.getBucketId()),
                                info.getInfo()));
                    }
                    return reply;
                })
                .build();
    }
Implementation of MessageBus message request/response serialization built around Protocol Buffers.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories80.java