Upgrading from version 1.x to version 2.0

In the 2.0 version of the Gateway Framework, the term convertor has been changed to converter throughout the APIs, affecting method names, interface names, etc. Additionally, there are other API changes that can lead to compile errors. These changes are listed below:

  1. The getPayloadConvertorName() method in com.diffusiondata.gateway.framework.SourceHandler.SourceServiceProperties has been changed to getPayloadConverterNames(), which returns a list of Strings instead of a single String.

  2. payloadConvertorName(String name) in com.diffusiondata.gateway.framework.SourceHandler.SourceServiceProperties.Builder has been changed to payloadConverter(String name).

  3. The getPayloadConvertorName() method in com.diffusiondata.gateway.framework.SinkHandler.SinkServiceProperties has been changed to getPayloadConverterNames(), which returns a list of Strings instead of a single String.

  4. payloadConvertorName(String name) in com.diffusiondata.gateway.framework.SinkHandler.SinkServiceProperties.Builder has been changed to payloadConverter(String name).

  5. The PayloadConvertor interface has been renamed to PayloadConverter and methods has been changed. See writing payload converter for details on how to implement a PayloadConverter with the changed API.

  6. The InboundPayloadConvertor and OutboundPayloadConvertor interfaces have been removed. So, PayloadConverter interface should be used to implement a payload converter.

  7. com.diffusiondata.gateway.framework.SinkHandler requires a new method valueType().

  8. update method in com.diffusiondata.gateway.framework.SinkHandler has been updated to contain TopicProperties that contains details of the topic from where update is received. This can be used as required or ignored.

  9. The isMetricsEnabled method in GatewayFramework has been moved to ApplicationDefinition.

  10. The getExecutorService method in GatewayFramework has been moved to ApplicationDefinition.

  11. The getParameters() method in ApplicationDefinition has been renamed to getGlobalConfiguration.

  12. The ApplicationDefinition interface has been renamed to ApplicationContext.

  13. The connect method of the GatewayFramework interface has been removed.

  14. The initialize method in DiffusionGatewayFramework has been renamed to start and now returns an instance of GatewayFramework. This method both initializes and starts the application.

  15. The shutdown method of the GatewayFramework interface has been removed. This has been added as a static method in DiffusionGatewayFramework.

  16. Setting topicType in SinkServiceProperties.Builder has been removed, as setting a topic type for Diffusion topic subscription is not required anymore.

  17. Setting consumeJSONSubTypes in SinkServiceProperties.Builder has been removed.

  18. The addSink method in GatewayApplication has been updated to pass Subscriber instance.

  19. The addHybrid method in GatewayApplication has also been updated to pass Subscriber instance.

  20. The option to set the basePath parameter in the topicProperties for the framework configuration of the source service has been removed.

  21. The getGatewayMeterRegistry method has been renamed to initializeGatewayMeterRegistry, which takes a map of global application configuration to initialize the instance of MeterRegistry.

  22. The reportStatus method in the StateHandler is updated to return a CompletableFuture containing the state of the service once the service has completed the state change following a pause or resume based on the supplied status.

For additional details, please refer to the Gateway Framework API Javadoc.

When upgrading the Gateway Framework from version 1.x to 2.x, follow these steps:

  1. Fix the compile errors as defined above.

  2. Remove the META-INF/services folder in resources (if available), as Payload converter instantiation using the Java Service Provider Interface (SPI) mechanism is removed in this release.

Note: The Gateway Framework 2.0 requires the Diffusion server to have a maximum message size configured to be larger than 32k. Therefore, the server needs to be configured with a larger message size limit. Alternatively, you can use a Diffusion server version later than 6.10.0, whose max-message-size is set to 256k by default. To configure the server, update the etc/Server.xml file to contain:

<max-message-size>256k</max-message-size>