question

Upvotes
Accepted
3 2 1 3

OMMConsumer::registerClient() has been called with an item request prior to login request

Hi,

I'm just starting to go through RFA tutorials and trying to get the example there working but stuck on an error. I haven't changed the example much apart from username, service name etc.

In RDMExample.cs

long handle = ommConsumer.RegisterClient(eventQueue, ommItemIntSpec, rdmClient, itemName);

on this line I keep getting

"OMMConsumer::registerClient() has been called with an item request prior to login request. Login request is expected first."

But login was successful above already...

Any idea?

Atilla

treprfarfa-api
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
25.3k 87 12 25

Ok - the login failed. Excellent - now we can get somewhere :)

Did you specify your IP address as part of the Login Position e.g.

private static readonly RFA_String UserName = new RFA_String("Atilla.Gurbuz");
private static readonly RFA_String AppId = new RFA_String("256");
private static readonly RFA_String Position = new RFA_String("10.34.21.74");

This should be done near the top of the file in RDMExample.cs

Obviously, you should use your correct username and IP address above.

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
25.3k 87 12 25

Hi,

You say the Login was successful; by this do you mean

a) the registerClient call for the Login successfully returned a handle OR

b) you actually see a Login success response message event back from the server?

Please attach the console output and any .log file generated by the application here, so we can advise further.

Just because the registerClient call for the Login succeeds does not mean you are yet logged into the server successfully. The server will respond asynchronously once it actually accepts your login request. The message you are seeing could suggest the Server denied the login attempt but the application still tried to register a client for Market item request.

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 2 1 3

Thanks for quick respond, this is the login line

loginHandle = ommConsumer.RegisterClient(eventQueue, ommItemIntSpec, rdmClient, null);

loginHandle =461216368 which is succeful right?

2017-02-15-14-48-02-clipboard.png


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
25.3k 87 12 25

As stated in my earlier reply, all the above loginHandle response means is that you successfully registered a client class to receive any callback events generated as a result of your Login request.

It does NOT mean that you have successfully connected and logged into the server etc. Indeed the screenshot you attached does not appear indicate any such successful connection or login.

Which step of the tutorial are you running? I am guessing it is at least Step 4. If this is the case, you should refer to the Video and notes which explain how you register your callback client to receive the callback events and how the client should then receive success or failure response events from the server.

Also, if there is a log file generated in the working folder attach this to your reply - using the Insert File button.

Finally, have you confirmed with your local Market Data admin team that you have the right server and username login details etc?

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 2 1 3

Hi, in another application I could read data from TREP with my username, have been going through this tutorial to learn more about RFA, finished all the steps. How do we check if the login is successful or not then? Couldn't find video section you've mentioned. Many thanks.

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
25.3k 87 12 25

When you mentioned RFA .NET and Tutorials I assumed you were looking at these tutorials on this website

https://developers.thomsonreuters.com/thomson-reuters-enterprise-platform/robust-foundation-api-rfa-1/learning?content=3135&type=learning_material_item

Which Tutorials are you running? And do they not generate a LOG file in the runtime folder?

As for a successful login, you should receive an event callback , so in the tutorial code there should be something like:

private void ProcessRespMsg(OMMItemEvent evnt, RespMsg respMsg) {
		//----------------------------------
			switch (respMsg.MsgModelType) {
				case ThomsonReuters.RFA.RDM.RDM.MESSAGE_MODEL_TYPES.MMT_LOGIN:
					ProcessLoginResponse(evnt, respMsg);

The above would get called when a RespMsg is received of model type MMT_LOGIN

The ProcessLoginResponse then checks the RespMsg to see if the login was successful

//----------------------------------
		private void ProcessLoginResponse(OMMItemEvent evnt, RespMsg respMsg) {
		//----------------------------------
			RespStatus status = respMsg.RespStatus;
			RFA_String text = OMMStrings.RespStatusToString(status);


			//For a Login Response examine the stream state and data state:
			//If stream state is open and data state is OK then we have a successful Login
			//If stream state is open and data state is NOT OK then we have a pending Login
			switch (respMsg.RespType) {
				case RespMsg.RespTypeEnum.Refresh:
				case RespMsg.RespTypeEnum.Status:
					if ((respMsg.HintMask & RespMsg.HintMaskFlag.RespStatus) != 0) {
						if ((status.StreamState == RespStatus.StreamStateEnum.Open) &&
							(status.DataState == RespStatus.DataStateEnum.Ok)) {
							AppUtil.Log(AppUtil.LEVEL.INFO, string.Format("<- Received MMT_LOGIN - Login Accepted{0}", text.ToString()));
							ProcessLoginSuccess();
						} 

The tutorial app should then output some information such as:

2017/02/15 16:24:39.950 INFO
    <- Received MMT_LOGIN - Login Accepted
    streamState : Open
    dataState   : Ok
    statusCode  : None
    statusText  : Login accepted by host centos7-1.

To indicate success.

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 2 1 3

Thanks Umer, I'm following that tutorial, I know there is mentioning of that method but in the code, ProcessRespMsg within RDMClient, ultimatly get called by public ProcessEvent method within same library but this one is not called anywhere, so ProcessRespMsg doesn't get hit at all?

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 2 1 3

Ok you are right, no login, do you have any idea why it could be? Works on another application. Thanks.

2017-02-15-14-48-02-clipboard.png


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
25.3k 87 12 25

Hi,

Not sure which step of the tutorial you are looking at, but I checked Step6 and Step7 code and both of them have routes to call the ProcessRespMsg

ProcessEvent ->( EventType=OMMItemEvent) -> ProcessOMMItemEvent -> ( MsgType= RespMsg) -> ProcessRespMsg

To be honest, we could go back and forth here. But until we have something more to go in terms of diagnostics, I suspect we are not going to get far. If you unable to post the .log file here and you are a TR customer, then I recommend you contact our Developer Support team offline and they may be able to assist.

If you are able to attach the log files then do so - it may help.

Also, I would recommend you add the following line to your config file and re-run your app

\Connections\Connection_RSSL\traceMsgToFile = true

This should generate an .xml trace file in your working directory - please post that here OR include it when you contact our Developer Support team at http://my.thomsonreuters.com/ContactUsNew

Based on past experience, the most likely cause of the error (you reported in the original post) is due to invalid login details or if an application using your userId is already logged in from a different position - but this will be difficult to confirm without log or trace files etc.

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.