Skip to content

Instantly share code, notes, and snippets.

@chanakaudaya
Created December 16, 2020 08:22
Show Gist options
  • Save chanakaudaya/9b438d4275b89c17278f860e4869bf35 to your computer and use it in GitHub Desktop.
Save chanakaudaya/9b438d4275b89c17278f860e4869bf35 to your computer and use it in GitHub Desktop.
@App:name('CDCListenForInserts')
@App:description('Capture MySQL Inserts using CDC listening mode.')
@source(type = 'cdc', url = 'jdbc:mysql://localhost:3306/UserDataDB?useSSL=false', username = 'root', password = 'root123', table.name = 'UserTable', operation = 'insert',
@map(type = 'keyvalue'))
define stream InsertSweetProductionStream (userId string, firstname string, lastname string);
@sink(type = 'log')
define stream LogStream (userId string, firstname string, lastname string);
@info(name = 'query')
from InsertSweetProductionStream
select *
insert into LogStream;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment