commercetools Connector v2.0.0 Migration Steps
Author:
Fluent Commerce
Changed on:
31 Jan 2024
Key Points
- The 2.0 Commerce tools connector offers a range of new capabilities in regards to configurations, availability calls and DSK context creation.
- The migration requires a few Java changes and configuration changes that are covered in detail in this article.
Steps
New version of the connector
Java Changes
`MessageHandler`is now an interface. Any references to it must now change from extends to implements.`HandlerException`has been renamed to`HandlerRetryException`.`AccountReference`is now a record and access to its members has changed.`ListenerInfo`package has moved to`com.fluentcommerce.connect.core.listener.external.ListenerInfo`.`ExternalListener`has been renamed to`BaseExternalListener`.`ExternalMessageReceiver`package has moved to`com.fluentcommerce.connect.core.listener.external.ExternalMessageReceiver`.`JobHandler`is now an interface and the`package`has moved to`com.fluentcommerce.connect.core.job.extend.JobHandler`.`FluentConnectConfiguration`has been renamed to`ApplicationConfigurationService`.`ExternalMessageReceiver`interface updates.- A number of improvements/changes to
`HandlerContext`classes to improve resource access control stay within the account-retailer context.- Configuration service will automatically prefix configuration/setting keys with the connector configuration namespace. For example, requesting a property named “my-key” for a connector named “my-connector” will result in the configuration service retrieving a setting from Fluent with the following setting key: “
`fc.connect.my-connector.my-key`“.
- Configuration service will automatically prefix configuration/setting keys with the connector configuration namespace. For example, requesting a property named “my-key” for a connector named “my-connector” will result in the configuration service retrieving a setting from Fluent with the following setting key: “
- All LocalDateTime usage within the SDK has changed to
`ZonedDateTime`and the timezone defaults to UTC regardless of the system timezone.- There is also a new service
`DateService`that can return a proper current datetime in UTC.
- There is also a new service
- Handler routes are now grouped into logical groups.
Configuration Required Changes
- application.yml
- The following listener configuration is no longer used and can be removed
- Job scheduler changes
- Scheduler type has been introduced and by default, it is message-queue which uses the SQS implementation
- Listener configuration should be updated as follows:
- The snippet below brings a new listener for notification and changes for listener types
- Please note that the deployment process also needs to introduce a new variable for SQS_NOTIFICATION to specify the notification queue.
- Remember to review the pool size settings for your project needs
- With the Fluent account being set in the configuration below, remove the following files:
`application-dev.yml`,`application-qa.yml`,`application-test.yml`and`application-test2.yml`.
- application-connector.yml
- The configuration below should be removed. The SDK now knows to automatically build these based on the connector-name property.
- Remove the listener configuration for commercetools_events as it has been consolidated at the application.yml. Alternatively, all listener configurations can be done on this file.
- Add the credential setting to specify the manager name
- Route configuration has changed. All out-of-the-box routes are pre-configured and do not require anything on the yml files unless you have modified those settings. The list provided below is the out-of-the-box commercetools connector routes part of the module and can be removed.
- If you intend in keeping route configuration in the yml files, please note that there have been some changes to the configuration property name:
`name`property has been renamed to “route” and the “handler” has changed to`handler-name`.- There is also a new way to group routes. All routes must be under a new parent “route:” property and each kind of route goes under its type
Configuration Optional Changes
- Docker optional changes