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-sdkrrtema-apielektron-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.

1 Answer

Upvotes
Accepted
25k 87 11 23

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.