Package com.taobao.metamorphosis.example.spring.messages

Examples of com.taobao.metamorphosis.example.spring.messages.Trade


*/
public class TradeMessageListener extends DefaultMessageListener<Trade> {

    @Override
    public void onReceiveMessages(MetaqMessage<Trade> msg) {
        Trade trade = msg.getBody();
        System.out.println("receive trade message:" + trade);
    }
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

Related Classes of com.taobao.metamorphosis.example.spring.messages.Trade

Copyright © 2018 www.massapicom. 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.