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:
- 
The getPayloadConvertorName()method incom.diffusiondata.gateway.framework.SourceHandler.SourceServicePropertieshas been changed togetPayloadConverterNames(), which returns a list of Strings instead of a single String.
- 
payloadConvertorName(String name)incom.diffusiondata.gateway.framework.SourceHandler.SourceServiceProperties.Builderhas been changed topayloadConverter(String name).
- 
The getPayloadConvertorName()method incom.diffusiondata.gateway.framework.SinkHandler.SinkServicePropertieshas been changed togetPayloadConverterNames(), which returns a list of Strings instead of a single String.
- 
payloadConvertorName(String name)incom.diffusiondata.gateway.framework.SinkHandler.SinkServiceProperties.Builderhas been changed topayloadConverter(String name).
- 
The PayloadConvertorinterface has been renamed toPayloadConverterand methods has been changed. See writing payload converter for details on how to implement a PayloadConverter with the changed API.
- 
The InboundPayloadConvertorandOutboundPayloadConvertorinterfaces have been removed. So,PayloadConverterinterface should be used to implement a payload converter.
- 
com.diffusiondata.gateway.framework.SinkHandlerrequires a new methodvalueType().
- 
updatemethod incom.diffusiondata.gateway.framework.SinkHandlerhas been updated to containTopicPropertiesthat contains details of the topic from where update is received. This can be used as required or ignored.
- 
The isMetricsEnabledmethod inGatewayFrameworkhas been moved toApplicationDefinition.
- 
The getExecutorServicemethod inGatewayFrameworkhas been moved toApplicationDefinition.
- 
The getParameters()method inApplicationDefinitionhas been renamed togetGlobalConfiguration.
- 
The ApplicationDefinitioninterface has been renamed toApplicationContext.
- 
The connectmethod of theGatewayFrameworkinterface has been removed.
- 
The initializemethod inDiffusionGatewayFrameworkhas been renamed tostartand now returns an instance ofGatewayFramework. This method both initializes and starts the application.
- 
The shutdownmethod of theGatewayFrameworkinterface has been removed. This has been added as a static method inDiffusionGatewayFramework.
- 
Setting topicTypeinSinkServiceProperties.Builderhas been removed, as setting a topic type for Diffusion topic subscription is not required anymore.
- 
Setting consumeJSONSubTypesinSinkServiceProperties.Builderhas been removed.
- 
The addSinkmethod inGatewayApplicationhas been updated to passSubscriberinstance.
- 
The addHybridmethod inGatewayApplicationhas also been updated to passSubscriberinstance.
- 
The option to set the basePathparameter in thetopicPropertiesfor the framework configuration of the source service has been removed.
- 
The getGatewayMeterRegistrymethod has been renamed toinitializeGatewayMeterRegistry, which takes a map of global application configuration to initialize the instance ofMeterRegistry.
- 
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:
- 
Fix the compile errors as defined above. 
- 
Remove the META-INF/servicesfolder 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>