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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 1 2 3

What is the hostname for MRN using websockets API

I am using this hostname amer-1-t3.streaming-pricing-api.refinitiv.com

and these

mrn_domain = 'NewsTextAnalytics'

mrn_item = 'MRN_STORY'


websocketsrrtorefinitiv-realtime-optimisedmrn
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.

Upvote
Accepted
25.2k 57 17 14

Hello @prashanth.suresh1

Could you please let us know if you are encountering any issues when connects to amer-1-t3.streaming-pricing-api.refinitiv.com host?

I can use the cloud_mrn_notebook_app.ipynb example (download here) to connect and consume MRN data from amer-1-t3 host successfully.

You can use the following WebSocket API example to test the MRN subscription from RRTO:

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
3 0 2 8

When I tried to run I am stuck here in this method:

private void ReceiveMessage()

{

var readBuffer = new ArraySegment<byte>(new byte[RecvBufferSize]);

MemoryStream memoryStream = null;

byte[] dataBuffer = null;


while (!Stop && !Cts.IsCancellationRequested)

{

var result = WebSocket.ReceiveAsync(readBuffer, Cts.Token);

if (!result.IsFaulted)

{

if (result.Result.EndOfMessage)

{

if (memoryStream != null)

{

memoryStream.Write(readBuffer.Array ?? throw new InvalidOperationException(),

readBuffer.Offset, readBuffer.Count);

dataBuffer = memoryStream.GetBuffer();

memoryStream.Dispose();

}

else

{

dataBuffer = readBuffer.Array;

}


break;

}

else

{

if (memoryStream == null)

memoryStream = new MemoryStream((int) RecvBufferSize * 5);


memoryStream.Write(readBuffer.Array ?? throw new InvalidOperationException(),

readBuffer.Offset, readBuffer.Count);

readBuffer = new ArraySegment<byte>(new byte[RecvBufferSize]);

}

}

else

{

RaiseErrorEvent(DateTime.Now, WebSocket.State,

"Unhandled Exception occured inside ReceiveMessage()");

break;

}

}

// Pass the data buffer back to app layer via callback.

RaiseMessageEvent(DateTime.Now, dataBuffer);

}


On the following line I am getting null exception

var result = WebSocket.ReceiveAsync(readBuffer, Cts.Token);


Exception :

System.NullReferenceException

HResult=0x80004003

Message=Object reference not set to an instance of an object.

Source=System.Net.WebSockets.Client

StackTrace:

at System.Net.WebSockets.ClientWebSocket.ReceiveAsync(ArraySegment`1 buffer, CancellationToken cancellationToken)

at WebsocketAdapter.WebsocketConnectionClient.ReceiveMessage() in D:\Files1\CNBC ARABIA\FeedHandler\Example.WebSocketAPI.CSharp.MRNWebSocketViewer-master\Example.WebSocketAPI.CSharp.MRNWebSocketViewer-master\WebsocketAdapter\WebsocketConnectionClient.cs:line 158


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.