Hi Ranadheer,
Just a piece of advice, but you may want to try to keep your types as strict as possible... i.e. instead of using a general map to store the parameters, use an additional type to keep everything easy to represent. Something like:
message Tick {
string subject = 1; // name of the financial instrument - something like MSFT, GOOG, etc
uint64 timestamp = 2; //millis from epoch signifying the timestamp at which the object is constructed at the publisher side.
TickData tick_data = 3;
}
message TickData {
float ask_price = 1;
float bid_price = 2;
float trade_price = 3;
uint32 trade_size = 4;
}
or even better, just add all the components into one message:
message Tick {
string subject = 1; // name of the financial instrument - something like MSFT, GOOG, etc
uint64 timestamp = 2; //millis from epoch signifying the timestamp at which the object is constructed at the publisher side.
float ask_price = 3;
float bid_price = 4;
float trade_price = 5;
uint64 trade_size = 6;
...
}
... adding any other possible fields you might have in your data. As well as being a lot more compact on-the-wire for bandwidth and CPU improvements, this forces you to think about your data and what might be in it, which will result in a lot less bugs down the road for you and your client consumers. You won't have to worry about typos like accidentally typing 'bid_prce' or 'bidPrice' or 'bidprice' in the Map.
Protobuf will not send any fields that are different from their default values, so you don't pay any performance penalty for having a lot of optional data in the Tick message. You can also still add fields later to the message, while keeping backwards compatibility with old consumers.
Also, another little pedantic thing, but if you are using the timestamp like Javascript's Date.now(), always name it timestamp_utc instead of just timestamp... eventually someone will stuff a local time in there and confuse everyone... better to be explicit.
Kevin