Skip to content

Extended messages not arriving when not known. #233

@LucVerstreken

Description

@LucVerstreken

When I extend a CFX message and it arrives in an application which does not know this extended message, it will never arrive. It would be good that if this extended message is not known, it will deserialize the one of base classes which is a standard CFX message.

Example I have extended the ValidateUnitsRequest in the class ValidateUnitsRequestExt

In Json, you can find this type:

"$type": "MyNamespace.ValidateUnitsRequestExt, MyAssembly"

The Json deserializer will fail deserializing this string because the ValidateUnitsRequestExt is not know in this application.

Solution:

Add base class info in the message:

"$type": "MyNamespace.ValidateUnitsRequestExt, MyAssembly",
"$baseTypes": [
"CFX.InformationSystem.UnitValidation.ValidateUnitsRequest, CFX"
],
...

$baseTypes is a custom property which has to be added.
If the deserialization fails, it can check if one of the base classes is a standard CFX message, and if so serialize it to the base class.

This should solve a lot of our problems. We have to keep sender and receiver in sync according message types sent. But this is not always easy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions