Hi the following code (taken from the EMA Example series consumer/series300/ex360_MP_View:
ReqMsg reqMsg = EmaFactory.createReqMsg()
.name("/IBN.N")
.serviceName("ELEKTRON_DD")
.domainType(6);
ElementList view = EmaFactory.createElementList();
OmmArray array = EmaFactory.createOmmArray();
array.fixedWidth(5);//Subscribe to 5 fields
array.add(EmaFactory.createOmmArrayEntry().intValue(19));
array.add(EmaFactory.createOmmArrayEntry().intValue(22));
array.add(EmaFactory.createOmmArrayEntry().intValue(134));
array.add(EmaFactory.createOmmArrayEntry().intValue(15));
array.add(EmaFactory.createOmmArrayEntry().intValue(25));
view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
//!!!!!THIS LIVE THROWS AN EXCEPTION
view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));
And teh exception is:
Exception Type='OmmInvalidUsageException', Text='Unsupported fixedWidth encoding in encoding entry of Int type. Fixed width='5'. ', Error Code='-4048'
If I try with 4 fields it work correctly!
Thank you
Hi @DimAngelNX
Please see this article Enterprise Messaging API (Java) - Batch and View features | Refinitiv Developers
The FixedWidth method is not for the number of fields - it sets the fixed width of each array entry size - you can leave it the value of 2 (as used in the examples)
You may also find the following previous post useful:
Migrating from sfc to EMA, NoDictionary errorcode.
getting OmmInvalidUsageException when I am running example
Exception occurred: com.sun.jdi.InvocationException occurred invoking method..
Programmaticaly configured OmmConsumerConfig
(JAVA) Does using interestAfterRefresh(false) remove the need for deregistering items with Elektron?