Package com.taobao.metamorphosis.client.extension.spring

Examples of com.taobao.metamorphosis.client.extension.spring.MetaqTemplate.send()


        final String topic = "meta-test";
        MetaqTemplate template = (MetaqTemplate) context.getBean("metaqTemplate");
        int count = 100;
        for (int i = 0; i < count; i++) {
            SendResult result =
                    template.send(MessageBuilder.withTopic(topic).withBody(new Trade(i, "test", i, "test")));
            assertTrue(result.isSuccess());
        }
        TradeMessageListener listener = (TradeMessageListener) context.getBean("messageListener");
        while (listener.counter.get() != count) {
            Thread.sleep(100);
View Full Code Here


        long tradeId = 0;
        int money = 1000;
        while ((line = readLine(reader)) != null) {
            // send message
            final SendResult sendResult =
                    template.send(MessageBuilder.withTopic(topic).withBody(new Trade(tradeId++, line, money++, line)));
            // check result
            if (!sendResult.isSuccess()) {
                System.err.println("Send message failed,error message:" + sendResult.getErrorMessage());
            }
            else {
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.