Class KafkaWriter
java.lang.Object
org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter
org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriter
org.jumpmind.symmetric.io.data.writer.DynamicDefaultDatabaseWriter
org.jumpmind.symmetric.io.data.writer.KafkaWriter
- All Implemented Interfaces:
IDataResource,IDataWriter
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter
AbstractDatabaseWriter.LoadStatus -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected final Stringstatic final Stringstatic final Stringprotected StringFields inherited from class org.jumpmind.symmetric.io.data.writer.DynamicDefaultDatabaseWriter
tablePrefix, targetPlatform, targetTransactionFields inherited from class org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriter
CUR_DATA, currentDmlStatement, currentDmlValues, hasUncommittedDdl, isCteExpression, logSqlBuilder, platform, transactionFields inherited from class org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter
batch, CONFLICT_ERROR, CONFLICT_IGNORE, conflictResolver, context, isRequiresSavePointsInTransaction, lastApplyChangesOnly, lastData, lastUseConflictDetection, missingTables, sourceTable, statistics, targetColumnSourceReferencesMap, targetTable, targetTables, TRANSACTION_ABORTED, uncommittedCount, writerSettings -
Constructor Summary
ConstructorsConstructorDescriptionKafkaWriter(IDatabasePlatform symmetricPlatform, IDatabasePlatform targetPlatform, String prefix, IDatabaseWriterConflictResolver conflictResolver, DatabaseWriterSettings settings, String producer, String outputFormat, String topicBy, String messageBy, String confluentUrl, String schemaPackage, String externalNodeID, String url, String loadOnlyPrefix, TypedProperties props, String runtimeConfigTablePrefix, String channelReload) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidallowInsertIntoAutoIncrementColumns(boolean value, Table table) voidbatchComplete(DataContext context) protected booleanstatic byte[]datumToByteArray(org.apache.avro.Schema schema, org.apache.avro.generic.GenericRecord datum) protected AbstractDatabaseWriter.LoadStatusvoidprotected intClass<?>getClassByTableName(String tableName) getColumnName(String dbTableName, String dbColumnName, Object bean) getTableName(String dbTableName) protected voidlogFailureDetails(Throwable e, CsvData data, boolean logLastDmlDetails) protected TablelookupTableAtTarget(Table sourceTable) protected voidprepare()protected voidintprepareAndExecute(String sql, CsvData data) voidsendKafkaMessage(org.apache.kafka.clients.producer.ProducerRecord<String, Object> record) protected booleanprotected AbstractDatabaseWriter.LoadStatusintwriteKafka(CsvData data, Table table) Methods inherited from class org.jumpmind.symmetric.io.data.writer.DynamicDefaultDatabaseWriter
close, commit, getPlatform, getPlatform, getPlatform, getTablePrefix, getTargetPlatform, getTargetTransaction, getTransaction, getTransaction, getTransaction, isLoadOnly, isSymmetricTable, isSymmetricTable, open, rollbackMethods inherited from class org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriter
bindVariables, checkTargetTableHasColumns, commit, containsNullLookupKeyDataSinceLastStatement, create, dmlValuesToString, doesColumnNeedUpdated, end, getCurData, getCurrentDmlStatement, getSqlStatements, getTableKey, getWriterSettings, insert, isCteExpression, isDml, logDataTruncation, logFailureDetails, lookupTableFromCache, preprocessSqlStatement, putTableInCache, quoteString, removeGeneratedColumns, replaceCteExpression, replaceCteExpression, requireNewStatement, start, targetTableWasChangedByFilter, updateChangedDataIndicatorMethods inherited from class org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter
buildTargetColumnReferencesMap, checkForEarlyCommit, clearTargetColumnReferencesMap, filterAfter, filterBefore, filterError, getBatch, getConflictResolver, getContext, getLookupDataMap, getPkDataFor, getRowData, getSourceTable, getStatistics, getTargetColumnReferencesMap, getTargetTable, hasFilterThatHandlesMissingTable, notifyFiltersBatchCommitted, notifyFiltersBatchComplete, notifyFiltersBatchRolledback, notifyFiltersEarlyCommit, refreshTargetColumnReferencesMap, script, setConflictResolver, start, write
-
Field Details
-
KAFKA_TEXT_CACHE
-
kafkaDataMap
-
kafkaDataKey
-
KAFKA_FORMAT_XML
- See Also:
-
KAFKA_FORMAT_JSON
- See Also:
-
KAFKA_FORMAT_AVRO
- See Also:
-
KAFKA_FORMAT_CSV
- See Also:
-
KAFKA_MESSAGE_BY_BATCH
- See Also:
-
KAFKA_MESSAGE_BY_ROW
- See Also:
-
KAFKA_TOPIC_BY_TABLE
- See Also:
-
KAFKA_TOPIC_BY_CHANNEL
- See Also:
-
AVRO_CDC_SCHEMA
- See Also:
-
KAFKA_SECURITY_PROTOCOL_PLAINTEXT
- See Also:
-
KAFKA_SECURITY_PROTOCOL_SASL_PLAINTEXT
- See Also:
-
KAFKA_SECURITY_PROTOCOL_SASL_SSL
- See Also:
-
KAFKA_SECURITY_PROTOCOL_SSL
- See Also:
-
kafkaProducer
-
producerMap
-
-
Constructor Details
-
KafkaWriter
public KafkaWriter(IDatabasePlatform symmetricPlatform, IDatabasePlatform targetPlatform, String prefix, IDatabaseWriterConflictResolver conflictResolver, DatabaseWriterSettings settings, String producer, String outputFormat, String topicBy, String messageBy, String confluentUrl, String schemaPackage, String externalNodeID, String url, String loadOnlyPrefix, TypedProperties props, String runtimeConfigTablePrefix, String channelReload)
-
-
Method Details
-
prepare
protected void prepare()- Overrides:
preparein classDefaultDatabaseWriter
-
prepare
- Overrides:
preparein classDefaultDatabaseWriter
-
prepareAndExecute
- Overrides:
prepareAndExecutein classDefaultDatabaseWriter
-
execute
- Overrides:
executein classDefaultDatabaseWriter
-
delete
- Overrides:
deletein classDefaultDatabaseWriter
-
update
protected AbstractDatabaseWriter.LoadStatus update(CsvData data, boolean applyChangesOnly, boolean useConflictDetection) - Overrides:
updatein classDefaultDatabaseWriter
-
create
- Overrides:
createin classDefaultDatabaseWriter
-
sql
- Overrides:
sqlin classDefaultDatabaseWriter
-
logFailureDetails
- Overrides:
logFailureDetailsin classDefaultDatabaseWriter
-
allowInsertIntoAutoIncrementColumns
- Overrides:
allowInsertIntoAutoIncrementColumnsin classDefaultDatabaseWriter
-
lookupTableAtTarget
- Overrides:
lookupTableAtTargetin classDefaultDatabaseWriter
-
end
- Specified by:
endin interfaceIDataWriter- Overrides:
endin classDefaultDatabaseWriter
-
getTableName
-
getClassByTableName
-
getColumnName
-
sendKafkaMessage
-
datumToByteArray
public static byte[] datumToByteArray(org.apache.avro.Schema schema, org.apache.avro.generic.GenericRecord datum) throws IOException - Throws:
IOException
-
batchComplete
-
writeKafka
-