Search in sources :

Example 1 with AdapterProxy

use of io.knotx.reactivex.proxy.AdapterProxy in project knotx by Cognifide.

the class HttpServiceAdapterProxyTest method callAdapterServiceWithAssertions.

private void callAdapterServiceWithAssertions(TestContext context, String servicePath, Action1<AdapterResponse> onSuccess, Consumer<Throwable> onError) {
    AdapterRequest message = payloadMessage(servicePath);
    Async async = context.async();
    AdapterProxy service = AdapterProxy.createProxy(new Vertx(vertx.vertx()), ADAPTER_ADDRESS);
    service.rxProcess(message).doOnSuccess(onSuccess::call).subscribe(success -> async.complete(), onError);
}
Also used : AdapterRequest(io.knotx.dataobjects.AdapterRequest) Async(io.vertx.ext.unit.Async) AdapterProxy(io.knotx.reactivex.proxy.AdapterProxy) Vertx(io.vertx.reactivex.core.Vertx)

Example 2 with AdapterProxy

use of io.knotx.reactivex.proxy.AdapterProxy in project knotx by Cognifide.

the class ActionKnotProxyImpl method callActionAdapter.

private Single<AdapterResponse> callActionAdapter(KnotContext knotContext, FormEntity current) {
    LOGGER.trace("Process form for {} ", knotContext);
    AdapterProxy adapter = AdapterProxy.createProxyWithOptions(vertx, current.adapter().getAddress(), configuration.getDeliveryOptions());
    return adapter.rxProcess(prepareAdapterRequest(knotContext, current));
}
Also used : AdapterProxy(io.knotx.reactivex.proxy.AdapterProxy)

Aggregations

AdapterProxy (io.knotx.reactivex.proxy.AdapterProxy)2 AdapterRequest (io.knotx.dataobjects.AdapterRequest)1 Async (io.vertx.ext.unit.Async)1 Vertx (io.vertx.reactivex.core.Vertx)1