blob: 8642926e9c64c5421236decdcff769624b630cae [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>CaptureChangeMySQL</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">CaptureChangeMySQL</h1><h2>Description: </h2><p>Retrieves Change Data Capture (CDC) events from a MySQL database. CDC Events include INSERT, UPDATE, DELETE operations. Events are output as individual flow files ordered by the time at which the operation occurred.</p><h3>Tags: </h3><p>sql, jdbc, cdc, mysql</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>MySQL Hosts</strong></td><td>capture-change-mysql-hosts</td><td></td><td id="allowable-values"></td><td id="description">A list of hostname/port entries corresponding to nodes in a MySQL cluster. The entries should be comma separated using a colon such as host1:port,host2:port,.... For example mysql.myhost.com:3306. This processor will attempt to connect to the hosts in the list in order. If one node goes down and failover is enabled for the cluster, then the processor will connect to the active node (assuming its host entry is specified in this property. The default port for MySQL connections is 3306.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name"><strong>MySQL Driver Class Name</strong></td><td>capture-change-mysql-driver-class</td><td id="default-value">com.mysql.jdbc.Driver</td><td id="allowable-values"></td><td id="description">The class name of the MySQL database driver class<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">MySQL Driver Location(s)</td><td>capture-change-mysql-driver-locations</td><td></td><td id="allowable-values"></td><td id="description">Comma-separated list of files/folders and/or URLs containing the MySQL driver JAR and its dependencies (if any). For example '/var/tmp/mysql-connector-java-5.1.38-bin.jar'<br/><br/><strong>This property expects a comma-separated list of resources. Each of the resources may be of any of the following types: directory, file, URL.</strong><br/><br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Username</td><td>capture-change-mysql-username</td><td></td><td id="allowable-values"></td><td id="description">Username to access the MySQL cluster<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Password</td><td>capture-change-mysql-password</td><td></td><td id="allowable-values"></td><td id="description">Password to access the MySQL cluster<br/><strong>Sensitive Property: true</strong><br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Server ID</td><td>capture-change-mysql-server-id</td><td></td><td id="allowable-values"></td><td id="description">The client connecting to the MySQL replication group is actually a simplified replica (server), and the Server ID value must be unique across the whole replication group (i.e. different from any other Server ID being used by any primary or replica). Thus, each instance of CaptureChangeMySQL must have a Server ID unique across the replication group. If the Server ID is not specified, it defaults to 65535.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Database/Schema Name Pattern</td><td>capture-change-mysql-db-name-pattern</td><td></td><td id="allowable-values"></td><td id="description">A regular expression (regex) for matching databases (or schemas, depending on your RDBMS' terminology) against the list of CDC events. The regex must match the database name as it is stored in the RDBMS. If the property is not set, the database name will not be used to filter the CDC events. NOTE: DDL events, even if they affect different databases, are associated with the database used by the session to execute the DDL. This means if a connection is made to one database, but the DDL is issued against another, then the connected database will be the one matched against the specified pattern.</td></tr><tr><td id="name">Table Name Pattern</td><td>capture-change-mysql-name-pattern</td><td></td><td id="allowable-values"></td><td id="description">A regular expression (regex) for matching CDC events affecting matching tables. The regex must match the table name as it is stored in the database. If the property is not set, no events will be filtered based on table name.</td></tr><tr><td id="name"><strong>Max Wait Time</strong></td><td>capture-change-mysql-max-wait-time</td><td id="default-value">30 seconds</td><td id="allowable-values"></td><td id="description">The maximum amount of time allowed for a connection to be established, zero means there is effectively no limit.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Distributed Map Cache Client</td><td>capture-change-mysql-dist-map-cache-client</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>DistributedMapCacheClient<br/><strong>Implementations: </strong><a href="../../../nifi-distributed-cache-services-nar/1.19.1/org.apache.nifi.distributed.cache.client.DistributedMapCacheClientService/index.html">DistributedMapCacheClientService</a><br/><a href="../../../nifi-redis-nar/1.19.1/org.apache.nifi.redis.service.RedisDistributedMapCacheClientService/index.html">RedisDistributedMapCacheClientService</a><br/><a href="../../../nifi-hbase_1_1_2-client-service-nar/1.19.1/org.apache.nifi.hbase.HBase_1_1_2_ClientMapCacheService/index.html">HBase_1_1_2_ClientMapCacheService</a><br/><a href="../../../nifi-hazelcast-services-nar/1.19.1/org.apache.nifi.hazelcast.services.cacheclient.HazelcastMapCacheClient/index.html">HazelcastMapCacheClient</a><br/><a href="../../../nifi-hbase_2-client-service-nar/1.19.1/org.apache.nifi.hbase.HBase_2_ClientMapCacheService/index.html">HBase_2_ClientMapCacheService</a><br/><a href="../../../nifi-cassandra-services-nar/1.19.1/org.apache.nifi.controller.cassandra.CassandraDistributedMapCache/index.html">CassandraDistributedMapCache</a><br/><a href="../../../nifi-couchbase-nar/1.19.1/org.apache.nifi.couchbase.CouchbaseMapCacheClient/index.html">CouchbaseMapCacheClient</a></td><td id="description">Identifies a Distributed Map Cache Client controller service to be used for keeping information about the various tables, columns, etc. needed by the processor. If a client is not specified, the generated events will not include column type or name information.</td></tr><tr><td id="name"><strong>Retrieve All Records</strong></td><td>capture-change-mysql-retrieve-all-records</td><td id="default-value">true</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Specifies whether to get all available CDC events, regardless of the current binlog filename and/or position. If binlog filename and position values are present in the processor's State, this property's value is ignored. This allows for 4 different configurations: 1) If binlog data is available in processor State, that is used to determine the start location and the value of Retrieve All Records is ignored. 2) If no binlog data is in processor State, then Retrieve All Records set to true means start at the beginning of the binlog history. 3) If no binlog data is in processor State and Initial Binlog Filename/Position are not set, then Retrieve All Records set to false means start at the end of the binlog history. 4) If no binlog data is in processor State and Initial Binlog Filename/Position are set, then Retrieve All Records set to false means start at the specified initial binlog file/position. To reset the behavior, clear the processor state (refer to the State Management section of the processor's documentation).</td></tr><tr><td id="name"><strong>Include Begin/Commit Events</strong></td><td>capture-change-mysql-include-begin-commit</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Specifies whether to emit events corresponding to a BEGIN or COMMIT event in the binary log. Set to true if the BEGIN/COMMIT events are necessary in the downstream flow, otherwise set to false, which suppresses generation of these events and can increase flow performance.</td></tr><tr><td id="name"><strong>Include DDL Events</strong></td><td>capture-change-mysql-include-ddl-events</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Specifies whether to emit events corresponding to Data Definition Language (DDL) events such as ALTER TABLE, TRUNCATE TABLE, e.g. in the binary log. Set to true if the DDL events are desired/necessary in the downstream flow, otherwise set to false, which suppresses generation of these events and can increase flow performance.</td></tr><tr><td id="name"><strong>State Update Interval</strong></td><td>capture-change-mysql-state-update-interval</td><td id="default-value">0 seconds</td><td id="allowable-values"></td><td id="description">DEPRECATED. This property is no longer used and exists solely for backward compatibility purposes. Indicates how often to update the processor's state with binlog file/position values. A value of zero means that state will only be updated when the processor is stopped or shutdown. If at some point the processor state does not contain the desired binlog values, the last flow file emitted will contain the last observed values, and the processor can be returned to that state by using the Initial Binlog File, Initial Binlog Position, and Initial Sequence ID properties.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Initial Sequence ID</td><td>capture-change-mysql-init-seq-id</td><td></td><td id="allowable-values"></td><td id="description">Specifies an initial sequence identifier to use if this processor's State does not have a current sequence identifier. If a sequence identifier is present in the processor's State, this property is ignored. Sequence identifiers are monotonically increasing integers that record the order of flow files generated by the processor. They can be used with the EnforceOrder processor to guarantee ordered delivery of CDC events.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Initial Binlog Filename</td><td>capture-change-mysql-init-binlog-filename</td><td></td><td id="allowable-values"></td><td id="description">Specifies an initial binlog filename to use if this processor's State does not have a current binlog filename. If a filename is present in the processor's State or "Use GTID" property is set to false, this property is ignored. This can be used along with Initial Binlog Position to "skip ahead" if previous events are not desired. Note that NiFi Expression Language is supported, but this property is evaluated when the processor is configured, so FlowFile attributes may not be used. Expression Language is supported to enable the use of the Variable Registry and/or environment properties.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Initial Binlog Position</td><td>capture-change-mysql-init-binlog-position</td><td></td><td id="allowable-values"></td><td id="description">Specifies an initial offset into a binlog (specified by Initial Binlog Filename) to use if this processor's State does not have a current binlog filename. If a filename is present in the processor's State or "Use GTID" property is false, this property is ignored. This can be used along with Initial Binlog Filename to "skip ahead" if previous events are not desired. Note that NiFi Expression Language is supported, but this property is evaluated when the processor is configured, so FlowFile attributes may not be used. Expression Language is supported to enable the use of the Variable Registry and/or environment properties.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name"><strong>Use Binlog GTID</strong></td><td>capture-change-mysql-use-gtid</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Specifies whether to use Global Transaction ID (GTID) for binlog tracking. If set to true, processor's state of binlog file name and position is ignored. The main benefit of using GTID is to have much reliable failover than using binlog filename/position.</td></tr><tr><td id="name">Initial Binlog GTID</td><td>capture-change-mysql-init-gtid</td><td></td><td id="allowable-values"></td><td id="description">Specifies an initial GTID to use if this processor's State does not have a current GTID. If a GTID is present in the processor's State or "Use GTID" property is set to false, this property is ignored. This can be used to "skip ahead" if previous events are not desired. Note that NiFi Expression Language is supported, but this property is evaluated when the processor is configured, so FlowFile attributes may not be used. Expression Language is supported to enable the use of the Variable Registry and/or environment properties.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name"><strong>SSL Mode</strong></td><td>SSL Mode</td><td id="default-value">DISABLED</td><td id="allowable-values"><ul><li>DISABLED <img src="../../../../../html/images/iconInfo.png" alt="Connect without TLS" title="Connect without TLS"></img></li><li>PREFERRED <img src="../../../../../html/images/iconInfo.png" alt="Connect with TLS when server support enabled, otherwise connect without TLS" title="Connect with TLS when server support enabled, otherwise connect without TLS"></img></li><li>REQUIRED <img src="../../../../../html/images/iconInfo.png" alt="Connect with TLS or fail when server support not enabled" title="Connect with TLS or fail when server support not enabled"></img></li><li>VERIFY_IDENTITY <img src="../../../../../html/images/iconInfo.png" alt="Connect with TLS or fail when server support not enabled. Verify server hostname matches presented X.509 certificate names or fail when not matched" title="Connect with TLS or fail when server support not enabled. Verify server hostname matches presented X.509 certificate names or fail when not matched"></img></li></ul></td><td id="description">SSL Mode used when SSL Context Service configured supporting certificate verification options</td></tr><tr><td id="name">SSL Context Service</td><td>SSL Context Service</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>SSLContextService<br/><strong>Implementations: </strong><a href="../../../nifi-ssl-context-service-nar/1.19.1/org.apache.nifi.ssl.StandardRestrictedSSLContextService/index.html">StandardRestrictedSSLContextService</a><br/><a href="../../../nifi-ssl-context-service-nar/1.19.1/org.apache.nifi.ssl.StandardSSLContextService/index.html">StandardSSLContextService</a></td><td id="description">SSL Context Service supporting encrypted socket communication<br/><br/><strong>This Property is only considered if </strong><strong>the [SSL Mode] Property is set to one of the following values: [PREFERRED], [VERIFY_IDENTITY], [REQUIRED]</strong></td></tr></table><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>success</td><td>Successfully created FlowFile from SQL query result set.</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3><table id="writes-attributes"><tr><th>Name</th><th>Description</th></tr><tr><td>cdc.sequence.id</td><td>A sequence identifier (i.e. strictly increasing integer value) specifying the order of the CDC event flow file relative to the other event flow file(s).</td></tr><tr><td>cdc.event.type</td><td>A string indicating the type of CDC event that occurred, including (but not limited to) 'begin', 'insert', 'update', 'delete', 'ddl' and 'commit'.</td></tr><tr><td>mime.type</td><td>The processor outputs flow file content in JSON format, and sets the mime.type attribute to application/json</td></tr></table><h3>State management: </h3><table id="stateful"><tr><th>Scope</th><th>Description</th></tr><tr><td>CLUSTER</td><td>Information such as a 'pointer' to the current CDC event in the database is stored by this processor, such that it can continue from the same location if restarted.</td></tr></table><h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component does not allow an incoming relationship.<h3>System Resource Considerations:</h3>None specified.</body></html>