package com.github.xsj24.communication.demo;

import com.github.xsj24.communication.demo.trades.MyTradeFactory;
import com.github.xsj24.communication.message.TradeMessage;
import com.github.xsj24.communication.senders.MessageSender;
import com.github.xsj24.communication.senders.RequestMessageSender;
import com.github.xsj24.communication.senders.SenderFactory;

/**
 * User: pc2
 * Date: 16-3-2
 * Time: 下午1:24
 * To change this template use File | Settings | File Templates.
 */
public class MyRequestSendDemo {

    public static void main(String[] args) {
        System.out.println(System.getProperty("os.arch"));
        String buscd = "10001";  //交易标志 - 业务功能号
        TradeMessage tradeMessage = MyTradeFactory.newTradeHandler(buscd).handleTrade();
        System.out.println(tradeMessage.getField("/MsgText/Dgst"));
        try {
            MessageSender requestSender = SenderFactory.newRequestSender();
            TradeMessage message = requestSender.send(tradeMessage);


        } catch (Exception e) {
            System.out.println("调用报文发送器发送报文出错! ");
        }
    }

}
