简体   繁体   中英

Create a Kafka Topic from SQL Server Stored Proc?

My .NET application is stored procedure intensive and I need to create a Kafka topic from a stored procedure. I have a key process that is running on stored procedure and at the end of that process, I need to create a Kafka topic to trigger the next process from another .NET service. Do we have any documentation for using Kafka in a stored procedure. We use confluent's Kafka.

Functions in .NET applications are not "stored procedures". Sure, you can use AdminClient class from Confluent library to create topics.


If you literally meant a database stored procedure, and your stored procedure can run arbitrary C# code (which isn't safe), you can do the same, but you could also shell out to kafka-topics.sh script..

Alternatively, create your topic elsewhere, and use tools like Debezium to read from the database into Kafka topics, keeping database logic internal to the database. (Have your stored proc write to a new table, if needed)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM