For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
0 0 1 1

Python websocket api posting RTDS ADH

Hi


we are trying to post data to our internal RTDS infrastructure using Python API. Our Infra team has created service (TEST_POST_SVC) to publish data on RTDS.


I am using example mentioned in this link https://developers.refinitiv.com/en/article-catalog/article/contributing-data-trep-using-websocket-api#Start


I able to connect to RTDS successfully, when I tried to post message I am getting following error message

""Text":"A9: Service is unavailable."

do we know why I am getting this error?

If I use our RFA/ C# code I can publish message successfully to "TEST_PSOT_SVC" service on our RTDS

but when I use python api then I am getting above mentioned error message


Any helpful tip to resolve this issue is appreciated


Thanks

Dhruvesh



python#technologywebsocketsService
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.

Upvotes
Accepted
77.5k 242 52 72

@dpatel1

You can use OMM posts to send messages to an interactive provider, a non-interactive service, or an RTDS cached service.

1670986806047.png

In your case, I assume that you would like to post messages to an interactive provider. First, you need to start an interactive provider to make the service up. The login response of an interactive provider must support OMM post.

<refreshMsg domainType="RSSL_DMT_LOGIN" streamId="1" containerType="RSSL_DT_NO_DATA" flags="0x168 (RSSL_RFMF_HAS_MSG_KEY|RSSL_RFMF_SOLICITED|RSSL_RFMF_REFRESH_COMPLETE|RSSL_RFMF_CLEAR_CACHE)" groupId="0" dataState="RSSL_DATA_OK" streamState="RSSL_STREAM_OPEN" code="RSSL_SC_NONE" text="Login accepted by host replablinux4."  dataSize="0">
    <key  flags="0x26 (RSSL_MKF_HAS_NAME|RSSL_MKF_HAS_NAME_TYPE|RSSL_MKF_HAS_ATTRIB)"  name="rmds" nameType="1" attribContainerType="RSSL_DT_ELEMENT_LIST">
        <attrib>
            <elementList flags="0x8 (RSSL_ELF_HAS_STANDARD_DATA)">
                <elementEntry name="AllowSuspectData" dataType="RSSL_DT_UINT" data="1"/>
                <elementEntry name="ApplicationId" dataType="RSSL_DT_ASCII_STRING" data="256"/>
                <elementEntry name="Position" dataType="RSSL_DT_ASCII_STRING" data="127.0.0.1"/>
                <elementEntry name="ProvidePermissionProfile" dataType="RSSL_DT_UINT" data="0"/>
                <elementEntry name="ProvidePermissionExpressions" dataType="RSSL_DT_UINT" data="1"/>
                <elementEntry name="SingleOpen" dataType="RSSL_DT_UINT" data="0"/>
                <elementEntry name="SupportPauseResume" dataType="RSSL_DT_UINT" data="0"/>
                <elementEntry name="SupportStandby" dataType="RSSL_DT_UINT" data="0"/>
                <elementEntry name="SupportBatchRequests" dataType="RSSL_DT_UINT" data="4"/>
                <elementEntry name="SupportViewRequests" dataType="RSSL_DT_UINT" data="0"/>
                <elementEntry name="SupportOMMPost" dataType="RSSL_DT_UINT" data="1"/>
            </elementList>
        </attrib>
    </key>
    <dataBody>
    </dataBody>
</refreshMsg>

Otherwise, you will get "F26: Server does not support inserts".


1670986806047.png (26.5 KiB)
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.

Thanks , Let me share above feed back with RTDS team. I am using the community provided Python code with "ws" and it same code can be used with your suggestion .

Dhru

I was looking into our existing C# code/libraries which does uses RFA config file for RSSL connectivity and I couldn't find any settings where I can define "SupportOMMPost".


I was wondering if any example available which I can use to define "SupportOMMPost"?


Also, our goal is to POST messages using Python to our internal TREP infrastructure, so we are ok to try any approach which can work with interactive provider, non interactive provider or Cache Service. I was also wondering which developer document I should refer if I wanted to get more idea about difference between interactive vs non-interactive vs cached service? I am newbie to refinitive API ( have used pre-cofigured code)

Thanks for your help and suggestion so far.


Upvotes
77.5k 242 52 72

@dpatel1

Sorry about the issue that you are facing.

The following is the definition of this error in the ADS Installation Manual.

If the insert request cannot be completed because the service is unavailable, the ADS generates an Insert NAK with this status text 

I think the service may be down so you are unable to post items to this service.

You can use the following source request to get all available services and statuses in RTDS.

{
    "ID": 2,
    "Domain": "Source",
    "Key": {
        "Filter": 1
    }
}

You may try to add TEST_POST_SVC into the ADS cacheServiceList configuration.

*ads*cacheServiceList: TEST_POST_SVC

! *ads*cacheServiceList :
!#help
!    cacheServiceList: [<ServiceName1>], [<ServiceName2>] ...
!
!    This parameter is a comma-separated list of service names as published
!    by the ADS. Each defined service will be created on startup of the ADS
!    to provide a non-interactive cache for insert and OMM post message content.
!
!    These services can be used in conjunction with the aggregateServiceList
!    parameter to provide RSSL publisher applications the ability to provide
!    additional content to the same server cache.
!
!    Default value: none
!#end

