Got one query on the EMA API usage.

qooshk
qooshk LSEG
edited May 27 in EMA

In our config, we have two channels created

    <ChannelGroup>

        <ChannelList>

            <Channel>

                <Name value="Channel_2"/>

                <ChannelType value="ChannelType::RSSL_SOCKET"/>

                <CompressionType value="CompressionType::None"/>

                <Port value="14002"/>

                <Host value="127.0.0.1"/>

            </Channel>

            <Channel>

                <Name value="Channel_1"/>

                <ChannelType value="ChannelType::RSSL_SOCKET"/>

                <CompressionType value="CompressionType::None"/>

                <GuaranteedOutputBuffers value="5000"/>

                <Host value="127.0.0.1"/>

                <Port value="14003"/>

            </Channel>

        </ChannelList>

    </ChannelGroup>

In the program, we have OmmConsumer created.

image-d8746787f5305-c16c.png

And have consumer listen to market several ric

image-e1ff78f50c4f1-fa71.png

We want to disconnect from 127.0.0.1:14002 and connect to 127.0.0.1:14003

How can we do it in API?

Regards,

Ronny

Tagged:

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    edited May 27

    @qooshk

    Thank you for reaching out to us.

    You can use the ChannelSet in the Consumer to specify multiple channels.

    		<Consumer>
    			<Name value="Consumer_2"/>
    
    			<!-- ChannelSet specifies an ordered list of Channels to which OmmConsumer will attempt to	-->
    			<!-- connect, one at a time, if the previous one fails to connect							-->
    			<ChannelSet value="Channel_1, Channel_2"/>
    
    			<Logger value="Logger_2"/>
    			<Dictionary value="Dictionary_2"/>
    			<XmlTraceToStdout value="0"/>
    		</Consumer>
    

    If EMA is unable to connect to Channel_1 or Channel_1 has been disconnected, EMA will fail over to Channel_2.

    However, you can't force the OmmConsumer in EMA to disconnect from Channel_1 and re-connect to the Channel_2. You may need to destroy the current one and then create a new OmmConsumer to connect to another channel.