@InvokeOnHeader(CONTROL_ACTION_STATS)
    public void performStats(final Exchange exchange, AsyncCallback callback) {
        Message message = exchange.getMessage();
        Map<String, Object> headers = message.getHeaders();
        String subscribeChannel = (String) headers.getOrDefault(CONTROL_SUBSCRIBE_CHANNEL, configuration.getSubscribeChannel());
        try {
            String stats = dynamicRouterControlService.getStatisticsForChannel(subscribeChannel);
            message.setBody(stats, String.class);
        } catch (Exception e) {
            exchange.setException(e);
        } finally {
            callback.done(false);
        }
    }
@Test
    void testPerformStatsActionWithException() {
        String subscribeChannel = "testChannel";
        Map<String, Object> headers = Map.of(
                CONTROL_ACTION_HEADER, CONTROL_ACTION_STATS,
                CONTROL_SUBSCRIBE_CHANNEL, subscribeChannel);
        when(exchange.getMessage()).thenReturn(message);
        when(message.getHeaders()).thenReturn(headers);
        Exception ex = new IllegalArgumentException("test exception");
        Mockito.doThrow(ex).when(controlService).getStatisticsForChannel(subscribeChannel);
        Mockito.doNothing().when(callback).done(false);
        producer.performStats(exchange, callback);
        Mockito.verify(exchange, Mockito.times(1)).setException(ex);
    }