This is related to my previous issue found here:
https://community.developers.refinitiv.com/questions/106792/fetching-newsstory-via-api-not-working-cnet-framew.html. After 14 days of going back and forth with the Refinitiv Helpdesk to no avail, they ultimately just pointed me back to the Developer's Forum.
I'm trying to fetch the news story of an incoming news item in real-time using the Pricing Library's streaming mechanism. First, I'm filtering for the main newswires such as Accesswire, Business Wire, Globe Newswire, and PR Newswire, and I've reversed engineered the storyID from the PNAC field as such:
var stream = Pricing.Definition().Universe("NFCP_UBMS").GetStream()
.OnUpdate((item, update, s) => DisplayUpdate(item, update))
.OnError((item, err, s) => Console.WriteLine(err));
private void DisplayUpdate(string item, JObject update)
{
var fields = update["Fields"];
string newsSource = (string)fields["ATTRIBTN"];
string PNAC = (string)fields["PNAC"];
if ((newsSource == "ACSWIR" || newsSource == "BSW" || newsSource == "GNW" || newsSource == "PRN"))
{
string storyID = "urn:newsml:reuters.com:" + DateTime.Now.ToString("yyyyMMdd") + ":" + PNAC + ":1";
getNewsStoryBody(storyID);
}
}
I then use the storyID to fetch the news body as such:
public async void getNewsStoryBody(string storyID)
{
if (DateTime.Now.AddMilliseconds(-5000) > newsRequestStartTime) // Took too long due to multiple requests
{
Console.WriteLine("Could not fetch news body from server");
return;
}
await Task.Run(() =>
{
var story = Story.Definition(storyID).GetData();
if (story.IsSuccess)
{
Console.WriteLine("Retrieved news body: " + story.Data.NewsStory);
}
else
{
if ((string)story.HttpStatus["HTTPReason"] == "Not Found")
{
getNewsStoryBody(storyID);
//Have to recursively call this function, because the news body often cannot be found for multiple seconds after the headline is picked up in the live news stream
}
}
});
}
The problem is that the story will not be retrievable from the server ("Story Not Found" error) for at least 2500ms after the headline is available, which is why in getNewsStoryBody(), I need to recursively fetch the story. This issue is present only in real-time news items (the server response time is much faster for existing historical news with a response time of ~500ms or less), which leads me to the conclusion that the Refinitiv servers has performance issues in making news items available as they come in. Based on empirical observations, real-time news items with a larger body take longer to be available for retrieval by the server than ones with shorter bodies. Historical news items have no observable differences in response time based on body length, which again points to performance issues of Refinitiv's backend in processing news items for retrieval in real-time.