Replies: 1 comment 1 reply
-
Please take a look at this sample https://github.com/epam/TimeBaseTutorial/blob/main/java/src/main/java/com/epam/deltix/samples/timebase/basics/Step5_QueryData.java And try to check samples here |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have refered below link for reading messages:
https://kb.timebase.info/community/technology/encoding
Problem Statement: Read last best bid and best offer price for every time period(min, sec, hour etc)
I am reading TimeBase data using below code
DXTickDB db = TickDBFactory.createFromUrl (timebaseUrl);
db.open (false);
String query = "select last{} (last(bestt_bid_price)) as best_bid_price_m from bbo_stream OVER time(1m)";
SelectionOptions options = new SelectionOptions();
options.typeLoader = new SimpleTypeLoader(“test.manual.message“,“BBOMessage.class“)
options.raw = false;
try (InstrumentMessageSource cursor = db.executeQuery(query, options)) {
while (cursor.next()) {
BBOMessage message = (BBOMessage) cursor.getMessage();
//rest logic
}
}
Above code giving error at → “while (cursor.next())“
Exception in thread “main“ com.epam.deltix.qsrv.hf.pub.codec.MetaDataBindException : Failed to bind descriptor null
……………………..
caused by: java.lang.ClassNotFoundException: class null is not associated with a run-time class.
This code works perfectly with below query
query = "select * from bbo_stream OVER time(1m)"; which means when all fields are selected
But in my case, I need last bid price and offer price for every minute period.
Even getting issue while using RAW message also.
Please suggest.
Beta Was this translation helpful? Give feedback.
All reactions