Closed subes closed 2 years ago
Though it seems the error can be ignored since it only gets logged:
private void handleSummaryUpdateMessage(String[] csv, Level1MessageType messageType) {
try {
SummaryUpdate summaryUpdate = summaryUpdateCSVMapper.map(csv, 1);
FeedMessageListener<SummaryUpdate> listener =
summaryUpdateListenersOfSymbols.get(summaryUpdate.getSymbol());
if (listener == null) {
LOGGER.error("Received SummaryUpdate, but no listener for symbol {} exists!",
summaryUpdate.getSymbol());
} else {
switch (messageType) {
case SUMMARY_MESSAGE:
summaryUpdate.setType(SummaryUpdate.Type.SUMMARY);
break;
case UPDATE_MESSAGE:
summaryUpdate.setType(SummaryUpdate.Type.UPDATE);
break;
}
listener.onMessageReceived(summaryUpdate);
}
} catch (Exception exception) {
LOGGER.error("Could not handle SummaryUpdate message!", exception);
}
}
@subes yes I've experienced this issue on the Level 1 Feed before (it's extremely rare though). I'm not sure why IQFeed decides to send trade data with 99:99:99.139000
as the time of a SummaryUpdate
(as shown in your given stacktrace). I purposefully made that handleSummaryUpdateMessage
method to only print the exception instead of throw it to the listener in the event that some data couldn't be mapped. So worse-case scenario, your trading algo/application doesn't receive a trade with an invalid timestamp, but perhaps that's actually a good thing (so invalid timestamps don't throw exceptions on the feed's thread and abruptly terminate the level 1 feed).
I'm closing this issue as you can just ignore that exception. I would recommend contacting IQFeed developer support if it keeps happening (I have not seen this happen to my trading application in a long time and I am listening to level 1 data for over 1500 high-market-cap tickers, so perhaps this issue is localized to small-cap tickers?).
Thanks for the info. This happens on XG# or XG#C (thus fdax). I also only had this a few times in the log. Might be helpful to have an option to log invalid messages so one knows how the complete invalid message looked like? Though I guess iqfeed.exe might have a debug log option? Though would be ideal if the exception contained the message in a string format.
IQFeed4j does indeed have an option to log all Level 1 messages that are received. You can do so by setting the net.jacobpeterson.iqfeed4j.feed.streaming.level1.Level1Feed
logger level to TRACE
using your logger implementation. Yes you can also log all messages in iqfeed.exe.