question

Upvotes
Accepted
1.2k 23 31 44

totalCountHint incorrectly set by API for multi-part refresh

The documentation for RsslMap indicates totalCountHint should contain an approximate total for the entire map across a multi-part response. When specifying a hint of zero or none at all the library automatically fills in the count of each single refresh instead. Is this expected?

elektronelektron-sdkrrteta-apielektron-transport-apicaching
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.

FYI: I have moved this question to TREP/UPA forum.

Upvote
Accepted
78.8k 249 52 74

totalCountHint is optional and API should not be able to set its value because it couldn't know the total number of entries across a multi-part response sent by the application.

I believe that the application see the incorrect value because it doesn't verify its presence before accessing it. In UPA, the application should check a RSSL_MPF_HAS_TOTAL_COUNT_HINT flag before accessing the value of totalCountHint.

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.

The hint count is being set as I have fed the message through the value-add payload cache.

Upvote
78.8k 249 52 74

From my test, I found that the value-add payload cache can update totalCountHint properly for the multi-part refresh message.

I sent these three part refresh messages and apply those message to cache.

<refreshMsg domainType="RSSL_DMT_SYMBOL_LIST" streamId="400" containerType="RSSL_DT_MAP" flags="0x11A8 (RSSL_RFMF_HAS_MSG_KEY|RSSL_RFMF_SOLICITED|RSSL_RFMF_HAS_QOS|RSSL_RFMF_CLEAR_CACHE|RSSL_RFMF_HAS_PART_NUM)" groupId="0" partNum="0" qosDynamic="0" qosRate="1" qosTimeliness="1" dataState="RSSL_DATA_OK" streamState="RSSL_STREAM_OPEN" code="RSSL_SC_NONE" text="Item Refresh Completed"  dataSize="24">
    <key  flags="0x3 (RSSL_MKF_HAS_SERVICE_ID|RSSL_MKF_HAS_NAME)"  serviceId="1" name="_UPA_ITEM_LIST"/>
    <dataBody>
        <map flags="0x0" countHint="0" keyPrimitiveType="RSSL_DT_BUFFER" containerType="RSSL_DT_NO_DATA" >
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="TRI" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="RES-DS" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING" >
            </mapEntry>
        </map>
    </dataBody>
</refreshMsg>

<refreshMsg domainType="RSSL_DMT_SYMBOL_LIST" streamId="400" containerType="RSSL_DT_MAP" flags="0x10A8 (RSSL_RFMF_HAS_MSG_KEY|RSSL_RFMF_SOLICITED|RSSL_RFMF_HAS_QOS|RSSL_RFMF_HAS_PART_NUM)" groupId="0" partNum="1" qosDynamic="0" qosRate="1"qosTimeliness="1" dataState="RSSL_DATA_OK" streamState="RSSL_STREAM_OPEN" code="RSSL_SC_NONE" text="Item Refresh Completed"  dataSize="26">
    <key  flags="0x3 (RSSL_MKF_HAS_SERVICE_ID|RSSL_MKF_HAS_NAME)"  serviceId="1" name="_UPA_ITEM_LIST"/>
    <dataBody>
        <map flags="0x0" countHint="0" keyPrimitiveType="RSSL_DT_BUFFER" containerType="RSSL_DT_NO_DATA" >
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING1" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING2" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING3" >
            </mapEntry>
        </map>
    </dataBody>
</refreshMsg>

<refreshMsg domainType="RSSL_DMT_SYMBOL_LIST" streamId="400" containerType="RSSL_DT_MAP" flags="0x10E8 (RSSL_RFMF_HAS_MSG_KEY|RSSL_RFMF_SOLICITED|RSSL_RFMF_REFRESH_COMPLETE|RSSL_RFMF_HAS_QOS|RSSL_RFMF_HAS_PART_NUM)" groupId="0" partNum="2"qosDynamic="0" qosRate="1" qosTimeliness="1" dataState="RSSL_DATA_OK" streamState="RSSL_STREAM_OPEN" code="RSSL_SC_NONE" text="Item Refresh Completed"  dataSize="19">
    <key  flags="0x3 (RSSL_MKF_HAS_SERVICE_ID|RSSL_MKF_HAS_NAME)"  serviceId="1" name="_UPA_ITEM_LIST"/>
    <dataBody>
        <map flags="0x0" countHint="0" keyPrimitiveType="RSSL_DT_BUFFER" containerType="RSSL_DT_NO_DATA" >
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING4" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING5" >
            </mapEntry>
        </map>
    </dataBody>
</refreshMsg>

The following is the message that I got from cache.

<refreshMsg domainType="RSSL_DMT_SYMBOL_LIST" streamId="400" containerType="RSSL_DT_MAP" flags="0x1E8 (RSSL_RFMF_HAS_MSG_KEY|RSSL_RFMF_SOLICITED|RSSL_RFMF_REFRESH_COMPLETE|RSSL_RFMF_HAS_QOS|RSSL_RFMF_CLEAR_CACHE)" groupId="0" qosDynamic="0" qosRate="1" qosTimeliness="1" dataState="RSSL_DATA_OK" streamState="RSSL_STREAM_OPEN" code="RSSL_SC_NONE" text="Item Refresh Completed"  dataSize="60">
    <key  flags="0x3 (RSSL_MKF_HAS_SERVICE_ID|RSSL_MKF_HAS_NAME)"  serviceId="1" name="_UPA_ITEM_LIST"/>
    <dataBody>
        <map flags="0x8 (RSSL_MPF_HAS_TOTAL_COUNT_HINT)" countHint="8" keyPrimitiveType="RSSL_DT_BUFFER" containerType="RSSL_DT_NO_DATA" >
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING1" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING2" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING3" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING4" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="MING5" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="RES-DS" >
            </mapEntry>
            <mapEntry flags="0x0" action="RSSL_MPEA_ADD_ENTRY" key="TRI" >
            </mapEntry>
        </map>
    </dataBody>
</refreshMsg>

The total count hint is set properly.

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.

But can I extract a multi-part refresh from a single large payload cache?

Upvote
78.8k 249 52 74

Refer to UPAValueAddDevGuide.pdf, you can get a multi-part from the cache.

9.3.3.1 Multi-Part Retrieval

...

For multi-part retrieval, the application makes a series of calls to rsslPayloadEntryRetrieve to get the OMM container in fragments (e.g. a sequence of maps are retrieved which together contain the entire set of map entries for the OMM container). In this usage, the optional RsslPayloadCursorHandle is required to maintain the state of the multi-part retrieval.

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.

Wow, great, thank you very much.

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.