Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql for SCN persistance #87

Merged
merged 3 commits into from
Feb 6, 2017
Merged

Mysql for SCN persistance #87

merged 3 commits into from
Feb 6, 2017

Conversation

rahuljoshi123
Copy link

@rahuljoshi123 rahuljoshi123 commented Feb 2, 2017

As of now, file and in memory MaxSCNReaderWriter are supported. If a machine goes down, in memory and local file system SCN is lost. Added mysql MaxSCNReaderWriter for fault tolerance and reliable persistence of SCN.
Others using databus might find this as useful. Please let me know your thoughts on this.

Added flexibility to declare schema of scn table and queries.

Note : Please don't add this scn table in source database and set flushItvl=1, it will cause an infinite loop.

Example configs :
databus.relay.dataSources.sequenceNumbersHandler.type=MYSQL
databus.relay.dataSources.sequenceNumbersHandler.mysql.jdbcUrl=jdbc:mysql://mysqlhost:port/dbName
databus.relay.dataSources.sequenceNumbersHandler.mysql.scnTable=databus_scn_store
databus.relay.dataSources.sequenceNumbersHandler.mysql.dbUser=root
databus.relay.dataSources.sequenceNumbersHandler.mysql.dbPassword=password
databus.relay.dataSources.sequenceNumbersHandler.mysql.driverClass=com.mysql.jdbc.Driver
databus.relay.dataSources.sequenceNumbersHandler.mysql.flushItvl=5

databus.relay.dataSources.sequenceNumbersHandler.mysql.upsertSCNQuery=insert into databus_scn_store (max_scn) values (?)
databus.relay.dataSources.sequenceNumbersHandler.mysql.getSCNQuery=select max_scn from databus_scn_store order by updated_at desc limit 1
databus.relay.dataSources.sequenceNumbersHandler.mysql.scnColumnName=max_scn

Copy link
Contributor

@chavdar chavdar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, changes look good. Just one small comment.

@@ -16,6 +16,7 @@ dependencies {
compile externalDependency.json
compile externalDependency.log4j
compile externalDependency.netty
compile 'com.mchange:c3p0:0.9.5'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the dependency definition to subprojects.gradle in the "ext.externalDependency" array:

'c3p0': 'com.mchange:c3p0:0.9.5'

In this build.gradle, you add

compile externalDependency.c3p0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@chavdar chavdar merged commit d58835e into linkedin:master Feb 6, 2017
@chavdar
Copy link
Contributor

chavdar commented Feb 6, 2017

Thank you @rahuljoshi123 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants