How can I get the key in string type?

I am currently receiving market information for the RIC codes NQZ4 and ESZ4, with the domain type set to MARKET_BY_PRICE.

The code I am using generates a unique key for each order in the order book entry, followed by the associated fields.

Map.getEntry().getKey().getBuffer()

Item Name: ESZ24
Service Name: hEDD
Map Summary data:
Name: SEQNUM Value: 1.66947e+07
Name: ACTIV_DATE Value: 11 / 12 / 2024
Name: TIMACT_MS Value: 37283853
Name: TIMACT_NS Value: 10:21:23:853

Action = Update, key = 3132 3a36 3035 3232 352f 32 12:605225/2

Entry data:
Name: ORDER_TONE Value: 1
Name: NO_ORD Value: 37
Name: ACC_SIZE Value: 76
Name: LV_TIM_NS Value: 10:21:23:853
Name: LV_TIM_MS Value: 37283853
Name: LV_DATE Value: 11 / 12 / 2024
Name: ORDER_PRC Value: 6052.25
Name: ORDER_SIDE Value: ASK

My question is: How can I retrieve the key as a string? I attempted the following code, but it did not work as expected, resulting in truncated values.

const EmaBuffer& keyBuff = map.getEntry().getKey().getBuffer();



std::string key(keyBuff.c_buf(), keyBuff.length());

Output : Key : 12:605225/2

Could you assist me with this?

Best Answer

Answers