...
The changes required for the EUREKA platform need to be put in the application descriptor. However, the new property does not exist in the OKAPI platform and throws an error during the parsing of the descriptor. We need to define a solution to resolve this issue.
Research Questions
Does the module descriptor with the new 'user' property not corrupt the OKAPI platform?"
Deliverables
Option 1 Update JSON mapping for ModuleDescriptor
object
...
Code Block |
---|
@JsonInclude(Include.NON_NULL) @JsonIgnoreProperties public class ModuleDescriptor implements Comparable<ModuleDescriptor> { private ModuleId id; private String name; |
Pros
Cons
It can be extended with additional properties, which can make the module descriptor file unreadable and the data within it unclear
Option 2 Add new property into ModuleDescriptor called “extensions”:
The approach will introduce a new property (chapter) that can be of any type of object, serving different purposes depending on the requirements. In our case, we will introduce users for the EUREKA platform, potentially using it to define the payload version for Kafka messages.
Implementation
The implementation will require introducing the new property with any type of object.
Code Block |
---|
public class ModuleDescriptor implements Comparable<ModuleDescriptor> {
private ModuleId id;
private String name;
private String[] tags;
private InterfaceDescriptor[] requires;
private InterfaceDescriptor[] provides;
private InterfaceDescriptor[] optional;
private RoutingEntry[] filters;
private Permission[] permissionSets;
private EnvEntry[] env;
private AnyDescriptor metadata;
private AnyDescriptor extensions;
private UiModuleDescriptor uiDescriptor; |
Option 3 Use existing property “metadata“
Currently, OKAPI has a property for the module called 'metadata,' which can contain objects of any type
Implementation
We can embed the EUREKA object for system users into an existing property and parse it, while OKAPI will ignore it at the same time.
...
There is no need to modify the OKAPI code.
Cons
Risks & Assumptions
Choosing Option 1 or Option 2 will require updating the OKAPI platform otherwise module descriptors file will be incorrect.
Conclusion
I suggest going with recommend choosing Option 2 , as it does not require any changes to the OKAPI platform and does not affect the communitybecause it will introduce a new common capability for adding extensions to the module descriptor. This can be used for various purposes and will provide us with the flexibility to integrate new functionality into the OKAPI or EUREKA platform.
Spike Status:
Status | ||||
---|---|---|---|---|
|