[英]queueCapacity usage for SocketInitiator (QuickFIX/J)
I recently started using the QuickFIX/J library to communicate and send real-time reporting messages to an APA (Approved Publication Arrangement) service using the FIX Protocol. 我最近开始使用QuickFIX / J库与FIX协议进行通信,并将实时报告消息发送到APA(批准的出版安排)服务。
One of the parameters in the SocketInitiator
constructor is queueCapacity
but unfortunately there isn't much information in the documentation about its usage. SocketInitiator
构造函数中的参数之一是queueCapacity
但是不幸的是,文档中没有太多有关其用法的信息。 For what I can see it is used to determine the size of an internal queue for the SocketInitiator
to process messages asynchronously. 对于我所看到的,它用于确定SocketInitiator
异步处理消息的内部队列的大小。 The default value is set to 10000 if not provided via the constructor. 如果未通过构造函数提供,则默认值设置为10000。
I was wondering if there are any guidelines on what value should be used here, whether 10000 is "good enough" and what will happen if the queue capacity max size is reached. 我想知道是否有关于在此处使用什么值,10000是否足够好以及如果达到队列容量最大大小会发生什么的准则。
The queue used in the implementation of SingleThreadedEventHandlingStrategy
in 1.6.3 is a java.util.concurrent.LinkedBlockingQueue
. 在1.6.3的SingleThreadedEventHandlingStrategy
实现中使用的队列是java.util.concurrent.LinkedBlockingQueue
。
The constructor used is public LinkedBlockingQueue(int capacity)
which creates a queue of fixed width. 使用的构造函数是public LinkedBlockingQueue(int capacity)
,它创建固定宽度的队列。 If the maximum capacity is reached and a SessionMessageEvent instance is put
on the queue, the thread putting on the event blocks until space becomes available in the queue (ie until the events in the queue have been processed). 如果达到最大容量并且将SessionMessageEvent实例put
队列中,则放置在事件上的线程将阻塞,直到队列中的空间可用(即,直到队列中的事件已被处理为止)。
I would venture a guess and say that 10000 is enough for 99.9% of the cases where QuickFIX/J is used. 我大胆猜测一下,如果使用QuickFIX / J的99.9%,则10000就足够了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.