anchor.diff:  ifdef::product[]
   Details are in the following topics:
   
  -* xref:how-debezium-db2-connectors-perform-database-snapshots[]
  +* xref:db2-snapshots[]
   * xref:how-debezium-db2-connectors-read-change-data-tables[]
   * xref:default-names-of-kafka-topics-that-receive-db2-change-event-records[]
   * xref:about-the-debezium-db2-connector-schema-change-topic[]
  
positive.code: . Create a configuration for the Db2 connector.
  
  . Use the link:{link-kafka-docs}/#connect_rest[Kafka Connect REST API] to add that connector configuration to your Kafka Connect cluster.
  
  endif::community[]
  
  ifdef::product[]
  You can use a provided {prodname} container to deploy a {prodname} Db2 connector. In this procedure, you build a custom Kafka Connect container image for {prodname}, configure the {prodname} connector as needed, and then add your connector configuration to your Kafka Connect environment.
  
  .Prerequisites
  
  * Podman or Docker is installed and you have sufficient rights to create and manage containers.
  * You installed the {prodname} Db2 connector archive.
  
  .Procedure
  
  . Extract the {prodname} Db2 connector archive to create a directory structure for the connector plug-in, for example:
  +
  [subs=+macros]
  ----
  pass:quotes[*tree ./my-plugins/*]
  ./my-plugins/
  ├── debezium-connector-db2
  │   ├── ...
  ----
  
  . Create and publish a custom image for running your {prodname} connector:
  
  .. Create a new `Dockerfile` by using `{DockerKafkaConnect}` as the base image. In the following example, you would replace _my-plugins_ with the name of your plug-ins directory:
  +
  [subs="+macros,+attributes"]
  ----
  FROM {DockerKafkaConnect}
  USER root:root
  pass:quotes[COPY _./my-plugins/_ /opt/kafka/plugins/]
  USER 1001
  ----
  +
  Before Kafka Connect starts running the connector, Kafka Connect loads any third-party plug-ins that are in the `/opt/kafka/plugins` directory.
  
  .. Build the container image. For example, if you saved the `Dockerfile` that you created in the previous step as `debezium-container-for-db2`, and if the `Dockerfile` is in the current directory, then you would run the following command:
  +
  `podman build -t debezium-container-for-db2:latest .`
  
  .. Push your custom image to your container registry, for example:
  +
  `podman push debezium-container-for-db2:latest`
  
  .. Point to the new container image. Do one of the following:
  +
  * Edit the `spec.image` property of the `KafkaConnector` custom resource. If set, this property overrides the `STRIMZI_DEFAULT_KAFKA_CONNECT_IMAGE` variable in the Cluster Operator. For example:
  +
  [source,yaml,subs="+attributes"]
  ----
  apiVersion: {KafkaConnectApiVersion}
  kind: KafkaConnector
  metadata:
    name: my-connect-cluster
  spec:
    #...
    image: debezium-container-for-db2
  ----
  +
  * In the `install/cluster-operator/050-Deployment-strimzi-cluster-operator.yaml` file, edit the `STRIMZI_DEFAULT_KAFKA_CONNECT_IMAGE` variable to point to the new container image and reinstall the Cluster Operator. If you edit this file you must apply it to your OpenShift cluster.
  
  . Create a `KafkaConnector` custom resource that defines your {prodname} Db2 connector instance. See {LinkDebeziumUserGuide}#debezium-db2-connector-configuration-example[the connector configuration example].
  
  . Apply the connector instance, for example:
  +
  `oc apply -f inventory-connector.yaml`
  +
  This registers `inventory-connector` and the connector starts to run against the `inventory` database.
  
  . Verify that the connector was created and has started to capture changes in the specified database. You can verify the connector instance by watching the Kafka Connect log output as, for example, `inventory-connector` starts.
  
  .. Display the Kafka Connect log output:
  +
  [source,shell,options="nowrap"]
  ----
  oc logs $(oc get pods -o name -l strimzi.io/name=my-connect-cluster-connect)
  ----
  
  .. Review the log output to verify that the initial snapshot has been executed. You should see something like the following lines:
  +
  [source,shell,options="nowrap"]
  ----
  ... INFO Starting snapshot for ...
  ... INFO Snapshot is using user 'debezium' ...
  ----
  
  endif::product[]
  
  .Results
  
  When the connector starts, it {link-prefix}:{link-db2-connector}#db2-snapshots[performs a consistent snapshot] of the Db2 database tables that the connector is configured to capture changes for. The connector then starts generating data change events for row-level operations and streaming change event records to Kafka topics.
  
  // Type: reference
  // ModuleID: descriptions-of-debezium-db2-connector-configuration-properties
  // Title: Description of {prodname} Db2 connector configuration properties
  [[db2-connector-properties]]
  === Connector properties
  
negative.code: endif::product[]
  
  // Type: concept
  // Title: How {prodname} Db2 connectors perform database snapshots
  [[db2-snapshots]]
  === Snapshots
  