For subscription, you need to create an instance of OmmConsumer class.
The OmmConsumer class is the main consumer application interface to the EMA. This class encapsulates watchlist functionality and transport level connectivity. It provides all the interfaces a consumer-type application needs to open, close, and modify items, as well as submit messages to the connected server.
You can specify the TREP/RMDS host name, TCP port, and user name while creating OmmConsumer.
OmmConsumer consumer( OmmConsumerConfig() .host( "ADS:14002" ) .username( "user1" ) );
Otherwise, you can use EMA Consumer and Channel configurations in the EmaConfig.xml.
For more information, please refer to: