question

Upvotes
Accepted
22 4 4 6

convert EMA C++ sample code into a Windows Service

in you example code

try {
AppClient client;

OmmConsumer consumer(OmmConsumerConfig().host("my.ip.goes.here:14002").username("my_user_goes_here"));

consumer.registerClient(ReqMsg().serviceName("LDN_RSSL_DDS_CHE").name("MRN_STORY").domainType(MMT_NEWS_TEXT_ANALYTICS), client); // original

// Sleep long enough to receive a few stories
sleep( 60000 );// API calls onRefreshMsg(), onUpdateMsg() and onStatusMsg()

}

It uses a sleep() function to control how long it runs.

What if I do not want to use sleep(), but rather call something like

client.start() when my service (getting news from Elektron API) starts, and client.stop() when I want to stop the service (quitting ClientApp from memory).

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apimrn
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.

Hello @xlil997,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

1 Answer

· Write an Answer
Upvotes
Accepted
25.3k 87 12 25

Hi @xlil997

Have you looked at example 130__MarketPrice__UserDisp which illustrates User Dispatching as opposed to API dispatch mechanism.

Please refer to section 2.4.1 EMA Consumer Architecture of the EMA Developers guide for more information on dispatching.

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.