I'm using vertx.io web framework to send a list of items to a downstream HTTP server.
records.records()
emits 4 records and I have specifically set the web client to connect to the wrong I.P/port.
Processing...
prints 4 times.
Exception outer!
prints 3 times.
If I put back the proper I.P/port then Susbscribe outer!
prints 4 times.
io.reactivex.Flowable
.fromIterable(records.records())
.flatMap(inRecord -> {
System.out.println("Processing...");
// Do stuff here....
Observable<Buffer> bodyBuffer = Observable.just(Buffer.buffer(...));
Single<HttpResponse<Buffer>> request = client
.post(..., ..., ...)
.rxSendStream(bodyBuffer);
return request.toFlowable();
})
.subscribe(record -> {
System.out.println("Subscribe outer!");
}, ex -> {
System.out.println("Exception outer! " + ex.getMessage());
});
UPDATE:
I now understand that on error RX stops right a way. Is there a way to continue and process all records regardless and get an error for each?