Configuring Connection Details
This section provides instructions for configuring the connection details required to establish communication between the Micro-Integration and your third-party system.
For information about configuring the connection to the event broker, see Connecting to Your Event Broker.
This Micro-Integration supports workflows only in the direction of:
-
IBM Db2 to Solace
The name of the binder for IBM Db2 CDC is db2cdc.
To share settings across all workflows in a Micro-Integration, configure the parameters using default instead of a workflow-specific identifier (for example, input-0). This reduces repetition when multiple workflows use the same parameter values. Workflow-specific settings override default settings when both are present.
IBM Db2 CDC Database Prerequisites
For the Micro-Integration to capture change events from IBM Db2 tables, a database administrator must configure the database for Change Data Capture (CDC). Unlike some other databases, IBM Db2 requires additional setup to enable SQL Replication (ASN), which is the mechanism the Micro-Integration uses to read database changes.
The following procedure uses Debezium user-defined functions (UDFs) to enable ASN and put tables into capture mode. Alternatively, you can use IBM Db2 control commands. After setup, you can adjust the capture agent configuration to optimize performance.
Before you run the following steps, ensure that:
-
You are logged in to IBM Db2 as the
db2inst1user. -
On the IBM Db2 host, the Debezium management UDFs are available in the
$HOME/asncdctools/srcdirectory. UDFs are available from the Debezium examples repository. -
The IBM Db2 command
bldrtnis on PATH, for example by runningexport PATH=$PATH:/opt/ibm/db2/V11.5.0.0/samples/c/with IBM Db2 11.5.
Boolean Support
IBM Db2 provides native support for the BOOLEAN data type; however, SQL replication does not support BOOLEAN columns for CDC. Due to this limitation, the Micro-Integration cannot retrieve change data capture (CDC) events from tables that contain BOOLEAN columns.
Debezium can perform only initial snapshots on tables that contain BOOLEAN columns. Continuous change data capture (CDC) is not supported for these tables.
To avoid this limitation, we recommend that you do not to use BOOLEAN columns directly in tables for which you want to capture CDC events. As an alternative, you can model boolean values using numeric columns, typically SMALLINT, where 1 represents true and 0 represents false.
To enable automatic conversion of these columns to Boolean values in CDC events, specify the columns that represent boolean values by adding one or more regular expressions to the db2BooleanSelector property in application.yml, as shown in the following example, where the required column is named SMALLINT_COLUMN:
db2cdc:
bindings:
input-0:
consumer:
endpoint:
query-parameters:
skipDeleteEvents: false
schemaHistoryInternalStoreOnlyCapturedTablesDdl: true
db2BooleanSelector: .*.SMALLINT_COLUMN
IBM Db2 CDC Connection Details
To manually configure the IBM Db2 CDC connection details, set the following properties in application.yml:
spring:
cloud:
stream:
db2cdc:
bindings:
input-0:
consumer:
endpoint:
query-parameters:
databaseHostname: <hostname>
databasePort: <port>
databaseDbname: <database name>
databaseUser: <username>
databasePassword: <password>
<authentication parameter>: <authentication parameter value>
<authentication parameter>: <authentication parameter value>
...
Where:
-
databaseHostnameis the hostname or IP address of the IBM Db2 database server. -
databasePortis the connection port of the IBM Db2 database server. -
databaseDbnameis the IBM Db2 database name. -
databaseUseris the IBM Db2 user to log in as. -
<authentication parameter>is one of the parameters required for authenticating with the IBM Db2 database server using client certificate authentication. For more information, see Client Certificate Authentication Parameters.
Client Certificate Authentication Parameters
For SSL/TLS certificate-based authentication, configure the following SSL properties in addition to the basic connection parameters.
| Field | Type | Description |
|---|---|---|
|
|
String
|
Specifies whether to use an encrypted connection. Set to |
db2SslTruststoreLocation
|
String
|
The path to the truststore file containing trusted certificates for the IBM Db2 server. |
db2SslTruststorePassword
|
String
|
The password for the truststore file. |
db2SslTruststoreType
|
String
|
The type of the SSL truststore. Specify one of:
|
Checkpoint Store Configuration
The IBM Db2 CDC stores the information about the current progress of processing change events in a checkpoint store backed by a Last Value Queue (LVQ) on a Solace event broker.
For example, add the following settings to the application.yml file:
solace:
db2cdc:
checkpoint:
lvqName: <LVQ name>
autoProvisionLvq: true
The following table lists the configuration options for the Checkpoint Store.
| Config Option | Type | Valid Values | Default Value | Description |
|---|---|---|---|---|
|
|
|
Required. The name of the event broker Last Value Queue (spool size 0) to be used for checkpointing. The queue must exist on the same event broker and Message VPN as the target queue. If the LVQ is deleted (administratively) or a message from the LVQ is deleted or consumed by another consumer, the IBM Db2 CDC will not be able to resume from the last checkpoint. In addition, the LVQ should not be shared by multiple instances of the IBM Db2 CDC. |
||
|
|
|
|
|
Optional. Set to |
IBM Db2 CDC Binder Configuration Options
The following properties are available at the IBM Db2 CDC binder level.
| Config Option | Type | Valid Values | Description |
|---|---|---|---|
|
|
|
For example, |
The IBM Db2 table from which to consume change events. The destination must include the database name and the name of the table. |
|
|
|
|
This property must be set to |
IBM Db2 CDC Consumer Configuration Options
The following table lists the source-specific properties for Debezium IBM Db2 CDC.
All properties must be prefixed with spring.cloud.stream.db2cdc.bindings.input-<workflow-id>.consumer.endpoint.query-parameters.
Example configuration:
spring:
cloud:
stream:
db2cdc:
bindings:
input-0:
consumer:
endpoint:
query-parameters:
<connection parameters>
skipDeleteEvents: true
snapshotMode: initial
...
|
|
Type | Valid Values | Default Value | Description |
|---|---|---|---|---|
db2BooleanSelector |
String
|
None
|
A regular expression to select SMALLINT columns that represent boolean values. |
|
skipDeleteEvents
|
boolean
|
[true | false]
|
false
|
When true, indicates that the Micro-Integration skips DELETE operation events. |
|
|
|
|
|
Controls initial snapshot behavior. Select one of the following snapshot options:
|
|
|
Integer
|
|
The maximum number of events to batch. |
|
|
|
Integer
|
|
The maximum size of the queue for change events read from the database log but not yet recorded or forwarded. Always set this value to be larger than the maximum batch size. |
|
includeSchemaChanges
|
boolean
|
[true | false]
|
false
|
When true, indicates that the Micro-Integration captures DDL schema changes. |
tombstonesOnDelete
|
boolean
|
[true | false]
|
true
|
Controls whether a delete event is followed by a tombstone event:
|
|
|
String
|
fail, warn, skip
|
|
Specifies how the Micro-Integration handles exceptions during processing of events. The possible values are:
|
schemaNameAdjustmentMode
|
String
|
none, avro, avro_unicode
|
None
|
Controls how schema and table names are adjusted to comply with serialization constraints:
|
decimalHandlingMode
|
String
|
double, string, precise
|
double
|
Specifies how DECIMAL and NUMERIC types are represented in change events:
|
timePrecisionMode
|
String
|
adaptive, connect
|
adaptive
|
Determines how temporal types are represented in emitted events. Values include:
|
tableExcludeList
|
String
|
null
|
A comma-separated list of regular expressions that match the fully-qualified names of tables to be excluded from monitoring. | |
|
|
String
|
c, u, d, t
|
|
A comma-separated list of the operation types that you want the Micro-Integration to skip during streaming. You can configure the Micro-Integration to skip the following types of operations:
|
schemaHistoryInternalStoreOnlyCapturedTablesDdl
|
String
|
[true | false]
|
true
|
Property that controls the Debezium DDL; if set to false, it captures all available tables. |