聊聊rocketmq的consumeTimeout

更新时间:2023-06-25 18:25:04 阅读: 评论:0

//......
public void cleanExpiredMsg(DefaultMQPushConsumer pushConsumer) {
if (DefaultMQPushConsumerImpl().isConsumeOrderly()) {
return;
}
int loop = msgTreeMap.size() < 16 ? msgTreeMap.size() : 16;appreciate的用法
for (int i = 0; i < loop; i++) {
MessageExt msg = null;
try {
adLock().lockInterruptibly();
try {
今的组词
if (!msgTreeMap.isEmpty() && System.currentTimeMillis() - Long.ConsumeStartTimeStamp(msgTreeMap.firstEntry().getValue()))                        msg = msgTreeMap.firstEntry().getValue();
} el {
break;
}
考虑周全} finally {
翁读音
adLock().unlock();
周杰伦作曲的歌
}
} catch (InterruptedException e) {
<("getExpiredMsg exception", e);
}
try {
pushConsumer.ndMessageBack(msg, 3);
log.info("nd expire msg back. topic={}, msgId={}, storeHost={}, queueId={}, queueOfft={}", Topic(), MsgId(), StoreHost(), QueueId(                try {
this.lockTreeMap.writeLock().lockInterruptibly();
try {
if (!msgTreeMap.isEmpty() && QueueOfft() == msgTreeMap.firstKey()) {
try {
removeMessage(Collections.singletonList(msg));
} catch (Exception e) {
<("nd expired msg exception", e);
}
}
文迪雅
} finally {
this.lockTreeMap.writeLock().unlock();
}
} catch (InterruptedException e) {
<("getExpiredMsg exception", e);
}
} catch (Exception e) {
<("nd expired msg exception", e);
古墓探险
}
}
}
public long removeMessage(final List<MessageExt> msgs) {
long result = -1;
final long now = System.currentTimeMillis();
try {
this.lockTreeMap.writeLock().lockInterruptibly();
this.lastConsumeTimestamp = now;
try {
毕业论文大专if (!msgTreeMap.isEmpty()) {
result = this.queueOfftMax + 1;
int removedCnt = 0;
for (MessageExt msg : msgs) {
MessageExt prev = QueueOfft());
if (prev != null) {
removedCnt--;
msgSize.addAndGet(0 - Body().length);
}
}
msgCount.addAndGet(removedCnt);
if (!msgTreeMap.isEmpty()) {
result = msgTreeMap.firstKey();
}

本文发布于:2023-06-25 18:25:04,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1054632.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:探险   毕业论文   古墓   大专
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图