How did you publish items to this service with RFA? Are you using RFA non-interactive provider (StarterProvider_NonInteractive) to publish data to this service?

I hope that this information is of 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.

our app support has added entry in "cacheServiceList" still we having issue to post the data.

If I send the following request the I don't see "TEST_POST_SVC " service in the response

  1. {
  2. "ID": 2,
  3. "Domain": "Source",
  4. "Key": {
  5. "Filter": 1
  6. }
  7. }

But if I start our RFA publisher which connect to "TEST_POST_SVC" then I do see it's in response of above request. However while "TEST_POST_SVC" is online by c# RFA publishe if I try to post data using python api I am receiving following error

RECEIVED:

[

{

"AckID":41,

"ID":1,

"Key":{

"Name":"EUR=",

"Service":"TEST_POST_SVC "

},

"NakCode":"DeniedBySrc",

"Text":"F26: Server does not support inserts.",

"Type":"Ack"

}

]


I think we need to figure out

- how "TEST_POST_SVC " service online all the time

- Allow the Python api to POST data without any error message regarding "Server does not support inserts"


Thanks

Dhruvesh





Hi


Our app support added the "TEST_POST_SVC " to cacheServiceList and we still having same issue.

"TEST_POST_SVC" is not online by default so when Python code try to post the message it receive the error ""Text":"A9: Service is unavailable."

Other alternate we tried to run our C#/RFA code which connect to "TEST_POST_SVC" and we do see "TEST_POST_SVC" online. Once ""TEST_POST_SVC" online we try to run on Python code to POST the message we getting following error

"NakCode":"DeniedBySrc", "Text":"F26: Server does not support inserts.", "Type":"Ack"


So I was wondering

- "TEST_POST_SVC" supposed to be online all the time or it should come up online when Python code try to POST the message like C#/RFA code


Thanks for your help

Dhru



Upvote
25.3k 87 12 25

Hi @dpatel1

As advised by @Jirapongse - the most likely/common explanation for Posting not working is that the service has not been correctly configured on your ADH RTDS component.
Please see the following article Contributing your data to Refinitiv | Devportal - and/or ask your RTDS team to contact RTDS support at Refinitiv for guidance.

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.

Thank you for providing the informative link. I will check our RTDS team

Dhru

Upvotes
77.5k 242 52 72

@dpatel1

The SupportOMMPost attribute must be set in the interactive provider. The interactive provider will advertise it in the login response sent to ADH. If it sets the value of the SupportOMMPost attribute to zero, this indicates that the interactive provider can't accept post messages from consumers.

You can refer to the RFA Quick Start Guide in the RFA package regarding interactive vs non-interactive providers. Otherwise, you can check the ETA Developers Guide in Section 3.2.6 Posting.

First, you need to configure RTDS properly before using APIs. You may need to contact the RTDS support team directly via MyRefinitiv regarding how to configure RTDS to support non-interactive providers or cached services.


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.

Upvotes
0 0 1 1

Thank you. I will look into documentation you suggested. Our RTDS team thinks all the configuration are done properly on their side so should be issue in the API so I am trying to figure out how can I verify. since Python code is trying to post the message and I don't have proper example of interactive provide where I can set up SupportOMMPost

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.

Upvotes
77.5k 242 52 72

@dpatel1

The StarterProvider_Interactive example is available in the package. It demonstrates how to encode a login response message including advertising the SupportOMMPost attribute.

1672193539477.png


1672193539477.png (47.0 KiB)
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.

Upvotes
0 0 1 1

I have used example "StarterProvider_Interactive" from RFA Package. I also enable SUPPORT_POST_FLAG. When I execute the code I do see "TEST_POST_SVC" is online


Then I have started the python code with and try to send the POST request to "TEST_POST_SVC".

It invokes "ProcessOMMSolicitedItemEvent(OMMSolicitedItemEvent evnt)" in "StarterProvider_Interactive.cs" which has only message handling for "Message.MsgTypeEnum.GenericMsg" and "Message.MsgTypeEnum.ReqMsg" So I added message handling for "Message.MsgTypeEnum.PostMsg" (e.g print evnt.toString())

however when Python code try to post I am still receiving error (different error this time) see below

thanks for helpful suggestions so far I think I am getting closer and might be needed some minor tweak to make it work


SENT:

{

"Ack":true,

"ID":1,

"Key":{

"Name":"XEUR=BX",

"Service":"TEST_POST_SVC"

},

"Message":{

"Fields":{

"ASK":27.83,

"BID":26.62,

"TRDPRC_1":27.09

},

"ID":0,

"Type":"Update"

},

"PostID":11,

"Type":"Post"

}

RECEIVED:

[

{

"AckID":8,

"ID":1,

"Key":{

"Name":"XEUR=BX",

"Service":"TEST_POST_SVC"

},

"NakCode":"NoResponse",

"Text":"F5: Source application did not respond. Insert request timeout. Please retry.",

"Type":"Ack"

}

]


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.

Upvotes
0 0 1 1

I think I am making progress and StateProvider_Post example helped me to make interactive posting and I am able to post data using Python (On-Stream)

thanks for your help. If any issue I will try to update on this post

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.

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.