Code Monkey home page Code Monkey logo

sqlcdc2eventhub's Introduction

SQL CDC 2 Azure Event Hub

Send SQL Change Data Capture (CDC) system tracked data changes into an Azure Event Hub for downstream processing

Please see associated blog post for more information on this application

https://mrfoxsql.wordpress.com/2017/07/12/streaming-etl-send-sql-change-data-capture-cdc-to-azure-event-hub/

Instructions;

(1) Download the solution files

(2) Open the solution in Visual Studio (2015)

(3) Edit the "app.config" file...

  • ExecutionControl - 1 = run continuously, 0 = run once then exit
  • ExecutionControlSleepMs - milliseconds sleep between each iteration when program is set to run continuously
  • DataTableName - the name of the source SQL Server table in "owner.table" format
  • SQLBatchSize - the number of SQL CDC change rows to bundle into a single JSON Event Hub message
  • sqlDatabaseConnectionString - the connection string for the source SQL Server
  • Microsoft.ServiceBus.EventHubToUse - the name of the target Azure Event Hub
  • Microsoft.ServiceBus.ServiceBusConnectionString - the connection string for the target Azure Event Hub

(4) Compile the solution (release)

(5) The "SQL2AEH.exe" program will be in the "...\release\bin" folder

(6) Schedule the "SQL2AEH.exe" in a SQL Agent Job on the source SQL Server machine

NOTE 1: The application code is provided free without any support or warranty of any kind.   The code has not been thoroughly tested and is not considered production ready.   The code is provided free of charge and can be reused in any way you wish.   Please check my the disclaimer in my blog post above to learn more.

NOTE 2: This code is based on the below great blog post by Spyros Sakellariadis which gave me inspiration and starter code for my streaming ETL solution. Excellent post. See here – https://azure.microsoft.com/en-us/resources/samples/event-hubs-dotnet-import-from-sql/

sqlcdc2eventhub's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.