question

Upvotes
Accepted
21 0 0 0

Problem with XmlTraceToMultipleFiles for programmatic configuration of a NiProvider

Hello,


When I do a programmatic configuration of a NiProvider, I set XmlTraceMaxFileSize to 100000 and XmlTraceToMultipleFiles to 1 with:

.addInt("XmlTraceMaxFileSize", 100000)

and

.addUInt("XmlTraceToMultipleFiles", 1)


Size is in bytes so I should get a new file if the file size exceeds 100KB.

It is working correctly, I get several files with size less than 100KB.


Now if I change .addUInt("XmlTraceToMultipleFiles", 1) to .addUInt("XmlTraceToMultipleFiles", 0), from the configuration guide, I expect that "0 (false): the Enterprise Message API stops writing the XML trace if the current file reaches the XmlTraceMaxFileSize. ".

So I should have only one file less than 100 KB.


It is not working correctly. I got one file that continues to be written even if the file size exceeds 100 KB.


What am I doing wrong?

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
21 0 0 0
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
7.6k 15 6 9

@thierry.khayat

Are you using EMA C++?

I did a quick test with consumer examples and used a programmatic config like the below codes and found the same behavior. I got one file that continues to be written even if the file size exceeds 100 KB.

void createProgramaticConfig(Map& configMap)
{
    Map innerMap;
    ElementList elementList;

    elementList.addAscii("DefaultConsumer", "Consumer_1");

    innerMap.addKeyAscii("Consumer_1", MapEntry::AddEnum,
        ElementList()
        .addAscii("Channel", "Channel_1")
        .addAscii("Logger", "Logger_1")
        .addAscii("Dictionary", "Dictionary_1")
        .addUInt("ItemCountHint", 5000)
        .addUInt("ServiceCountHint", 5000)
        .addUInt("ObeyOpenWindow", 0)
        .addUInt("PostAckTimeout", 5000)
        .addUInt("RequestTimeout", 5000)
        .addUInt("MaxOutstandingPosts", 5000)
        .addInt("DispatchTimeoutApiThread", 100)
        .addUInt("HandleException", 0)
        .addUInt("MaxDispatchCountApiThread", 500)
        .addUInt("MaxDispatchCountUserThread", 500)
        .addInt("ReactorEventFdPort", 45000)
        .addInt("PipePort", 4001)
        .addInt("ReconnectAttemptLimit", 10)
        .addInt("ReconnectMinDelay", 2000)
        .addInt("ReconnectMaxDelay", 6000)
        .addAscii("XmlTraceFileName", "MyXMLTrace")
        .addInt("XmlTraceMaxFileSize", 100000)
        .addUInt("XmlTraceToFile", 1)
        .addUInt("XmlTraceToStdout", 0)
        .addUInt("XmlTraceToMultipleFiles", 0)
        .addUInt("XmlTraceWrite", 1)
        .addUInt("XmlTraceRead", 1)
        .addUInt("XmlTracePing", 1)
        .addUInt("XmlTraceHex", 1)
        .addUInt("MsgKeyInUpdates", 1).complete()).complete();

    elementList.addMap("ConsumerList", innerMap);

    elementList.complete();
    innerMap.clear();

    configMap.addKeyAscii("ConsumerGroup", MapEntry::AddEnum, elementList);
    elementList.clear();

    innerMap.addKeyAscii("Channel_1", MapEntry::AddEnum,
        ElementList()
        .addEnum("ChannelType", 0)
        .addAscii("InterfaceName", "localhost")
        .addEnum("CompressionType", 1)
        .addUInt("GuaranteedOutputBuffers", 5000)
        .addUInt("ConnectionPingTimeout", 50000)
        .addAscii("Host", "<ads server>")
        .addAscii("Port", "14002")
        .addUInt("TcpNodelay", 0).complete()).complete();

    elementList.addMap("ChannelList", innerMap);

    elementList.complete();
    innerMap.clear();

    configMap.addKeyAscii("ChannelGroup", MapEntry::AddEnum, elementList);
    elementList.clear();

    innerMap.addKeyAscii("Logger_1", MapEntry::AddEnum,
        ElementList()
        .addEnum("LoggerType", 0)
        .addAscii("FileName", "logFile")
        .addEnum("LoggerSeverity", 0).complete()).complete();

    elementList.addMap("LoggerList", innerMap);

    elementList.complete();
    innerMap.clear();

    configMap.addKeyAscii("LoggerGroup", MapEntry::AddEnum, elementList);
    elementList.clear();

    innerMap.addKeyAscii("Dictionary_1", MapEntry::AddEnum,
        ElementList()
        .addEnum("DictionaryType", 1)
        .addAscii("RdmFieldDictionaryFileName", "./RDMFieldDictionary")
        .addAscii("EnumTypeDefFileName", "./enumtype.def").complete()).complete();

    elementList.addMap("DictionaryList", innerMap);

    elementList.complete();

    configMap.addKeyAscii("DictionaryGroup", MapEntry::AddEnum, elementList);
    elementList.clear();

    configMap.complete();
}

In the main function

     AppClient clien              
     Map configMap;         
     createProgramaticConfig(configMap);         
     OmmConsumer consumer(OmmConsumerConfig().config(configMap).username("user"));

It could be an issue from the Logger component inside the RTSDK.

Can you report the issue on Github?

https://github.com/Refinitiv/Real-Time-SDK/issues



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
21 0 0 0

I am using EMA C++.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
7.6k 15 6 9

@thierry.khayat

I try the codes with EMA C++ from the latest RTSDK1.5.1.L1 and also found the same behaviour. Therefore I suspect that it could be an issue inside EMA implementation.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea