What's the limit on Ema regMsg.payload(ElementList)?

What's the limit on regMsg.payload(ElementList)? Looks like is 3175. Am I doing this right?

import com.refinitiv.ema.access.ElementEntry;
import com.refinitiv.ema.access.ElementList;
import com.refinitiv.ema.access.EmaFactory;
import com.refinitiv.ema.access.OmmArray;
import com.refinitiv.ema.access.OmmConsumer;
import com.refinitiv.ema.access.OmmInvalidUsageException;
import com.refinitiv.ema.access.ReqMsg;
import com.refinitiv.ema.rdm.EmaRdm;
...
void testBatch(FluxSink<String> emitter, Set<String> symbolSet) {
for (int i = 0; i < symbolSet.size(); i++) {
ElementList batch = EmaFactory.createElementList();
OmmArray array = EmaFactory.createOmmArray();
for (String symbol : symbolSet) {
array.add(EmaFactory.createOmmArrayEntry().ascii(symbol));
if (array.size() > i)
break;
}

ElementEntry elementEntry = EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, array);
batch.add(elementEntry);

ReqMsg reqMsg = EmaFactory.createReqMsg();
try {
reqMsg = reqMsg.payload(batch);
} catch (OmmInvalidUsageException u) {
String s = "trep subscription error " + u.toString();
logger.error(s);
emitter.next(s);
emitter.complete();// subscription failed
}
emitter.next("success " + i);
}
}

The result I get here is

...
data:success 3173
data:success 3174
data:success 3175
data:trep subscription error Exception Type='OmmInvalidUsageException', Text='Failed to rsslElementEntry.encode() while encoding rssl elementlist. Reason='INVALID_DATA'', Error Code='-29'

Best Answer

  • Gurpreet
    Answer ✓

    Hi @Patrick Sweeney,

    The Element list can contain a maximum of 65535 bytes of data. So the actual number of instruments it contains will depend on the size of the identifier. This limit is described in the Section 11.3.2 of ElementList in this guide.


    6. An element list currently has a maximum entry count of 65,535, where the first 255 entries may contain set-defined types. This type has an approximate maximum encoded length of 5 gigabytes but may be limited to 65,535 bytes if housed inside of a container entry. The content of element entry has a maximum encoded length of 65,535 bytes. These limitations can change in subsequent releases.