@Override
    public boolean process(Exchange exchange, AsyncCallback callback) {
        try {
            stompEndpoint.send(exchange, callback);
            return false;
        } catch (Exception e) {
            exchange.setException(e);
        }
        callback.done(true);
        return true;
    }
@Test
    public void testProduce() throws Exception {
        context.addRoutes(createRouteBuilder());
        context.start();

        Stomp stomp = createStompClient();
        final BlockingConnection subscribeConnection = stomp.connectBlocking();

        StompFrame frame = new StompFrame(SUBSCRIBE);
        frame.addHeader(DESTINATION, StompFrame.encodeHeader("test"));
        frame.addHeader(ID, subscribeConnection.nextId());
        subscribeConnection.request(frame);

        final CountDownLatch latch = new CountDownLatch(numberOfMessages);

        Thread thread = new Thread(new Runnable() {
            public void run() {
                for (int i = 0; i < numberOfMessages; i++) {
                    try {
                        StompFrame frame = subscribeConnection.receive();
                        assertTrue(frame.contentAsString().startsWith("test message "));
                        assertTrue(frame.getHeader(new AsciiBuffer(HEADER)).ascii().toString().startsWith(HEADER_VALUE));
                        latch.countDown();
                    } catch (Exception e) {
                        LOG.warn("Unhandled exception receiving STOMP data: {}", e.getMessage(), e);
                        break;
                    }
                }
            }
        });
        thread.start();

        Endpoint endpoint = context.getEndpoint("direct:foo");
        Producer producer = endpoint.createProducer();
        for (int i = 0; i < numberOfMessages; i++) {
            Exchange exchange = endpoint.createExchange();
            exchange.getIn().setBody(("test message " + i).getBytes("UTF-8"));
            exchange.getIn().setHeader(HEADER, HEADER_VALUE);
            producer.process(exchange);
        }
        latch.await(20, TimeUnit.SECONDS);

        assertEquals(0, latch.getCount(), "Messages not consumed = " + latch.getCount());
    }