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

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


public class DefaultProbeListener extends ProbeListener {
   
    @Override
    protected void onReceiveFail(ProbContext probContext) {
        ReveiceResult revResult = probContext.getReveiceResult();
        getLogger()
                .warn(
                        String
                                .format(
                                        "fail on receive message from[%s].\n %s second passed since last send msg;\n topic[%s];\n partition[%s];\n offset[%s]",
                                        revResult.getServerUrl(), probContext.getSendRevInterval(), revResult
                                                .getTopic(), revResult.getPartition(), revResult.getOffset()),
                        probContext.getReveiceResult().getException());
    }
View Full Code Here


    }


    @Override
    protected void onReceiveFail(final ProbContext probContext) {
        final ReveiceResult revResult = probContext.getReveiceResult();
        final String exception =
                revResult.getException() != null ? revResult.getException().getMessage() : StringUtils.EMPTY;
        final String msg =
                String
                    .format(
                        "fail on receive message from[%s].\n %s second passed since last send msg;\n topic[%s];\n partition[%s];\n offset[%s];\n exception[%s]",
                        revResult.getServerUrl(), probContext.getSendRevInterval(), revResult.getTopic(),
                        revResult.getPartition(), revResult.getOffset(), exception);
        this.getLogger().warn("alarm...");
        Alarm.alert(msg, monitorConfig);
    }
View Full Code Here

        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.ReveiceResult

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.