@SuppressWarnings("nls")
    default void listenProxyHandler(IAsyncResultHandler<Void> startupHandler) {
        log().info("Setting up a listener on: {0}", address());

        MessageConsumer<JsonObject> consumer = vertx().eventBus().consumer(address(), (Message<JsonObject> message) -> {
            String inboundUuid = message.body().getString("uuid");
            log().debug("[{0}] Handling command from inbound UUID: {1} {2}", uuid(), inboundUuid, message);

            if (shouldIgnore(inboundUuid))
                return;

            String type = message.body().getString("type");
            String action = message.body().getString("action");
            String body = message.body().getString("body");

            switch (type) {
                case "client":
                    Client app = Json.decodeValue(body, Client.class);

                    if (action.equals("register")) {
                        registerClient(app);
                    } else if (action.equals("unregister")) {
                        unregisterClient(app);
                    }

                    break;
                case "api":
                    Api api = Json.decodeValue(body, Api.class);

                    if (action.equals("publish")) {
                        publishApi(api);
                    } else if (action.equals("retire")) {
                        retireApi(api);
                    }

                    break;
                default:
                    throw new IllegalStateException("Unknown type: " + type);
            }

        });

        consumer.completionHandler(complete ->  {
            if (complete.succeeded()) {
                startupHandler.handle(AsyncResultImpl.create((Void) null));
            } else {
                startupHandler.handle(AsyncResultImpl.create(complete.cause()));
            }
        });

        consumer.exceptionHandler(ex -> {
            log().error("[{0}] An exception occurred: {1}", uuid(), ex);
            ex.printStackTrace();
        });
    }
Listens for registry events on the event bus. Ignores self-generated events. These arrive as a simple JSON
payload, with a header containing the operation type, action and then a marshalled object containing the
corresponding object (e.g. Client, Api, etc).

Requests are then routed to the appropriate registry method.

@author Marc Savy {@literal <msavy@redhat.com>}
gateway/engine/vertx-eb-inmemory/src/main/java/io/apiman/gateway/engine/vertxebinmemory/apis/EBRegistryProxyHandler.java