Code Monkey home page Code Monkey logo

Comments (24)

knows avatar knows commented on May 30, 2024

把你的代码改成 demo,参数具象化贴上来吧,我排查一下

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@knows 需要知道ak/as?没有什么特殊处理就是开启了order: true send时侯有shardkey和key值一样 发送消息后 一直处理于未成功状态 这个时侯有重试 把进程 kill 重新启动 刚才消费未成功的消息 不再消费了 查看后台发现 发送时间是上面的这个 49299-2-16 上午6:16

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@XadillaX @knows 麻烦给看下吧 普通消息没有问题 分区顺序 的貌似有问题

from aliyun-ons.

XadillaX avatar XadillaX commented on May 30, 2024

你把你发送时候的时间参数发一下。 @zhangwenzhao

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

时间参数?是那个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.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

重试过程中reconsumeTimes 这个重试次数也没有增长 进程一挂掉 重新启动就再也收不到了

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

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.

XadillaX avatar XadillaX commented on May 30, 2024

不好意思,我这里无法重现,按你的方法写了个 Demo,并没有出现你说的情况。

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

啊 不会吧 能贴下 你的代码吗?我也用的是readme的demo

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@XadillaX

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

我是这样操作的
1.让消费者ack.done(false) 让他永远失败测试重试
2.重试没有问题失败后一直再重试但是重试次数没有增长但是阻塞了同样shardkey后面的消息这个是对的
3.把当前进程kill掉,重新启动之前的那条消息没有再重试了再也收不到了
@XadillaX

from aliyun-ons.

XadillaX avatar XadillaX commented on May 30, 2024

1、2 都对,第三条我 kill 重启之后仍然能收到。

并且也没出现你所说的日期超级大的情况。

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@XadillaX
setTimeout(function(){
return ack.done(false);
}, 1000)
消费时侯延迟返回状态试试,我发现这种情况延迟时间越长就必现 我用的pm2重启的消费进程

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@XadillaX 我是同一台机器用pm2分别起了生产者和消费者 每个4个进程 会不会和这些有关系?

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

node 版本v7.9.0

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@XadillaX 现在观察 一个现象是ack.done()延迟返回 阿里后台的消息堆积就是空的也就是进程挂后不再重试 是不是onmessage的回调有问题?

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@XadillaX 还是复现不了吗?怎么没有人了尼?

from aliyun-ons.

XadillaX avatar XadillaX commented on May 30, 2024

不好意思,还是没有办法复现,这边无论如何都没有出现过离谱的时间。

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@XadillaX 离谱的时间 可以先忽略 重启进程后收不到这个复现了么?

from aliyun-ons.

XadillaX avatar XadillaX commented on May 30, 2024

@zhangwenzhao 重启收不到的话,目测是阿里云 ONS 自身机制以及其 C++ SDK 的问题——对于已接受但是并没有 ack 的消息的处理上的问题。

这个 SDK 本身就是基于 ONS 官方 C++ SDK 的一个封装。

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@XadillaX 现在的现象是延迟处理ack的话消费进程挂掉后就再也收不到了,不延迟的话是没有问题的 在阿里后台可以看到是这么个现象 延迟的话堆积消息里就没有了,不延迟堆积消息里还有 ,这个是c++sdk的问题么?

from aliyun-ons.

XadillaX avatar XadillaX commented on May 30, 2024

@zhangwenzhao 我想应该是的,毕竟这个 SDK 就是在官方 C++ SDK 外面包了层皮。

from aliyun-ons.

zhangwenzhao avatar zhangwenzhao commented on May 30, 2024

@XadillaX 好的

from aliyun-ons.

XadillaX avatar XadillaX commented on May 30, 2024

如果还是有问题,可以重新打开本 Issue。

from aliyun-ons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.