I made a program in c# based on the example SubscriptionWithEventHandlerExample
of API 3.2.9.0. After subscribing to about 500 securities for realtime data, I receive some ADMIN event warnings claiming SlowConsumerWarning
and SlowConsumerWarningCleared
. I read somewhere that it introduces some delay, until I process all events.
The problem is that in my code I only receive callbacks from bloomberg. The event queue isn´t even in my program!
Some things that I tried:
raise the queue limit, setting MaxEventQueueSize in the session options (seems to have no effect)
see if I get any timeout event (no, I don't get any)
create multiple sessions and subscribing 50 securities in each (now I get multiple warnings, one for each thread)
Is there something that I can do or this behavior is out of my scope?
You could do the processing of the data in a dedicated thread and only let the Bloomberg callbacks
queue the data. Your data processing thread would read the data from the queue and do any time consuming work. That might solve your problem, depending on what triggers a SlowConsumerWarning
. If your code to process the data is too slow, though, your queue would fill up over time.
The Bloomberg API and associated processes are internally multi-threaded. If you subscribe to a real-time source and don't process the events fast enough so that the events internally start backing up in the Bloomberg API, the API will issue the slow consumer warning. I think at this stage it may also start throttling or dropping events. Are you doing something time-consuming in the event callback (writing to a database)?
The bottom line is that if you subscribe to real-time data for 500 securities events, your event processing has to keep up with the flow of data you've subscribed to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With