![]() |
VOOZH | about |
Apache NiFi supports powerful and scalable directed graphs of data routing, transformation, and system mediation logic. When paired with the CData JDBC Driver for Adobe Commerce, NiFi can work with live Adobe Commerce data. This article shows how to read data from a CSV file and perform batch operations (INSERT/UPDATE/DELETE) using the CData JDBC Driver for Adobe Commerce data in Apache NiFi (version 1.9.0 or later).
With built-in optimized data processing, the CData JDBC Driver offers unmatched performance for interacting with live Adobe Commerce data. When you issue complex SQL queries to Adobe Commerce, the driver pushes supported SQL operations, like filters and aggregations, directly to Adobe Commerce and utilizes the embedded SQL engine to process unsupported operations client-side (often SQL functions and JOIN operations). Its built-in dynamic metadata querying allows you to work with and analyze Adobe Commerce data using native data types.
We need a JDBC URL to connect to Adobe Commerce data from Apachi NiFi.
For assistance in constructing the JDBC URL, use the connection string designer built into the Adobe Commerce JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.adobe commerce.jar
Fill in the connection properties and copy the connection string to the clipboard.
Adobe Commerce uses the OAuth 1 authentication standard. To connect to the Adobe Commerce REST API, obtain values for the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties by registering an app with your Adobe Commerce system. See the "Getting Started" section in the help documentation for a guide to obtaining the OAuth values and connecting.
You will also need to provide the URL to your Adobe Commerce system. The URL depends on whether you are using the Adobe Commerce REST API as a customer or administrator.
Customer: To use Adobe Commerce as a customer, make sure you have created a customer account in the Adobe Commerce homepage. To do so, click Account -> Register. You can then set the URL connection property to the endpoint of your Adobe Commerce system.
Administrator: To access Adobe Commerce as an administrator, set CustomAdminPath instead. This value can be obtained in the Advanced settings in the Admin menu, which can be accessed by selecting System -> Configuration -> Advanced -> Admin -> Admin Base URL.
If the Use Custom Admin Path setting on this page is set to YES, the value is inside the Custom Admin Path text box; otherwise, set the CustomAdminPath connection property to the default value, which is "admin".
The sample flow presented below is based on the following NiFi Processors:
This is what our finished product looks like:
π NiFi GUI1. The column names of the CSV file must match the column names of the data source table records to be inserted/updated/deleted.
2. Apache NiFi versions earlier than 1.9.0 do not support the Maximum Batch Size property in the PutDatabaseRecord processor.
In order to perform batch INSERT, UPDATE or DELETE, the NiFi Processors should be configured similar to the following:
Configure the PutDatabaseRecord processor similar to the following in order to perform Batch INSERT Operations:
π config for PutDatabaseRecord-INSERT| Property | Value |
|---|---|
| Database Connection URL | jdbc:adobe commerce:OAuthClientId=MyConsumerKey;OAuthClientSecret=MyConsumerSecret;CallbackURL=http://127.0.0.1:33333;Url=https://myAdobe Commercehost.com; |
| Database Driver Class Name | cdata.jdbc.adobe commerce.Adobe CommerceDriver |
Configure the PutDatabaseRecord processor similar to the following in order to perform Batch UPDATE Operations:
Configure the PutDatabaseRecord processor similar to the following in order to perform Batch DELETE Operations:
Finally, configure the LogAttribute processor by specifying the Attributes that you would like to log or ignore, as well as the log level, based on your use case.
Download a free, 30-day trial of the CData JDBC Driver for Adobe Commerce and start working with your live Adobe Commerce data in Apache NiFi. Reach out to our Support Team if you have any questions.
Download a free trial of the Adobe Commerce Driver to get started:
Download NowLearn more:
π Adobe Commerce IconRapidly create and deploy powerful Java applications that integrate with Adobe Commerce including Customers, Inventory, Products, Orders, and more!