use of io.vertx.serviceproxy.ServiceBinder in project knotx by Cognifide.
the class RequestProcessorKnotVerticle method start.
@Override
public void start() throws Exception {
LOGGER.info("Starting <{}>", this.getClass().getSimpleName());
serviceBinder = new ServiceBinder(getVertx());
consumer = serviceBinder.setAddress(configuration.getAddress()).register(KnotProxy.class, new RequestProcessorKnotProxyImpl());
}
use of io.vertx.serviceproxy.ServiceBinder in project knotx by Cognifide.
the class ResponseProviderKnotVerticle method start.
@Override
public void start() throws Exception {
LOGGER.info("Starting <{}>", this.getClass().getSimpleName());
serviceBinder = new ServiceBinder(getVertx());
consumer = serviceBinder.setAddress(configuration.getAddress()).register(KnotProxy.class, new ResponseProviderKnotProxyImpl());
}
use of io.vertx.serviceproxy.ServiceBinder in project knotx by Cognifide.
the class HttpServiceAdapterVerticle method start.
@Override
public void start() throws Exception {
LOGGER.info("Starting <{}>", this.getClass().getSimpleName());
// register the service proxy on event bus
serviceBinder = new ServiceBinder(getVertx());
consumer = serviceBinder.setAddress(configuration.getAddress()).register(AdapterProxy.class, new HttpServiceAdapterProxyImpl(vertx, configuration));
}
use of io.vertx.serviceproxy.ServiceBinder in project knotx by Cognifide.
the class ActionKnotProxyVerticleTest method createMockAdapter.
private void createMockAdapter(String address, String addToBody, String signal, Map<String, List<String>> headers) {
Func1<AdapterRequest, AdapterResponse> adapter = adapterRequest -> {
ClientResponse response = new ClientResponse();
response.setStatusCode(HttpResponseStatus.OK.code());
response.setBody(Buffer.buffer().appendString(addToBody));
response.setHeaders(headers.keySet().stream().collect(MultiMapCollector.toMultiMap(o -> o, headers::get)));
return new AdapterResponse().setResponse(response).setSignal(signal);
};
new ServiceBinder(vertx.vertx()).setAddress(address).register(AdapterProxy.class, new MockAdapterImpl(adapter));
}
use of io.vertx.serviceproxy.ServiceBinder in project knotx by Cognifide.
the class FilesystemRepositoryConnectorVerticle method start.
@Override
public void start() throws Exception {
LOGGER.info("Starting <{}>", this.getClass().getSimpleName());
// register the service proxy on event bus
serviceBinder = new ServiceBinder(getVertx());
consumer = serviceBinder.setAddress(address).register(RepositoryConnectorProxy.class, new FilesystemRepositoryConnectorProxyImpl(vertx, config()));
}
Aggregations