Package org.springframework.amqp.support.converter

Examples of org.springframework.amqp.support.converter.SimpleMessageConverter.fromMessage()


        listenerContainer.setQueueNames(rabbitQueue.getName());

        // set the callback for message handling
        listenerContainer.setMessageListener(new MessageListener() {
            public void onMessage(Message message) {
                final BigOperation bigOp = (BigOperation) messageConverter.fromMessage(message);

                // simply printing out the operation, but expensive computation could happen here
                System.out.println("Received from RabbitMQ: " + bigOp);
            }
        });
View Full Code Here


        final CountDownLatch fooLatch = new CountDownLatch(1);
        final CountDownLatch barLatch = new CountDownLatch(2);
        final List<BigOperation> receievedMessageHolder = new ArrayList<BigOperation>(2);
        container.setMessageListener(new MessageListener() {
            public void onMessage(Message message) {
                receievedMessageHolder.add((BigOperation) messageConverter.fromMessage(message));
                fooLatch.countDown();
                barLatch.countDown();
            }
        });
        container.setErrorHandler(new ErrorHandler() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.