Connection with multiple DB instances Dynamically in Mulesoft

Connection with multiple DB instances Dynamically in Mulesoft

For connection with any database, we are having a DB connector in Mulesoft. We have to configure DB configuration and we can connect with database.?

But here we are going to connect with multiple DB instances at a time parallelly. These are the below steps:


Step 1: Create a mule project with default configuration.

Step 2: Add Database module from Anypoint exchange.

No alt text provided for this image

Step 3: We are passing Db connection details as payload. And we can pass these details with variables also.?

To connect with MySQL DB we have to provide Host, Port, Username, Password parameters.

No alt text provided for this image

Step 4: Create a DB configuration to connect with MySQL DB instances. We have to get connection details from payload as shown below in the screenshot.

No alt text provided for this image

Step 5: Select connection as MYSQL connection, And select Required libraries as mysql maven dependency, Click on finish. You should see this maven dependency in your project's? pom.xml file.

No alt text provided for this image

Step 6: Here Test connection feature will not work because we are getting DB details as dynamic from payload.?

Step 7: Now run your application. And you will be able to connect with multiple DB instances.?






要查看或添加评论,请登录

Silverline in India的更多文章

社区洞察

其他会员也浏览了