JSON RSSL Conversion Error. RSSL error code : -21 error

Kacper_Piernicki1
edited October 3 in WebSocket API

Hello,

I would like to ask you for advice on error message that my client received: “JSON RSSL Conversion Error. RSSL error code : -21”.

Client is using below example:

https://github.com/Refinitiv/websocket-api/blob/master/Applications/Examples/CSharp/MarketPriceExample/MarketPriceExample.cs

Basically he is making batch request (approximately 8K RICs) and then error message appear. When he decrease number of RICs He is making batch request (approximately 8K RICs).

Also he notice that when he send smaller number of RIC in his request that usually work but add there View parameter in order to limit number of Fields in response error also appear.

So is there any limit of RICs that you can include in request or maybe it depend on request size?

There is BUFFER_SIZE parameter in example, will this improve situation if client increases this parameter?

I will be grateful for your advice!

Tagged:

Best Answers

  • Gurpreet
    Gurpreet admin
    edited October 2 Answer ✓

    Hello @Kacper_Piernicki1

    Since the user is using the Websockets API, the RSSL to JSON Conversion is happening at the RTMDS infrastructure. They can look at the ADS logs to see where the offending value is. The BUFFER_SIZE parameter allocates the send and receive buffers for Websockets, so increasing it might help with the issue.

    In general, in this use case, I would recommend the RTSDK instead of Websockets. In WS, the application has to maintain all the state and handshake requirements in addition to handling the response messages. Using RTSDK .NET (EMA) is considerably easier and it handles all the underlying work for the user. The user app is also working with a large batch of instruments and it might overwhelm the network at peak market activity.

    The user can start from this EMA batch sample and add View feature. No RSSL to JSON conversion would be required and there will be efficient transfer of the binary data.

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @Kacper_Piernicki1

    In RSSL, the -21 error code is BufferTooSmallEnum.

    BufferTooSmallEnum = -21, /*!< The buffer provided does not have sufficient space to perform the operation. */

    The JSON request may be too large for a buffer reserved by ADS so the client may need to reduce the size of the JSON request message.

    I checked and found that in the login response contains the MaxMsgSize property.

        {
    "ID": 1,
    "Type": "Refresh",
    "Domain": "Login",
    "Key": {
    "Name": "<DACS Username>",
    "Elements": {
    "AllowSuspectData": 1,
    "ApplicationId": "256",
    "ApplicationName": "ADS",
    "Position": "127.0.0.1/net",
    "ProvidePermissionExpressions": 1,
    "ProvidePermissionProfile": 0,
    "SingleOpen": 1,
    "SupportEnhancedSymbolList": 1,
    "SupportOMMPost": 1,
    "SupportPauseResume": 1,
    "SupportStandby": 1,
    "SupportStandbyMode": 3,
    "SupportBatchRequests": 7,
    "SupportViewRequests": 1,
    "SupportOptimizedPauseResume": 1
    }
    },
    "State": {
    "Stream": "Open",
    "Data": "Ok",
    "Text": "Login accepted by host 86dd62c6c51e."
    },
    "Elements": {
    "PingTimeout": 30,
    "MaxMsgSize": 65535
    }
    }

    The size of message should not exceed this value.