question

Upvotes
Accepted
3 0 0 1

EMA Example: opening item stream with a list of field IDs gets error with code -4048

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


elektronrefinitiv-realtimeelektron-sdkrrtema-apiOMM
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
20.3k 73 10 20

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:

Exception Type='OmmInvalidUsageException' when using fixedWidth in view Array - Forum | Refinitiv Developer Community


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
3 0 0 1

Ok thanks,

array.fixedWidth(2) it works fine!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea