我正在使用QuickFix/J 1.6.4 于 camel-quickfix成分。我想要以下类(class)安排:周一至周五每天上午 6 点至晚上 8 点。因此, session 应于周一上午 6 点开始,并于周一晚上 8 点停止,所有工作日均如此。周六和周日不得有任何 session 登录。
对于这个真正常见的用例,我是否错过了一个简单的配置? 我已经看到了一些 cron 作业等的解决方法,但是有更优雅的方法吗?我还尝试在每个工作日使用快速修复配置并检查使用哪个配置,但我最终得到了 CannotSendException an 我认为该 session 的实例存在冲突。
最佳答案
由于我要求一个优雅的解决方案,而不是在解决方法之后,答案就是升级到更新的 Camel version 。正如@TT 在他的评论中所写,QuickFix/J版本 2.0.0 及更高版本有 Weekdays configuration .
For daily sessions that are active on specific days of the week. Use in combination with StartTime and EndTime. Incompatible with StartDay and EndDay. If StartTime is before EndTime then the day corresponds to the StartTime.
Comma-delimited list of days of the week in the default locale (e.g. "Sun,Mon,Tue", "Dimanche,Lundi,Mardi" etc.)
自 Camel 2.21.0 起,QuickFix/J 版本 2.0.0 及更高版本包含在 Camel-quickfix 中。例如,您可以在 MVNRepository of camel-quickfix 中看到这一点。 .
关于apache-camel - 如何为周一至周五的每日 session 配置 QuickFix/J?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57406970/