@Override
    public void process(Exchange exchange) throws Exception {
        try {
            plc4XEndpoint.reconnectIfNeeded();
        } catch (PlcConnectionException e) {
            if (log.isTraceEnabled()) {
                log.warn("Unable to reconnect, skipping request", e);
            } else {
                log.warn("Unable to reconnect, skipping request");
            }
            return;
        }

        Message in = exchange.getIn();
        Object body = in.getBody();
        PlcWriteRequest plcWriteRequest;
        if (body instanceof Map) { //Check if we have a Map
            Map<String, Map<String, Object>> tags = (Map<String, Map<String, Object>>) body;
            plcWriteRequest = plc4XEndpoint.buildPlcWriteRequest(tags);
        } else {
            throw new PlcInvalidTagException("The body must contain a Map<String,Map<String,Object>");
        }
        CompletableFuture<? extends PlcWriteResponse> completableFuture = plcWriteRequest.execute();
        int currentlyOpenRequests = openRequests.incrementAndGet();
        try {
            log.debug("Currently open requests including {}:{}", exchange, currentlyOpenRequests);
            Object plcWriteResponse = completableFuture.get(5000, TimeUnit.MILLISECONDS);
            if (exchange.getPattern().isOutCapable()) {
                Message out = exchange.getMessage();
                out.copyFrom(exchange.getIn());
                out.setBody(plcWriteResponse);
            } else {
                in.setBody(plcWriteResponse);
            }
        } finally {
            int openRequestsAfterFinish = openRequests.decrementAndGet();
            log.trace("Open Requests after {}:{}", exchange, openRequestsAfterFinish);
        }
    }
@Test
    public void process() throws Exception {
        when(testExchange.getPattern()).thenReturn(ExchangePattern.InOnly);
        sut.process(testExchange);
        when(testExchange.getPattern()).thenReturn(ExchangePattern.InOut);
        sut.process(testExchange);
        when(testExchange.getIn().getBody()).thenReturn(2);

    }