For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 0 2 1

A connection attempt failed because the connected party did not properly respond after a period of time

Hi there,

Any one has experienced 'a connection attempt ...' exceptions calling https://hosted.datascopeapi.reuters.com/RestApi/v1/ api from Azure Function (Premium plan). The api calls experiencing this issue are particularly ExtractWithNotes and ValidateIdentifiers using Refinitiv Rest Api Client Dlls ?

I was advice that this is to do with packet drops/blocks from Refinitiv security device at TCP level. Could you share what changes on Azure function application and/or cloud settings to help preventing this issue?

Exception detail

---------------------

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.Exception stack trace : ThomsonReuters.Dss.Api.TransportException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)

dss-rest-apidatascope-selectdsstime-outazure
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.

More info: These errors from DSS api requests are intermittent.

Hello @zohan.sim1

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvotes
Accepted
79.1k 250 52 74

@zohan.sim1

I have tested with the simple function with DSS API and it works fine.

I use the ElektronTimeseriesExtractionRequest.

            var extractionRequest = new ElektronTimeseriesExtractionRequest()
            {
                IdentifierList = new InstrumentIdentifierList()
                {
                    InstrumentIdentifiers = new[] { new InstrumentIdentifier { Identifier = "IBM.N", IdentifierType = IdentifierType.Ric } }
                },
                Condition = new ElektronTimeseriesCondition
                {
                    ReportDateRangeType = ReportDateRangeType.Range,
                    QueryStartDate = new DateTimeOffset(new DateTime(1990, 1, 1)),
                    QueryEndDate = new DateTimeOffset(new DateTime(2020, 9, 20)),
                    LastEntityOnly = false
                },
                ContentFieldNames = new[]{
            "Ask", "Bid", "High", "Last", "Low", "Trade Date"
                },
            };
            var extractionResult = ExtractionsContext.ExtractWithNotes(extractionRequest);
            var extractedRows = extractionResult.Contents;

Please share the code that you are using including the date range, content field names, and identifier list.



1600760764522.png (73.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.

Upvotes
1 0 2 1

The Azure func app is set to run in interval says every 30 mins. Within 30 mins, we make price request in batches, so in average, we could be making 20-40 api calls in 30 mins window, to extract prices for our predefined set of tickers. The app calls the validate function first before calling eod extraction function.

The error appears intermittent, however it can be pretty bad during the day time, e.g happen in the whole 1 or 2 hours. Comparing errors at night, there are less of these errors comparing with the day time.

I was informed that Refinitiv have security in place to block TCP ports that are being reused too quickly.

So few questions:

1. In your code example, any way to set some kind of settings to ExtractionsContext, ExtractionsContext.ExtractWithNotes, in such away preventing the block? or any code advice in general?

2. can ExtractionsContext class (deriving from Refinitiv client dlls) work in cloud environment such as Azure function compatible? or we may need to use HttpClient for api calls ?

3. do you have Azure function in production environment? Any advice on what to set for the Premium plan environment to prevent this error?

-----------------------------------------

Here are the codes:

public List<string> ValidateTickers(List<string> tickers)

{

InstrumentIdentifier[] instrumentIdentifiers = PopulateInstrumentIdentifiers(tickers);

var validatedIdentifiers = _extractionsContext.InstrumentListOperations.ValidateIdentifiers(instrumentIdentifiers, true);


var validTickers = validatedIdentifiers.ValidatedInstruments.Select(x =>x.Identifier).ToList();

return validTickers;

}

public ExtractionResult CreateAndRunEodPricingExtraction( List<string> tickers, List<string> tickerFields)

{

_extractionType = ExtractionType.EndOfDay;


InstrumentIdentifier[] instrumentIdentifiers = PopulateInstrumentIdentifiers(tickers);


//Create an on demand extraction, of type EndOfDayPricingExtractionRequest:

EndOfDayPricingExtractionRequest extractionEod = new EndOfDayPricingExtractionRequest

{

IdentifierList = InstrumentIdentifierList.Create(instrumentIdentifiers),

ContentFieldNames = tickerFields.ToArray()

};


//Run the extraction.

return _extractionsContext.ExtractWithNotes(extractionEod);

}

NOTE:

_extractionsContext is a type of ExtractionsContext.

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.

@zohan.sim1

I suggest you contact the DSS support team via MyRefinitv to verify the server log for your login at the time when the problem occurred. The DSS support team may be able to identify the problem.

1600834368910.png (16.4 KiB)

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.