vert.x中事件总线的大小 [英] Size of event bus in vert.x
本文介绍了vert.x中事件总线的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用vert.x读取文件并进行转换,然后推送到kafka. 我正在使用2个顶点,而不使用任何工作线程(我不想更改文件中日志的顺序).
Verticle 1 : Read the file and filter
Verticle 2 : Publish to kafka
每个文件包含大约120000行
但是,我观察到一段时间后,我不再观察第1层的原木. 我怀疑事件总线已满,因此消费者仍在使用,但是生产者线程正在等待事件总线变空.
所以我的问题是 1.事件总线的默认大小是多少?在文档中说
DEFAULT_ACCEPT_BACKLOG
The default accept backlog = 1024
2.如何确认怀疑发布者线程已被阻止?
解决方案
VertX在其事件总线内部使用Netty的SingleThreadEventLoop
, 解决方案
VertX uses Netty's SingleThreadEventLoop
internally for its event bus, maximum pending tasks allowed is Integer.MAX_VALUE which is probably 2 billion messages.
You may have to try VertxOptions.setWarningExceptionTime(long warningExceptionTime)
to set the value lower than default (5sec) to see if there is any warning about blocked thread.
这篇关于vert.x中事件总线的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文