Duplicated trace messages are sent to all the Sinks in the adapter, when there are more than one MApp in the SAME adapter instance or multiple Adapter instances started in a JVM, as in the case of an application server.

Duplicated trace messages are sent to all the Sinks in the adapter, when there are more than one MApp in the SAME adapter instance or multiple Adapter instances started in a JVM, as in the case of an application server.

book

Article ID: KB0087285

calendar_today

Updated On:

Products Versions
TIBCO Adapter SDK -
Not Applicable -

Description

Description:
When there are more than one MApp in the SAME adapter instance. After more than one MApp is started, all trace messages are sent to the combined sinks from all started MApps.  It appears as if the trace messages are duplicated.
This problem is addressed in the SDK 5.0.1, for SDK 4.x the work around is to have one unique MTrace object for each MApp object as follow (pseudo-code):
            // Create appCount of MApp instances
            for (int i = 0; i < appCount; i++) {
                MTrace        uniqueTrace = new MTrace();
                MTrace.setDefaultTrace( uniqueTrace );
                MyMapp        app = new MyMapp( appProperties,
    "Application__" + (i+1));
                app.start();
            }

Additionally, make sure to serialize the calls MTrace.setDefaultTrace( uniqueTrace ); and
app.start();
Symptoms:

Cause:

Issue/Introduction

Duplicated trace messages are sent to all the Sinks in the adapter, when there are more than one MApp in the SAME adapter instance or multiple Adapter instances started in a JVM, as in the case of an application server.