EMA C++ Developers Guide : 4 Consumer Classes : 4.1 OmmConsumer Class : 4.1.1 Connecting to a Server and Opening Items
 
4.1.1 Connecting to a Server and Opening Items
Applications observe the following steps to connect to a server and open items:
(Optional) Specify a configuration using the EmaConfig.xml file.
This step is optional because the Enterprise Message API provides a default configuration which is usually sufficient in simple application cases.
Create OmmConsumerConfig object (for details, refer to Section 4.3).
(Optional) Change Enterprise Message API configuration using methods on the OmmConsumerConfig class.
If an EmaConfig.xml file is not used, then at a minimum, applications might need to modify the default host address and port.
Implement an application callback client class that inherits from the OmmConsumerClient class (for details, refer to Section 4.2).
An application needs to override the default implementation of callback methods and provide its own business logic. Not all methods need to be overridden; only methods required for the application’s business logic.
(Optional) Implement an application error client class that inherits from the OmmConsumerErrorClient class (for details, refer to Section 8.2).
The application needs to override default error call back methods to be effectively notified about error conditions.
Create an OmmConsumer object and pass the OmmConsumerConfig object (and if needed, also pass in the application error client object), and optionally register for Login events by passing in an application callback client class.
Open items of interest using the OmmConsumer::registerClient() method.
Process received messages.
(Optional) Submit PostMsg and GenericMsg messages and modify / close items using appropriate OmmConsumer class methods.
Exit.