How to set OpenLimit in EMAConfig for IProvider

I need to pass OpenLimit by IProvider to TREP.

I found EMACPP_RDMUserGuide.pdf that OpenLimit belongs to Source Directory Load Filter Entry. But from EMACPP_ConfigGuide.pdf: "The EMA supports only the RDM entries InfoFilter and StateFilter.". The required LoadFilter is not mentioned there.

Is there a way how can I pass OpenLimit to TREP with EMA?

Best Answer

  • Jirapongse
    Answer ✓

    @dmitry.vasilenko

    The GitHub issue #119 has been closed. The issue has been fixed in RTSDK C++/C 2.0.1.L1.


    --------------------------------------------
    RTSDK C++/C Release 2.0.1.L1 (Mar 4, 2021)
    ---------------------------------------------


    EMA C++ 3.6.1.L1 Issues Resolved
    --------------------------------
    ...
    - [RTSDK-4402] - Support additional Source Directory attributes via EmaConfig [GitHub # 119]


    1626686463148.png

Answers

  • @dmitry.vasilenko

    From the EMA Configuration Guide, it looks like currently,
    EMA XML configuration file supports only the RDM entries InfoFilter and StateFilter.
    If we set LoadFilter to the XML file, EMA will detect the config as unsupported
    configuration.

    As far as I understand, If you want to publish directory with the LoadFilter
    containing OpenLimit element, you have to add EMA codes to handle
    Directory Request by setting adminControlDirectory to UserControlEnum like
    below codes from Example 331__Directory__UserControl which locates under a folder
    <EMA Install Folder>\Cpp-C\Ema\Examples\Training\IProvider\300_Series\”

    OmmProvider provider( OmmIProviderConfig().adminControlDirectory( OmmIProviderConfig::UserControlEnum ), appClient );

    And then add
    codes to publish LoadFilter with OpenLimit when the application receive onReqMsg callback like below sample codes from IProvider.cpp.

    void AppClient::onReqMsg( const ReqMsg& reqMsg, const OmmProviderEvent& event )
    {
    switch ( reqMsg.getDomainType() )
    {
    ...
    case MMT_DIRECTORY:
    processDirectoryRequest( reqMsg, event );
    break;
    ...
    }
    void AppClient::processDirectoryRequest(const ReqMsg&, const OmmProviderEvent& event)
    {
    event.getProvider().submit(RefreshMsg().domainType(MMT_DIRECTORY).filter(SERVICE_INFO_FILTER | SERVICE_STATE_FILTER | SERVICE_LOAD_FILTER).
    payload(Map().
    addKeyUInt(2, MapEntry::AddEnum, FilterList().
    add(SERVICE_INFO_ID, FilterEntry::SetEnum, ElementList().
    addAscii(ENAME_NAME, "DIRECT_FEED").
    addArray(ENAME_CAPABILITIES, OmmArray().
    addUInt(MMT_MARKET_PRICE).
    addUInt(MMT_MARKET_BY_PRICE).
    complete()).
    addArray(ENAME_DICTIONARYS_USED, OmmArray().
    addAscii("RWFFld").
    addAscii("RWFEnum").
    complete()).
    complete()).
    add(SERVICE_STATE_ID, FilterEntry::SetEnum, ElementList().
    addUInt(ENAME_SVC_STATE, SERVICE_UP).
    complete()).
    add(SERVICE_LOAD_ID, FilterEntry::SetEnum, ElementList().
    addUInt(ENAME_OPEN_LIMIT, 2000).
    complete()).
    complete()).
    complete()).complete().solicited(true), event.getHandle());
    }

  • Thanks for your answer. But does it mean I have to pass all the config this way now. Or is it still possible to use EmaConfig.xml but set only LoadFilter this way from code?

  • You can still use EmaConfig.xml but for directory message, you have to handle the directory request in your codes and publish the whole directory message using the codes instead.

  • The Directory config section contains all the services list with all theirs configuration. And now all this should be implemented in code, am I right?

  • Hi @dmitry.vasilenko

    If you use the UserControlEnum mode, then the internal source directory message will be disabled and therefore you will need to implement it in code - as demonstrated above.

    In theory it is possible to use Programmatic config to override specific sections of the EMAConfig.xml file entries - but as you have discovered the LoadFilter is not supported by the EMA Configuration.

    In the above code, you are bypassing the EMA Configuration and sending your own Directory Source refresh message using OMM constructs as described in the RDM Usage guide.

  • Umer, thanks for your answer. I can't reply on your message so I put it here. Do you have any plans to enable LoadFilter in EmaConfig.xml? Or at least make it possible to set a single option separately not to put all the config to the code if you need to set only a single option. The current workaround to implement it in the code contradicts with our developing policy and is hard to maintenance in future.

  • Hi @dmitry.vasilenko

    I will refer your questions onto the Product manager and get back to you - once I hear from him.

  • Alex, unfortunately my last question was left without the answer.

  • >>>>>>>>>>>>

    Umer Nalla

    dmitry.vasilenko May 31 at 7:07 PM

    0
    Like

    Share

    Hi @dmitry.vasilenko

    I will refer your questions onto the Product manager and get back to you - once I hear from him.

    ------------------------------

    Guys, any update on this?

  • Hi @dmitry.vasilenko

    I did chase the PM - I will ping again.