public boolean sendEvents(
            final Message inMessage, final Consumer<StitchResponse> resultCallback, final AsyncCallback callback) {
        sendAsyncEvents(inMessage)
                .subscribe(resultCallback, error -> {
                    // error but we continue
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Error processing async exchange with error: {}", error.getMessage());
                    }
                    inMessage.getExchange().setException(error);
                    callback.done(false);
                }, () -> {
                    // we are done from everything, so mark it as sync done
                    LOG.trace("All events with exchange have been sent successfully.");
                    callback.done(false);
                });

        return false;
    }
@Test
    void testErrorHandle() {
        final StitchConfiguration configuration = new StitchConfiguration();
        configuration.setTableName("table_1");
        configuration.setStitchSchema(StitchSchema.builder().addKeyword("field_1", "string").build());
        configuration.setKeyNames("field_1");

        final StitchMessage message = StitchMessage.builder()
                .withData("field_1", "data")
                .withSequence(0)
                .build();

        final Exchange exchange = new DefaultExchange(context);
        exchange.getMessage().setBody(message);

        final StitchProducerOperations operations = new StitchProducerOperations(new TestErrorClient(), configuration);

        operations.sendEvents(exchange.getMessage(), response -> {
        }, doneSync -> {
        });

        assertNotNull(exchange.getException());
        assertTrue(exchange.getException() instanceof StitchException);
        assertNotNull(((StitchException) exchange.getException()).getResponse());
        assertEquals(400, ((StitchException) exchange.getException()).getResponse().getHttpStatusCode());
        assertEquals("Error", ((StitchException) exchange.getException()).getResponse().getStatus());
        assertEquals("Not good!", ((StitchException) exchange.getException()).getResponse().getMessage());
    }