static RoutableFactory createRemoveLocationMessageFactory() {
        return ProtobufCodecBuilder
                .of(RemoveLocationMessage.class, DocapiFeed.RemoveLocationRequest.class)
                .encoder((apiMsg) ->
                        DocapiFeed.RemoveLocationRequest.newBuilder()
                                .setBucketSpace(toProtoBucketSpace(apiMsg.getBucketSpace()))
                                .setSelection(toProtoDocumentSelection(apiMsg.getDocumentSelection()))
                                .build())
                .decoder(DocapiFeed.RemoveLocationRequest.parser(), (protoMsg) ->
                        new RemoveLocationMessage(
                                fromProtoDocumentSelection(protoMsg.getSelection()),
                                fromProtoBucketSpace(protoMsg.getBucketSpace())))
                .build();
    }
Implementation of MessageBus message request/response serialization built around Protocol Buffers.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories80.java