Comments (24)
把你的代码改成 demo,参数具象化贴上来吧,我排查一下
from aliyun-ons.
@knows 需要知道ak/as?没有什么特殊处理就是开启了order: true send时侯有shardkey和key值一样 发送消息后 一直处理于未成功状态 这个时侯有重试 把进程 kill 重新启动 刚才消费未成功的消息 不再消费了 查看后台发现 发送时间是上面的这个 49299-2-16 上午6:16
from aliyun-ons.
@XadillaX @knows 麻烦给看下吧 普通消息没有问题 分区顺序 的貌似有问题
from aliyun-ons.
你把你发送时候的时间参数发一下。 @zhangwenzhao
from aliyun-ons.
时间参数?是那个delay? 那个没有传
store.producer().send(key, config.ons.topic, tag, body, key, function(err, messageId) {
消费消息时是这样的
message { topic: 'msb-friends-dev',
tag: 'TOPIC_PUB',
key: '859349075781357568',
msgId: '65251A2B000000000000E52301000000',
startDeliverTime: 0,
body: '{"mid":"859349075781357568","uid":1,"text":"\u4e00\u4e2a\u6d4b\u8bd5888888888888888888888888888888","status":1,"create_at":1493719760258}',
reconsumeTimes: 0 }
重试
message { topic: 'msb-friends-dev',
tag: 'TOPIC_PUB',
key: '859349075781357568',
msgId: '65251A2B000000000000E52301000000',
startDeliverTime: 0,
body: '{"mid":"859349075781357568","uid":1,"text":"\u4e00\u4e2a\u6d4b\u8bd5888888888888888888888888888888","status":1,"create_at":1493719760258}',
reconsumeTimes: 0 }
我把当前消费的进程kill掉之后重新启动 这个消息就再也收不到了
from aliyun-ons.
重试过程中reconsumeTimes 这个重试次数也没有增长 进程一挂掉 重新启动就再也收不到了
from aliyun-ons.
config.ons = {
consumerId: 'CID_ZWZ_DEV'
, producerId: 'PID_ZWZ_DEV'
, topic: 'msb-friends-dev'
, tags: '*'
, accessKey: 'xxxxxx'
, secretKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
, options: {
order: true,
onsAddr: "http://onsaddr-internet.aliyun.com/rocketmq/nsaddr4client-internet",
threadNum: 3
}
};
这个是配置文件
from aliyun-ons.
不好意思,我这里无法重现,按你的方法写了个 Demo,并没有出现你说的情况。
from aliyun-ons.
啊 不会吧 能贴下 你的代码吗?我也用的是readme的demo
from aliyun-ons.
from aliyun-ons.
我是这样操作的
1.让消费者ack.done(false) 让他永远失败测试重试
2.重试没有问题失败后一直再重试但是重试次数没有增长但是阻塞了同样shardkey后面的消息这个是对的
3.把当前进程kill掉,重新启动之前的那条消息没有再重试了再也收不到了
@XadillaX
from aliyun-ons.
1、2 都对,第三条我 kill 重启之后仍然能收到。
并且也没出现你所说的日期超级大的情况。
from aliyun-ons.
@XadillaX
setTimeout(function(){
return ack.done(false);
}, 1000)
消费时侯延迟返回状态试试,我发现这种情况延迟时间越长就必现 我用的pm2重启的消费进程
from aliyun-ons.
@XadillaX 我是同一台机器用pm2分别起了生产者和消费者 每个4个进程 会不会和这些有关系?
from aliyun-ons.
node 版本v7.9.0
from aliyun-ons.
@XadillaX 现在观察 一个现象是ack.done()延迟返回 阿里后台的消息堆积就是空的也就是进程挂后不再重试 是不是onmessage的回调有问题?
from aliyun-ons.
@XadillaX 还是复现不了吗?怎么没有人了尼?
from aliyun-ons.
不好意思,还是没有办法复现,这边无论如何都没有出现过离谱的时间。
from aliyun-ons.
@XadillaX 离谱的时间 可以先忽略 重启进程后收不到这个复现了么?
from aliyun-ons.
@zhangwenzhao 重启收不到的话,目测是阿里云 ONS 自身机制以及其 C++ SDK 的问题——对于已接受但是并没有 ack 的消息的处理上的问题。
这个 SDK 本身就是基于 ONS 官方 C++ SDK 的一个封装。
from aliyun-ons.
@XadillaX 现在的现象是延迟处理ack的话消费进程挂掉后就再也收不到了,不延迟的话是没有问题的 在阿里后台可以看到是这么个现象 延迟的话堆积消息里就没有了,不延迟堆积消息里还有 ,这个是c++sdk的问题么?
from aliyun-ons.
@zhangwenzhao 我想应该是的,毕竟这个 SDK 就是在官方 C++ SDK 外面包了层皮。
from aliyun-ons.
@XadillaX 好的
from aliyun-ons.
如果还是有问题,可以重新打开本 Issue。
from aliyun-ons.
Related Issues (20)
- producer 如何指定 mqttSecondTopic,两个consumer 消息会重复怎么搞 HOT 2
- 提示 Segmentation fault HOT 5
- Error: Error relocating /app/node_modules/ons/build/Release/ons.node: backtrace_symbols: symbol not found HOT 6
- 中文文档send()参数顺序错误 HOT 1
- [需求]作者有没有计划基于RocketMQ来实现 HOT 6
- npm install --save ons windows linux 都安装不了 HOT 1
- Working with a local instance of RocketMq HOT 1
- 还更新吗? HOT 1
- 请教下,怎么连TCP协议? HOT 1
- 包安装出错
- 稳定性有保障吗 HOT 2
- 棒
- 请问这个库支持连接rocketmq集群吗 HOT 2
- 安装失败 HOT 1
- To based on rocketmq-nodejs SDK
- options参数设置太少
- the error when pass `undefined` options to producer HOT 1
- One CID can't subscribe two Topic
- 创建生产者错误,这是为什么? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliyun-ons.