This section describes the best practices and recommendations you can follow when implementing and using connectors with WSO2 ESB.
Following are some of the best practices you can adhere to when using connectors:
Use secure vault to secure user credentials used in the
initmethod. For more information on how to use secure vault, see Working with Passwords.
To seamlessly refresh tokens, use a registry location that is visible to all esb cluster members. For example, config registry mounted. Here the refresh token value should be passed as a connector parameter. For detailed information on how this can be done for the relevant WSO2 ESB connectors, see the documentation for the relevant connector.
$ctxinstead of the
$ctxprovides better performance than
Following are some of the best practices you can adhere to when implementing connectors:
Always use lower case letters to name a connector. For example, activecampaign.
Make sure that the parameter values are atomic to the calling api. For example, if the api expects the following request to insert the
lastnamefor a user, you need to provide the
lastnameas separate parameters when implementing the connector.
When writing Java based connectors, avoid using class level variables in the messages flow logic.
When writing soap or rest based connectors, always use the call mediator. Also make sure that you provide the functionality to control the blocking behavior inside the connector.
API versionconfigurable in the
For answers to some of the common questions regarding implementing a connector, see the FAQs section.