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());
}