Different in the addAdminMsg Request message and registerclient Request message

I have following setup

loginMsg.domainType(MMT_LOGIN).name("user").nameType(USER_NAME)
.attrib(ElementList().addAscii(ENAME_APP_ID, "127")
.addAscii(ENAME_POSITION, 127.0.0.1/net)
.addUInt(ENAME_ALLOW_SUSPECT_DATA, 0)
.addUInt(ENAME_SINGLE_OPEN, 1)
.addUInt(ENAME_ROLE, 1)
.addUInt(ENAME_DOWNLOAD_CON_CONFIG,1)
.complete());
directoryMsg.domainType(MMT_DIRECTORY).serviceName("DIRECT_FEED");


receiver = new OmmConsumer(OmmConsumerConfig().config(configMap)
.addAdminMsg(loginMsg)
.addAdminMsg(directoryMsg));
receiver->registerClient(loginMsg, (*this), closure);
receiver->registerClient(directoryMsg, (*this), closure);

Is this correct application of registerclient.

Should I add the Login Request message as AddAdminMsg and do registerclient with same message.

Best Answer

  • You should use the AddAdminMsg only if you want to override the administrative (Login, Directory, Dictionary) request message used by EMA.

    If you want to process the administrative response message received from server, you need to do the registerClient to receive response message in the callback function.

    You can use the same message for the addAdminMsg and registerClient call.

    However, please note that EMA internally processes and handles all administrative responses. Application generally does not need to process the message.