question

Upvotes
Accepted
20 1 1 2

RFA config file with user

Hello,

We are migrating to Hosted Feed our TREP application, and now we need to specify a USER ID for the connection.

We are getting next Error :

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

It is possible to add it on the rfa.cfg file?

Now, our source that set the consumer is next:

this.session = Session.Acquire(new RFA_String("Session1"));
this.ommConsumer = this.session.CreateOMMConsumer(new RFA_String("Consumer"));

And our config file:

\Sessions\Session1\connectionList = "Connection_RSSL"
\Connections\Connection_RSSL\connectionType = "RSSL"
\Connections\Connection_RSSL\rsslPort  = "14002"
\Connections\Connection_RSSL\serverList = "XXX.XXX.XXX.XXX"
\Connections\Connection_RSSL\ServiceList  = "IDN_SELECTFEED"

Thank you in advance.

treprfarfa-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
20.3k 73 10 20

Hi @gcorretge

Simpy adding a username to config file will not result in a Login request being sent to the server.

You will need to implement some code to encode a Login Request message and submit that Login Request to the server.

If you have not already done so, please work through the basic Tutorials - including Step 4 'Using the Login RDM' - to get a better understanding of how to create a basic Consumer application in RFA.

Generally speaking the rfa.cfg will usually only contain RFA API related config e.g. session related.

If you want to specify application level config such as username, service name etc then you can also use a seperate application level config. If you have downloaded the RFA SDK, I recommend you look at some of the simpler examples such as StarterConsumer. This uses the ExampleRFA.cfg for the API config and StarterConsumer.cfg for the application config which in this case includes the username.

Whilst it is possible to use a single config file for both API and application config, it is a bit more involved.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
7.6k 15 6 9

@gcorretge

Regarding below error message, it looks like there is InvalidUsage Exception thrown when your application tries to send item request before it receives Login success.

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

In addition to my colleague's comments above, I would suggest you add the codes to check the Login status before sending a new item request message to avoid the exception in your application. This is because it could be a scenario that your Login is failed because of permission issue or the Provider server may reject or close your login stream for some reason.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea