question

Upvote
Accepted
16 0 0 4

How to specify a starting position when calling OmmConsumer.submit to replace value in a RIC page

Hi all,


I would like to use the OmmConsumer.submit to update a line in a RIC page, but seems i can only replace the value starting the beginning, but i found it is possible to specify the start position using RtContribute in excel plugin.


My update goes via TREP RAID link to Refinitiv.


Many Thanks

ema-apijava api
icon clock
10 |1500

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

Upvote
Accepted
82.7k 279 53 77

@charlven.tan

It should be an ASCII code, not Unicode or UTF8 characters.

Please refer to the answer in this thread.


icon clock
10 |1500

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

Upvote
32.2k 40 11 20

Hello @denny.c.h.ma ,

Are you publishing pages as field-based records?

If this is the case, each raw is a field, and you may wish to take a look at the article How to parse page-based data using Refinitiv Real-time SDK Java sections Full update and Partial update, consequently, examine the fields you are looking to update and design the partial update.

Hope that this is what you looking for, otherwise, please describe more of the use requirement, and how you are approaching it, so we can try to help.

icon clock
10 |1500

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

Hi Zoya,


Thanks for your response.

we have referenced to the document which you shared and try to partial update value. but still failed. code is like below:

PostMsg postMsg = EmaFactory.createPostMsg();

RefreshMsg nestedRefreshMsg = EmaFactory.createRefreshMsg();

FieldList nestedFieldList = EmaFactory.createFieldList();

char CHAR_CSI = 0x1B2B;

char HPA = 0x60;

String content = "1291 63";

String offset = "3";

String value =

// String.valueOf(new char[]{'\u001B', '\u005B'})

"\u001B\u005B"

+ offset

+ "\u0060"

+ content;

ByteBuffer bb = ByteBuffer.wrap(value.getBytes(StandardCharsets.UTF_8));

bb.rewind();

nestedFieldList.add(EmaFactory.createFieldEntry().rmtes(336, bb));

but the result not expected, the update still start from Position 1 :

We would like to perform a partial update to starting from a specific position.

I am not sure why the offset was not taken effect, will it be related to our update to Refinitiv was sent via TREP RAID link?


Many Thanks

Upvotes
25.3k 89 12 25

Hi @denny.c.h.ma

Can you try using a UpdateMsg instead of a RefreshMsg?

You are trying to do a partial update of a field - so not sure why you are using a RefreshMsg - which would indicate a full and complete message overriding all fields for the record you wish to contribute to.

This may well be a red herring - but I thought I would mention this.

icon clock
10 |1500

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

hi @umer.nalla ,

I just use UpdateMsg instead of RefreshMsg, but the update still start with position 1:

May I know what still wrongly setting ?

many thanks.

char CHAR_CSI = 0x1B2B;
char HPA = 0x60;
String content = "1291  63";
String offset = "3";
String value =
        "\u001B\u005B"
                + offset
                + "\u0060"
                + content;
ByteBuffer bb = ByteBuffer.wrap(value.getBytes(StandardCharsets.UTF_8));
bb.rewind();
FieldList nestedFieldList = EmaFactory.createFieldList();
nestedFieldList.add(EmaFactory.createFieldEntry().rmtes(335, bb));
UpdateMsg nestedRefreshMsg = EmaFactory.createUpdateMsg();
nestedRefreshMsg.payload(nestedFieldList);
PostMsg postMsg = EmaFactory.createPostMsg();
consumer.submit(postMsg.postId(1).serviceName("BSM_MM_PUB
        .name("service_name").solicitAck(true).complete(true)
        .payload(nestedRefreshMsg), handler);

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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