IBM watsonx.data
Since Camel 4.19
Only producer is supported
The IBM watsonx.data component provides integration with IBM watsonx.data, an open lakehouse platform for data analytics and AI workloads. It allows you to manage catalogs, schemas, tables, query engines, and storage registrations programmatically.
This component is built on top of the IBM watsonx.data Java SDK.
Prerequisites
You must have a valid IBM Cloud account with access to watsonx.data services. More information is available at IBM watsonx.data.
To use this component, you need:
-
An IBM Cloud API key
-
The watsonx.data service URL for your region
Configuring Options
Camel components are configured on two separate levels:
-
component level
-
endpoint level
Configuring Component Options
At the component level, you set general and shared configurations that are, then, inherited by the endpoints. It is the highest configuration level.
For example, a component may have security settings, credentials for authentication, urls for network connection and so forth.
Some components only have a few options, and others may have many. Because components typically have pre-configured defaults that are commonly used, then you may often only need to configure a few options on a component; or none at all.
You can configure components using:
-
the Component DSL.
-
in a configuration file (
application.properties,*.yamlfiles, etc). -
directly in the Java code.
Configuring Endpoint Options
You usually spend more time setting up endpoints because they have many options. These options help you customize what you want the endpoint to do. The options are also categorized into whether the endpoint is used as a consumer (from), as a producer (to), or both.
Configuring endpoints is most often done directly in the endpoint URI as path and query parameters. You can also use the Endpoint DSL and DataFormat DSL as a type safe way of configuring endpoints and data formats in Java.
A good practice when configuring options is to use Property Placeholders.
Property placeholders provide a few benefits:
-
They help prevent using hardcoded urls, port numbers, sensitive information, and other settings.
-
They allow externalizing the configuration from the code.
-
They help the code to become more flexible and reusable.
The following two sections list all the options, firstly for the component followed by the endpoint.
Component Options
The IBM watsonx.data component supports 11 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
The watsonx.data instance CRN for API authorization. | String | ||
Required The watsonx.data service URL (e.g., https://region.lakehouse.cloud.ibm.com/lakehouse/api/v2). | String | ||
The catalog name for catalog, schema, and table operations. | String | ||
The component configuration. | WatsonxDataConfiguration | ||
The engine ID for engine operations and schema/table queries. | String | ||
Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean | |
The operation to perform. Enum values:
| WatsonxDataOperations | ||
The schema name for schema and table operations. | String | ||
Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | |
Required IBM Cloud API key for authentication. | String | ||
OAuth profile name for obtaining an access token via the OAuth 2.0 Client Credentials grant. When set, the token is acquired from the configured identity provider and used as apiKey. Requires camel-oauth on the classpath. | String |
Endpoint Options
The IBM watsonx.data endpoint is configured using URI syntax:
ibm-watsonx-data:label
With the following path and query parameters:
Query Parameters (9 parameters)
| Name | Description | Default | Type |
|---|---|---|---|
The watsonx.data instance CRN for API authorization. | String | ||
Required The watsonx.data service URL (e.g., https://region.lakehouse.cloud.ibm.com/lakehouse/api/v2). | String | ||
The catalog name for catalog, schema, and table operations. | String | ||
The engine ID for engine operations and schema/table queries. | String | ||
The operation to perform. Enum values:
| WatsonxDataOperations | ||
The schema name for schema and table operations. | String | ||
Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean | |
Required IBM Cloud API key for authentication. | String | ||
OAuth profile name for obtaining an access token via the OAuth 2.0 Client Credentials grant. When set, the token is acquired from the configured identity provider and used as apiKey. Requires camel-oauth on the classpath. | String |
Message Headers
The IBM watsonx.data component supports 14 message header(s), which is/are listed below:
| Name | Description | Default | Type |
|---|---|---|---|
CamelIBMWatsonxDataOperation (producer) Constant: | The operation to perform. | WatsonxDataOperations | |
CamelIBMWatsonxDataCatalogName (producer) Constant: | The catalog name. | String | |
CamelIBMWatsonxDataSchemaName (producer) Constant: | The schema name. | String | |
CamelIBMWatsonxDataCustomPath (producer) Constant: | The custom path for schema creation. | String | |
CamelIBMWatsonxDataTableName (producer) Constant: | The table name. | String | |
CamelIBMWatsonxDataMetadataLocation (producer) Constant: | The metadata location for table registration (e.g., S3 path to Iceberg metadata). | String | |
CamelIBMWatsonxDataCatalogId (producer) Constant: | The catalog ID for table registration. | String | |
CamelIBMWatsonxDataSchemaId (producer) Constant: | The schema ID for table registration. | String | |
CamelIBMWatsonxDataEngineId (producer) Constant: | The engine ID. | String | |
CamelIBMWatsonxDataStorageDescription (producer) Constant: | The storage description for registration. | String | |
CamelIBMWatsonxDataStorageDisplayName (producer) Constant: | The storage display name for registration. | String | |
CamelIBMWatsonxDataStorageManagedBy (producer) Constant: | The storage managed by value (e.g., ibm, customer). | String | |
CamelIBMWatsonxDataStorageType (producer) Constant: | The storage type (e.g., ibm_cos, aws_s3, google_cs). | String | |
CamelIBMWatsonxDataAuthInstanceId (producer) Constant: | The auth instance ID for watsonx.data API calls. | String |
Authentication
The component supports authentication via IBM Cloud API Key:
from("direct:start")
.to("ibm-watsonx-data:myLakehouse?apiKey=YOUR_API_KEY"
+ "&serviceUrl=https://us-south.lakehouse.cloud.ibm.com/lakehouse/api/v2"
+ "&operation=listCatalogs"); OAuth 2.0 Client Credentials grant is also supported when camel-oauth is on the classpath:
from("direct:start")
.to("ibm-watsonx-data:myLakehouse?oauthProfile=ibm"
+ "&serviceUrl=https://us-south.lakehouse.cloud.ibm.com/lakehouse/api/v2"
+ "&operation=listCatalogs"); Operations
The component supports the following operations:
Catalog Operations
| Operation | Description |
|---|---|
| List all catalogs in the watsonx.data instance. |
| Get details of a specific catalog. Requires |
| Delete a catalog. Requires |
Schema Operations
| Operation | Description |
|---|---|
| List schemas in a catalog. Requires |
| Create a new schema. Requires |
| Delete a schema. Requires |
Table Operations
| Operation | Description |
|---|---|
| List tables in a schema. Requires |
| Get table details. Requires |
| Delete a table. Requires |
| Update table properties. Requires |
| Register an external Iceberg table. Requires |
| Get all columns for a catalog. Requires |
Engine Operations
| Operation | Description |
|---|---|
| List all Presto query engines. |
| Get details of a Presto engine. Requires |
| List all Prestissimo query engines. |
| Get details of a Prestissimo engine. Requires |
Storage Operations
| Operation | Description |
|---|---|
| List all registered storage locations. |
| Register a new storage location. Requires |
Examples
List Catalogs
from("direct:listCatalogs")
.to("ibm-watsonx-data:lakehouse?apiKey={{ibm.apiKey}}"
+ "&serviceUrl={{ibm.watsonxdata.url}}"
+ "&operation=listCatalogs")
.log("Catalogs: ${body}"); List Tables in a Schema
from("direct:listTables")
.to("ibm-watsonx-data:lakehouse?apiKey={{ibm.apiKey}}"
+ "&serviceUrl={{ibm.watsonxdata.url}}"
+ "&catalogName=my-catalog"
+ "&schemaName=my-schema"
+ "&engineId=my-presto-engine"
+ "&operation=listTables")
.log("Tables: ${body}"); Create a Schema
from("direct:createSchema")
.setHeader("CamelIBMWatsonxDataSchemaName", constant("new_schema"))
.setHeader("CamelIBMWatsonxDataCustomPath", constant("s3a://my-bucket/new_schema"))
.to("ibm-watsonx-data:lakehouse?apiKey={{ibm.apiKey}}"
+ "&serviceUrl={{ibm.watsonxdata.url}}"
+ "&catalogName=my-catalog"
+ "&engineId=my-engine"
+ "&operation=createSchema")
.log("Schema created: ${body}");