Package com.taobao.metamorphosis.tools.monitor.core

Examples of com.taobao.metamorphosis.tools.monitor.core.SendResultWrapper


        this.probeListeners.add(listener);
    }


    private void prob(MsgSender sender, MsgReceiver receiver) throws InterruptedException {
        SendResultWrapper sendResult = sender.sendMessage(this.getMonitorConfig().getSendTimeout());
        ProbContext probContext = new ProbContext();
        probContext.lastSendTime = System.currentTimeMillis();
        probContext.sendResult = sendResult;

        if (!sendResult.isSuccess()) {
            this.innerProbeListener.onSendFail(sender, sendResult);
            return;
        }

        Thread.sleep(this.getMonitorConfig().getProbeInterval());

        // receive����ֱ������,.
        // ֱ������ʱ���ص�patitionΪbrokerId=-1,patition=��ʵ��patition
        ReveiceResult reveiceResult = receiver.get(sender.getTopic(), sendResult.getSendResult().getPartition());
        probContext.lastRevTime = System.currentTimeMillis();
        probContext.reveiceResult = reveiceResult;
        if (!reveiceResult.isSuccess()) {
            this.innerProbeListener.onReceiveFail(probContext);
        }

        // ��һ�ν�����Ϣ��offset����һ�η��͵�offsetλ�ÿ�ʼ
        receiver.setOffset(sendResult.getSendResult().getPartition(), sendResult.getSendResult().getOffset());
    }
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.tools.monitor.core.SendResultWrapper

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.