DataTypes.ERROR is missing from Elektron SDK 1.1.1 Java Edition

Hi,

The ERROR static value is missing from the DataTypes class.

Because of that the following code snippet extracted from the example200__MarketPrice__Streaming example doesn't compile anymore.

switch (fieldEntry.loadType())
{
case DataTypes.REAL :
System.out.println(fieldEntry.real().asDouble());
break;
.
.
.
case DataTypes.ERROR :
System.out.println("(" + fieldEntry.error().errorCodeAsString() + ")");
break;
default :
System.out.println();
break;
}

Is DataTypes.ERROR still a relevant data type?

What is the recommended way to deal with field entries that contain errors?

Best Answer

  • Hello @Olivier DAVANT

    I can find DataTypes.ERROR in Elektron SDK 1.1.1 Java as shown below:

    image

    When I clicks ERROR, the following is showed:

    image

    example200__MarketPrice__Streaming can compile and run successfully.

    Please make sure that you include ema.jar shipped with Elektron SDK version 1.1.1 not the old version.

Answers

  • Hi @Pimchaya.Wongrukun

    I'm using the right ema.jar file from the right Elektron SDK version (1.1.1).

    I understood why ERROR and RMTES constant values were not recognized as part of the DataTypes class:

    image

    This is because I wrongly imported com.thomsonreuters.upa.codec.DataTypes instead of com.thomsonreuters.ema.access.DataType.DataTypes.

    It happens that values like UINT or ENUM are part of both classes upa.codec.DataTypes and ema.access.DataType.DataTypes, but ASCII, RMTES and ERROR are only part of ema.access.DataType.DataTypes.

    ...

  • ...

    My code compiles again after I replaced

    import com.thomsonreuters.upa.codec.DataTypes;

    by

    import com.thomsonreuters.ema.access.DataType.DataTypes;