New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
36 1 3 6

Windows service is not running when we call init with username

Dear Team


I tried to call init with username,server id in windows service program .Service is not running after we implemented this .

When i tried calling init without username .I mean step 3 example .It is working fine .Service is running .


It got stuck when we tried calling with user name ,password .




// perform application initialisation

res = myApp.init( username, /* username */

appId, /* application Id */

pos /* position */

);



In Event viewer we got time out error

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.4k 90 13 26

Hi @harik,

As mentioned above and in the documentation it defaults to True. So, you would need to explicitly set to False by adding the config parameter into your config or registry.

I would also advise using flat file for config rather than registry (if you are currently using registry) - in case there are permission issues for the service to access the registry - which is another issue I have encountered previously in relation RFA Windows service deployment.

You can also set the log file to a suitable location and then see if anything is logged when you try to run as a service. If so, share the log file here.

Also, if your service is not running with Admin privileges then you should also disable windowsLoggerEnabled (Default is set to True, the AppLogger will attempt to log events into the Windows Event Log which requires Admin rights). Please refer to the above config guide link for more details. You should also be able to find the config guide in the docs folder of your RFA sdk package.

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
36 1 3 6

Basically when i tried to add MyClient files it got stuck .Windows service is not running

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
36 1 3 6

Our application windows service based one .We are able to use your api .We are able to do basic initialization successfully .


We did next step by added MyClient.cpp

When I added this file MyClient.cpp (MyClient : public rfa::common::Client this file is responsible for handling all events) in to our source code .Service is not running.


When I removed this file .Service is running .Is there any registry settings required to use this file


Basically we need to test with login credentials to get the price data .

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.4k 90 13 26

Hi @harik

I recommend you test as a standalone application to ensure your login, connection etc works before attempting windows Service deployment.

One common issue I have seen with people using RFA app as a service, if the following is not set to False in the RFA config and an error dialog pops up...

RFA_MESSAGEBOX_ENABLED Default value = True. When set to true a message box pops up for internal RFA errors.

You may also need to check if RFA_LOG_FILENAME points to a location that the service can write to.

Please see RFA Config guide for further details.


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
36 1 3 6

RFA_MESSAGEBOX_ENABLED i did not able to see in cfg file


I tried with stand alone and i was able to login successfully

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.

If you want to change the RFA_MESSAGEBOX_ENABLED to false, you need to add the parameter in Windows Registry as follows. As per the document, the parameter is only available on Windows Registry.

1584590646809.png (33.7 KiB)
Upvotes
7.6k 15 6 9

@harik

Apart from the suggestion by Umer to set windowsLoggerEnabled to false.

As far as I know, the running directory of windows service is not the same as when you run the standalone app.

Do you have any try-catch block around the codes that call Session::acquire? it may throw some exception so it looks like freeze when you run it. You can print or log the exception details to see the error.

In some case, there is a problem from RFA unable to find logger message file due to the location of the running directory and we usually suggest client add

Logger\AppLogger\useInternalLogStrings=True

in RFA configuration to avoid the exception from the logger message.


Can you add the useInternalLogStrings=true in RFA config?

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.