apache-camelquickfixfix-protocolquickfixjcamel-quickfix

How to configure QuickFix/J for daily sessions from Monday to Friday?


I am using QuickFix/J 1.6.4 in camel-quickfix component. I would like to have the following session schedule: Daily sessions from Monday to Friday from 6am to 8pm. So the session should start on Monday 6am and stop at Monday 8pm and this for all weekdays. On Saturday and Sunday there sould not be any Session Logon.

Is there a simple configuration I missed for that really common use case? I have seen some workarounds with cron jobs etc. but is there a more elegant way?

I also tried to use a quickfix configuration for every weekday and check which one to use, but I ended up in a CannotSendException an I think the Instances for that one session are in conflict.


Solution

  • Since I have asked for an elegant solution and not after a workaround, the answer is then the upgrade to a newer Camel version. As @TT had written in his comment, QuickFix/J version 2.0.0 and newer have the 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.)

    QuickFix/J version 2.0.0 and newer are included in camel-quickfix since Camel 2.21.0. You can see this for example in the MVNRepository of camel-quickfix.