Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

消费者减完后,还可以正常接收请求吗? #1

Closed
allon2 opened this issue Dec 30, 2019 · 10 comments
Closed

消费者减完后,还可以正常接收请求吗? #1

allon2 opened this issue Dec 30, 2019 · 10 comments

Comments

@allon2
Copy link

allon2 commented Dec 30, 2019

消费者减完后,还可以正常接收请求吗?我做了一下减消费者,发现无法正常接收消费者

@Rookiexu
Copy link
Owner

减消费者会丢掉一个消息,但是还是可以继续接收消费者的....丢消息的问题,我向disruptor提交了一个pr,你可以看一下

@Rookiexu
Copy link
Owner

丢消息的部分,我在自己项目里面是改了disruptor源码重新编译出了一个jar包来用的

@allon2
Copy link
Author

allon2 commented Dec 30, 2019

我现在是减消费者后,请求的消息无法进入队列中,更糟糕

@allon2
Copy link
Author

allon2 commented Dec 30, 2019

丢消息部分的代码可以分享一下吗?

@Rookiexu
Copy link
Owner

https://github.com/LMAX-Exchange/disruptor/pull/287/files 这是提交的pr....你是自己的项目出了问题还是我的示例出了问题呢?

@allon2
Copy link
Author

allon2 commented Dec 30, 2019

不知道哦,我按照你这个做了一个简单的

` WorkProcessor tprocessor= processorList.get(0);

    tprocessor.halt();

    ringBuffer.removeGatingSequence(tprocessor.getSequence());`

基本也就是这样的

@allon2
Copy link
Author

allon2 commented Dec 30, 2019

写减消费者的时候还有其他需要注意的地方吗?

@Rookiexu
Copy link
Owner

你的队列长度是多少,减了多少消费者呢

@allon2
Copy link
Author

allon2 commented Dec 30, 2019

队列长度是1024,测试的时候,消费者是从10个减到1个

@Rookiexu
Copy link
Owner

需要修改disruptor的代码,参考我的pr LMAX-Exchange/disruptor#287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants