<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Confluent Archives - AzureOps</title>
	<atom:link href="https://azureops.org/articles/category/confluent/feed/" rel="self" type="application/rss+xml" />
	<link>https://azureops.org/articles/category/confluent/</link>
	<description>Notable things about Cloud, Data and DevOps.</description>
	<lastBuildDate>Wed, 04 Jun 2025 10:46:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/azureops.org/wp-content/uploads/2021/04/cropped-android-chrome-512x512-1.png?fit=32%2C32&#038;ssl=1</url>
	<title>Confluent Archives - AzureOps</title>
	<link>https://azureops.org/articles/category/confluent/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">190208641</site>	<item>
		<title>Current date in KSQL</title>
		<link>https://azureops.org/articles/current-date-in-ksql/</link>
		
		<dc:creator><![CDATA[Kunal Rathi]]></dc:creator>
		<pubDate>Sun, 09 Apr 2023 18:13:41 +0000</pubDate>
				<category><![CDATA[Confluent]]></category>
		<category><![CDATA[ksqlDB]]></category>
		<category><![CDATA[current date in ksql]]></category>
		<category><![CDATA[get current time in ksqldb]]></category>
		<guid isPermaLink="false">https://azureops.org/?p=5401</guid>

					<description><![CDATA[<p>Learn how to get the current date in ksql using FORMAT_TIMESTAMP(FROM_UNIXTIME(unix_timestamp)) function in Confluent ksqlDB.</p>
<p>The post <a href="https://azureops.org/articles/current-date-in-ksql/">Current date in KSQL</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="">Confluent Platform is a full-scale data streaming managed cloud service that enables us to access, store, and manage data as a continuous, real-time stream. Confluent Cloud provides&nbsp;<a href="https://docs.confluent.io/platform/current/ksqldb/index.html#ksql-home">ksqlDB</a>, a streaming SQL engine for Kafka, and it is an easy-to-use yet powerful interactive SQL interface for stream processing on Kafka.&nbsp;In this article, you will learn how to get current date in KSQL.</p>



<h2 class="wp-block-heading">Syntax</h2>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; gutter: false; title: ; notranslate">
select UNIX_TIMESTAMP() as current_date from your_stream emit changes;
</pre></div>


<figure class="wp-block-image size-large"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="1200" height="245" data-attachment-id="5412" data-permalink="https://azureops.org/articles/current-date-in-ksql/current-date-in-ksql/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?fit=1920%2C392&amp;ssl=1" data-orig-size="1920,392" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="current-date-in-ksql" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?fit=1200%2C245&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?resize=1200%2C245&#038;ssl=1" alt="get current date in ksql Confluent." class="wp-image-5412" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?resize=1200%2C245&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?resize=450%2C92&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?resize=600%2C123&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?resize=300%2C61&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?resize=768%2C157&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?resize=1536%2C314&amp;ssl=1 1536w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="">&nbsp;The function UNIX_TIMESTAMP returns the&nbsp;BIGINT&nbsp;value representing the number of milliseconds since&nbsp;1970-01-01T00:00:00 UTC.</p>



<h3 class="wp-block-heading">Convert TIMESTAMP from BIGINT to DateTime in KSQL.</h3>



<p class="">If you want to convert the millisecond value to a&nbsp;<code>TIMESTAMP</code>,&nbsp;use the&nbsp;<code>FROM_UNIXTIME</code>.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; gutter: false; title: ; notranslate">
select FROM_UNIXTIME(UNIX_TIMESTAMP()) as current_date from your_stream emit changes;
</pre></div>


<figure class="wp-block-image size-large"><img data-recalc-dims="1" decoding="async" width="1200" height="250" data-attachment-id="5413" data-permalink="https://azureops.org/articles/current-date-in-ksql/current-date-in-ksql-conlfuent-with-in-datetime/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?fit=1920%2C400&amp;ssl=1" data-orig-size="1920,400" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="current-date-in-ksql-conlfuent-with-in-datetime" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?fit=1200%2C250&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?resize=1200%2C250&#038;ssl=1" alt="get current date in ksql using FROM_UNIXTIME(UNIX_TIMESTAMP()) " class="wp-image-5413" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?resize=1200%2C250&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?resize=450%2C94&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?resize=600%2C125&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?resize=300%2C63&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?resize=768%2C160&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?resize=1536%2C320&amp;ssl=1 1536w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/04/current-date-in-ksql-conlfuent-with-in-datetime.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="">FORMAT_TIMESTAMP() can also be used further to format timestamps in the required format. Read more about DateTimeFormater <a href="https://cnfl.io/java-dtf" target="_blank" rel="noreferrer noopener">here</a>.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; gutter: false; title: ; notranslate">
select FROM FORMAT_TIMESTAMP(FROM_UNIXTIME(unix_timestamp)) as current_date from your_stream emit changes;
</pre></div>


<p class="has-background" style="background-color:#bcefda"><strong>Pro tips:</strong><br>1. unix_timestamp() function to get current date in ksql, when used in a persistent query, is evaluated only once when creating a persistent query. <br>2. If you&#8217;d like to automate the deployment of ksqlDB streams and tables, you can read more about it <a href="http://automate Confluent ksqldb deployments with ksql-migrations - AzureOps" target="_blank" rel="noreferrer noopener">here</a>.</p>



<h2 class="wp-block-heading">See more</h2>



<iframe width="700" height="394" src="https://www.youtube.com/embed/t2h6xNVFQkc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="is-style-fill wp-block-button"><a class="wp-block-button__link has-white-color has-blush-light-purple-gradient-background has-text-color has-background has-link-color wp-element-button" href="https://azureops.org/product/ssis-catalog-migration-wizard-pro/" target="_blank" rel="noreferrer noopener">Download Now</a></div>
</div>
<p>The post <a href="https://azureops.org/articles/current-date-in-ksql/">Current date in KSQL</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5401</post-id>	</item>
		<item>
		<title>Kafka Streaming vs Spark Streaming</title>
		<link>https://azureops.org/articles/kafka-streaming-vs-spark-streaming/</link>
		
		<dc:creator><![CDATA[Kunal Rathi]]></dc:creator>
		<pubDate>Wed, 15 Feb 2023 18:39:39 +0000</pubDate>
				<category><![CDATA[Confluent]]></category>
		<category><![CDATA[Databricks]]></category>
		<category><![CDATA[Apache Kafka]]></category>
		<category><![CDATA[Apache Spark]]></category>
		<category><![CDATA[kafka vs spark]]></category>
		<guid isPermaLink="false">https://azureops.org/?p=4988</guid>

					<description><![CDATA[<p>Kafka Streams and Spark Streams are potent tools for real-time processing, Here are the key differences Kafka Streaming vs Spark Streaming.</p>
<p>The post <a href="https://azureops.org/articles/kafka-streaming-vs-spark-streaming/">Kafka Streaming vs Spark Streaming</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Kafka Streaming and Spark streaming are distributed computing frameworks that allow the processing of real-time data streams. In this article, you will see some differences between Kafka Streaming vs. Spark Streaming. </p>



<h2 class="wp-block-heading" id="h-what-is-data-streaming">What is Data Streaming?</h2>



<p>Data Streaming is a method in which input is produced continuously to perform transformations. The output is also retrieved as a constant data stream, also called setting data in motion.</p>



<h2 class="wp-block-heading">What is Kafka Stream?</h2>



<p>Kafka Streams is a library for building streaming applications that transform input Kafka topics into output Kafka topics.  Kafka Streams (Kstreams) internally uses producer and consumer libraries. It is coupled with Kafka, and the API allows you to leverage the abilities of Kafka by achieving Data Parallelism, Fault-tolerance, low latency, and much more.</p>



<h2 class="wp-block-heading">What is Spark Stream?</h2>



<p>Spark stream is an extension of the core Spark API that provides scalable, high-throughput, fault-tolerant stream processing of live data streams.  It allows real-time data processing from various sources like Kafka topics, Flume, Amazon Kinesis, etc. The processed data can be sink to file systems, databases, live dashboards, etc. </p>



<p>This article describes the difference between streaming part of Spark vs Kafka.</p>



<h2 class="wp-block-heading">Key difference between Kafka streaming and Spark streaming</h2>



<figure class="wp-block-table is-style-stripes"><table class="has-fixed-layout"><thead><tr><th></th><th>Kafka Streaming</th><th>Spark Streaming</th></tr></thead><tbody><tr><td>Technology stack</td><td>Kafka Streams is a Java library built on Apache Kafka, a distributed messaging system for real-time data streams.</td><td>Spark Streaming is a part of the Apache Spark ecosystem, a general-purpose big data processing engine.</td></tr><tr><td>Initial release</td><td>2016</td><td>2013</td></tr><tr><td>Processing model</td><td>Kafka Streams is a stream processing library that processes data records/events one at a time as they arrive in a stream.&nbsp;The processing logic assumes an independent record and some contextual/state information about the record. That limits the type of algorithms/computations you can implement in real-time. </td><td>Spark Streaming uses a micro-batch processing model, which simultaneously processes small batches of data records collected over time. The processing logic assumes you have all the related records available in the batch, allowing you to implement a wide range of algorithms/computations. </td></tr><tr><td>Fault tolerance</td><td>Kafka Streams leverages the built-in fault tolerance features of Kafka</td><td>Spark Streaming uses RDD (Resilient Distributed Datasets) to achieve fault tolerance.</td></tr><tr><td>Ease of use</td><td>Kafka Streams is known for its ease of use, as it has a simple and lightweight API designed to be developer-friendly.</td><td>Spark Streaming can be more complex to set up and configure, but it offers more features and tools for data processing and analysis.</td></tr><tr><td>Data sources and destinations</td><td>Can handle data from Kafka topics</td><td>Can handle data from Kafka topics and other sources like HDFS, AWS S3, data lakes, etc.</td></tr><tr><td>Integration</td><td>Kafka Streams is designed to work specifically with Kafka and requires a Kafka cluster to be set up.</td><td>It can run on various platforms, including Hadoop, Kubernetes, and Apache Mesos.</td></tr><tr><td>Managed cloud providers</td><td><a href="https://www.confluent.io/" target="_blank" rel="noreferrer noopener">Confluent</a>, AWS MSK, Azure Event Hub, GCP Pub/Sub, etc.</td><td><a href="https://www.databricks.com/" target="_blank" rel="noreferrer noopener">DataBricks</a>, AWS EMR, Azure HDInsight, GCP Dataproc, etc.</td></tr><tr><td>No-Code Low-Code API</td><td>kSQL</td><td>Spark SQL</td></tr><tr><td>When to go for</td><td>If your streaming application requires low latency processing of data from Kafka topics and you don&#8217;t need to process data from other sources, </td><td>If you need to process data from multiple sources or require a larger ecosystem and latency is not critical for your application. </td></tr><tr><td><br>Real-world examples</td><td><strong>Airbnb</strong>: Airbnb uses Kafka Streams to process and analyze real-time data from their website, mobile applications, and other platforms to provide personalized recommendations to their users, optimize their operations, and detect fraudulent activities.<br><strong>Goldman Sachs</strong>: Goldman Sachs uses Kafka Streams to process and analyze real-time financial data from different sources to monitor their trading activities, detect anomalies, and optimize their trading strategies.</td><td><strong>Uber</strong>: Uber uses Spark Streaming to process real-time data from their ride-hailing platform to monitor and improve the quality of their service, detect fraudulent activities, and optimize their operations.<br><strong>Netflix</strong>: Netflix uses Spark Streaming to analyze real-time customer data, monitor their streaming service, and perform real-time personalization to recommend personalized content to users.</td></tr></tbody></table><figcaption class="wp-element-caption">Kafka Streaming vs Spark Streaming</figcaption></figure>



<h2 class="wp-block-heading">Summary</h2>



<p>Kafka Streams and Spark Streaming are potent tools for real-time data processing, but they have different strengths and weaknesses depending on the specific use case and requirements. All the above differences are based on my experiences and research and may not be accurate.</p>



<h2 class="wp-block-heading">See more</h2>



<iframe width="700" height="394" src="https://www.youtube.com/embed/t2h6xNVFQkc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="is-style-fill wp-block-button"><a class="wp-block-button__link has-white-color has-blush-light-purple-gradient-background has-text-color has-background has-link-color wp-element-button" href="https://azureops.org/product/ssis-catalog-migration-wizard-pro/" target="_blank" rel="noreferrer noopener">Download Now</a></div>
</div>
<p>The post <a href="https://azureops.org/articles/kafka-streaming-vs-spark-streaming/">Kafka Streaming vs Spark Streaming</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4988</post-id>	</item>
		<item>
		<title>Print Kafka Topic Messages using KSQL</title>
		<link>https://azureops.org/articles/print-kafka-topic-messages-using-ksql/</link>
		
		<dc:creator><![CDATA[Kunal Rathi]]></dc:creator>
		<pubDate>Sat, 05 Nov 2022 08:44:38 +0000</pubDate>
				<category><![CDATA[Confluent]]></category>
		<category><![CDATA[ksqlDB]]></category>
		<guid isPermaLink="false">https://azureops.org/?p=3579</guid>

					<description><![CDATA[<p>Confluent Platform is a full-scale data streaming managed cloud service that enables us to access, store, and manage data as a continuous, real-time stream. This quick article describes how to Print Kafka topic messages in Confluent.</p>
<p>The post <a href="https://azureops.org/articles/print-kafka-topic-messages-using-ksql/">Print Kafka Topic Messages using KSQL</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Confluent Platform is a full-scale Kafka data streaming managed cloud service that enables us to access, store and manage data as a continuous, real-time stream. This quick article describes how to Print Kafka topic messages using KSQL.</p>



<h2 class="wp-block-heading">What is Confluent Cloud?</h2>



<p><a href="https://www.confluent.io/" target="_blank" rel="noreferrer noopener">Confluent</a> is a full-scale data streaming managed cloud service that enables us to access, store, and manage data as a continuous, real-time stream. Confluent Cloud provides&nbsp;<a href="https://docs.confluent.io/platform/current/ksqldb/index.html#ksql-home">ksqlDB</a>, a streaming SQL engine for Kafka. It is an easy-to-use yet powerful interactive SQL interface for stream processing on Kafka,&nbsp; In this article, we will see how to filter a Kafka stream by date using KSQL.</p>



<h2 class="wp-block-heading">Print Kafka topic messages</h2>



<p>Print all new messages from a topic.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
PRINT &#039;name.of.the.topic&#039;
</pre></div>


<p>Print a topic from the beginning </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
PRINT &#039;name.of.the.topic&#039; from beginning;
</pre></div>


<p>Print the first 5 messages from a topic</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
PRINT &#039;name.of.the.topic&#039; from beginning limit 5;
</pre></div>


<p>print every 100th message from the beginning, and stop after 5 messages.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
PRINT  &#039;name.of.the.topic&#039; from beginning INTERVAL 100 limit 5;
</pre></div>


<p>Read more about it at ksql <a href="https://docs.ksqldb.io/en/latest/developer-guide/ksqldb-reference/print/">documentation</a>.</p>



<figure class="is-style-default wp-block-image size-large is-resized"><a href="https://marketplace.visualstudio.com/items?itemName=AzureOps.ssiscatalogerpro&amp;ssr=false#overview" target="_blank" rel="noopener"><img data-recalc-dims="1" decoding="async" width="1200" height="148" data-attachment-id="4839" data-permalink="https://azureops.org/articles/azure-data-studio-for-sql-developers/scmw-horizontal-ad/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?fit=1326%2C163&amp;ssl=1" data-orig-size="1326,163" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="SCMW-horizontal-ad" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?fit=1200%2C148&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=1200%2C148&#038;ssl=1" alt="" class="wp-image-4839" style="object-fit:cover;width:811px;height:99px" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=1200%2C148&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=450%2C55&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=600%2C74&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=300%2C37&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=768%2C94&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?w=1326&amp;ssl=1 1326w" sizes="(max-width: 1200px) 100vw, 1200px" /></a></figure>



<p class="has-background" style="background-color:#bcefca"><strong>Pro tips:</strong><br>1. If you want to automate Confluent ksql deployments, you can refer to this <a href="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/">p</a><a href="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/" target="_blank" rel="noreferrer noopener">o</a><a href="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/">st</a>.<br>2. <a href="https://azureops.org/articles/filter-a-kafka-stream-by-date/" target="_blank" rel="noreferrer noopener">This</a> post describes how to filter kafka stream by date.</p>
<p>The post <a href="https://azureops.org/articles/print-kafka-topic-messages-using-ksql/">Print Kafka Topic Messages using KSQL</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3579</post-id>	</item>
		<item>
		<title>Filter a Kafka stream by date using KSQL</title>
		<link>https://azureops.org/articles/filter-a-kafka-stream-by-date/</link>
		
		<dc:creator><![CDATA[Kunal Rathi]]></dc:creator>
		<pubDate>Wed, 05 Oct 2022 13:42:16 +0000</pubDate>
				<category><![CDATA[Confluent]]></category>
		<category><![CDATA[ksqlDB]]></category>
		<category><![CDATA[Filter kafka stream]]></category>
		<category><![CDATA[ksql queries]]></category>
		<guid isPermaLink="false">https://azureops.org/?p=3631</guid>

					<description><![CDATA[<p>Confluent Platform is a full-scale data streaming managed cloud service that enables us to access, store, and manage data as a continuous, real-time stream. Confluent Cloud provides ksqlDB, a streaming SQL engine for Kafka. It is an easy-to-use yet powerful interactive SQL interface for stream processing on Kafka,  In this article, we will see how to filter a Kafka stream based on the date using ksql,</p>
<p>The post <a href="https://azureops.org/articles/filter-a-kafka-stream-by-date/">Filter a Kafka stream by date using KSQL</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Confluent Platform is a full-scale data streaming managed cloud service that enables us to access, store, and manage data as a continuous, real-time stream. Confluent Cloud provides&nbsp;<a href="https://docs.confluent.io/platform/current/ksqldb/index.html#ksql-home">ksqlDB</a>, a streaming SQL engine for Kafka. It is an easy-to-use yet powerful interactive SQL interface for stream processing on Kafka,&nbsp; In this article, we will see how to filter a Kafka stream by date using KSQL.</p>



<p>When we create a KSQL stream or table, we implicitly get the following pseudo columns in each stream or table. These columns are present by default in each stream/table, and we do not need to specify them in stream/table definitions. </p>



<figure class="wp-block-table is-style-stripes"><table class="has-fixed-layout"><thead><tr><th>Pseudo column name</th><th>Description</th></tr></thead><tbody><tr><td>ROWOFFSET</td><td>The offset of the source record.</td></tr><tr><td>ROWPARTITION</td><td>The partition of the source record.</td></tr><tr><td>ROWTIME</td><td>Row timestamp of the source record.</td></tr></tbody></table></figure>



<h3 class="wp-block-heading">Query ROWTIME of a particular KSQL stream or table record</h3>



<p>The following query will show the ROWTIME of particular row(s) filtered by COLUMN_NAME.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
SELECT TIMESTAMPTOSTRING(ROWTIME, &#039;yyyy-MM-dd HH:mm:ss.SSS&#039;) FROM SOME_STREAM
WHERE COLUMN_NAME = &#039;some_value&#039; 
EMIT CHANGES;
</pre></div>


<h3 class="wp-block-heading">Query to filter KSQL stream or table based on a date</h3>



<p>The following query will filter the KSQL stream or table based on the specified date.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
SELECT * FROM  SOME_STREAM 
WHERE TIMESTAMPTOSTRING(ROWTIME, &#039;yyyy-MM-dd&#039;) = &#039;yyyy-MM-dd&#039;  --some date in the format &lt;yyyy-MM-dd&gt;
EMIT CHANGES;
</pre></div>


<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="650" data-attachment-id="3837" data-permalink="https://azureops.org/articles/filter-a-kafka-stream-by-date/filter-a-kafka-stream-based-on-the-date-using-ksql-1/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?fit=1383%2C749&amp;ssl=1" data-orig-size="1383,749" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Filter-a-Kafka-stream-based-on-the-date-using-ksql-1" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?fit=1200%2C650&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?resize=1200%2C650&#038;ssl=1" alt="Filter a Kafka stream by date using KSQL" class="wp-image-3837" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?resize=1200%2C650&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?resize=450%2C244&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?resize=600%2C325&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?resize=300%2C162&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?resize=1145%2C620&amp;ssl=1 1145w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?resize=768%2C416&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/10/Filter-a-Kafka-stream-based-on-the-date-using-ksql-1.png?w=1383&amp;ssl=1 1383w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p>You can format the ROWTIME as you want to apply the filter.  Use auto.offset/reset = &#8216;Earliest&#8217; to get data from the past.</p>



<figure class="is-style-default wp-block-image size-large is-resized"><a href="https://marketplace.visualstudio.com/items?itemName=AzureOps.ssiscatalogerpro&amp;ssr=false#overview" target="_blank" rel="noopener"><img data-recalc-dims="1" decoding="async" width="1200" height="148" data-attachment-id="4839" data-permalink="https://azureops.org/articles/azure-data-studio-for-sql-developers/scmw-horizontal-ad/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?fit=1326%2C163&amp;ssl=1" data-orig-size="1326,163" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="SCMW-horizontal-ad" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?fit=1200%2C148&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=1200%2C148&#038;ssl=1" alt="" class="wp-image-4839" style="object-fit:cover;width:811px;height:99px" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=1200%2C148&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=450%2C55&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=600%2C74&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=300%2C37&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=768%2C94&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?w=1326&amp;ssl=1 1326w" sizes="(max-width: 1200px) 100vw, 1200px" /></a></figure>



<p class="has-background" style="background-color:#bcefca"><strong>Pro tips:</strong><br>1. If you want to automate Confluent ksql deployments, you can refer to this <a href="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/">p</a><a href="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/" target="_blank" rel="noreferrer noopener">o</a><a href="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/">st</a>.</p>
<p>The post <a href="https://azureops.org/articles/filter-a-kafka-stream-by-date/">Filter a Kafka stream by date using KSQL</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3631</post-id>	</item>
		<item>
		<title>Automate Confluent ksqlDB deployments with ksql-migrations</title>
		<link>https://azureops.org/articles/automate-onfluent-ksqldb-deployments/</link>
		
		<dc:creator><![CDATA[Kunal Rathi]]></dc:creator>
		<pubDate>Mon, 08 Aug 2022 09:46:33 +0000</pubDate>
				<category><![CDATA[Confluent]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[ksqlDB]]></category>
		<category><![CDATA[confluent ksql]]></category>
		<category><![CDATA[confluent-ksql-deployments]]></category>
		<category><![CDATA[ksql migrations]]></category>
		<category><![CDATA[ksql-migrations]]></category>
		<guid isPermaLink="false">https://azureops.org/?p=2885</guid>

					<description><![CDATA[<p>Confluent Cloud provides ksqlDB, a streaming SQL engine for Kafka. It is an easy-to-use yet powerful interactive SQL interface for stream processing on Kafka, In this article, we will see how to automate Confluent ksqlDB deployments using ksql-migrations.</p>
<p>The post <a href="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/">Automate Confluent ksqlDB deployments with ksql-migrations</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="">Confluent Platform is a full-scale data streaming managed cloud service that enables us to access, store, and manage data as a continuous, real-time stream. Confluent Cloud provides <a href="https://docs.confluent.io/platform/current/ksqldb/index.html#ksql-home">ksqlDB</a>, a streaming SQL engine for Kafka. It is an easy-to-use yet powerful interactive SQL interface for stream processing on Kafka. This article will show how to automate Confluent ksqlDB deployments using <a href="https://docs.ksqldb.io/en/latest/operate-and-deploy/migrations-tool/" target="_blank" rel="noreferrer noopener">ksql-migrations</a>.</p>



<p class="has-pale-cyan-blue-background-color has-background"><strong>Pre-requisites:</strong><br>1. <a href="https://www.confluent.io/get-started/" target="_blank" rel="noreferrer noopener">Confluent accoun</a>t with a confluent cluster and ksqlDB cluster.<br>2. Confluent platform installed locally using <a href="https://docs.confluent.io/platform/current/installation/docker/installation.html" target="_blank" rel="noreferrer noopener">docker</a>.<br>3. <a href="https://docs.confluent.io/confluent-cli/current/install.html" target="_blank" rel="noreferrer noopener">Confluent CLI</a> installed locally.<br>4. A Basic understanding of the Confluent platform and KSQL. </p>



<h2 class="wp-block-heading">Setup GitHub repository</h2>



<p class="">First thing first!</p>



<p class="">1. Fork the git repository <a href="https://github.com/jzaralim">jzaralim</a>/<strong><a href="https://github.com/jzaralim/ksqldb-migrations-action" target="_blank" rel="noreferrer noopener">ksqldb-migrations-action</a></strong>. This repository has most of the things we need to implement CICD for ksqlDB.</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="563" data-attachment-id="2897" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/fork-the-repo/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Fork-the-repo.png?fit=1426%2C669&amp;ssl=1" data-orig-size="1426,669" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Fork-the-repo" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Fork-the-repo.png?fit=1200%2C563&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Fork-the-repo.png?resize=1200%2C563&#038;ssl=1" alt="zaralim/ksqldb-migrations-action github repository." class="wp-image-2897" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Fork-the-repo.png?resize=1200%2C563&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Fork-the-repo.png?resize=450%2C211&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Fork-the-repo.png?resize=600%2C281&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Fork-the-repo.png?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Fork-the-repo.png?resize=768%2C360&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Fork-the-repo.png?w=1426&amp;ssl=1 1426w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="">2. Clone the above repository locally using any client tools like VS Code. </p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="656" data-attachment-id="2891" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/ksqldb-cicd-cloned-git-repo/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?fit=1901%2C1040&amp;ssl=1" data-orig-size="1901,1040" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="KSQLDB-CICD-Cloned-git-repo" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?fit=1200%2C656&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?resize=1200%2C656&#038;ssl=1" alt="zaralim/ksqldb-migrations-action github repository cloned using VS Code." class="wp-image-2891" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?resize=1200%2C656&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?resize=450%2C246&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?resize=600%2C328&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?resize=300%2C164&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?resize=1133%2C620&amp;ssl=1 1133w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?resize=768%2C420&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?resize=1536%2C840&amp;ssl=1 1536w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/KSQLDB-CICD-Cloned-git-repo.png?w=1901&amp;ssl=1 1901w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<h2 class="wp-block-heading">Create a Confluent ksqlDB cluster API key.</h2>



<p class="">Login to <a href="https://www.confluent.io/" target="_blank" rel="noreferrer noopener">confluent.io</a> and navigate to the confluent cluster and ksqlDB cluster. Click on CLI instructions as shown in the below image. These instructions are specific to your selected Kafka and ksqlDB clusters, so you can copy and paste them into the Confluent CLI.</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="511" data-attachment-id="2892" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/ksqldb-cli-instructions/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?fit=1686%2C718&amp;ssl=1" data-orig-size="1686,718" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ksqldb-cli-instructions" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?fit=1200%2C511&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?resize=1200%2C511&#038;ssl=1" alt="Confluent ksqlDB CLI instructions." class="wp-image-2892" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?resize=1200%2C511&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?resize=450%2C192&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?resize=600%2C256&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?resize=300%2C128&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?resize=768%2C327&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?resize=1536%2C654&amp;ssl=1 1536w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-cli-instructions.png?w=1686&amp;ssl=1 1686w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="">Follow the below steps to get the API key, API secret, and endpoint URL for the ksqlDB cluster.</p>



<p class="">1. Log in to the Confluent CLI, </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
confluent login
</pre></div>


<p class="">2. Set the context to your environment and cluster.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
confluent environment use env-v7ymd0
confluent kafka cluster use lkc-0xyop2
</pre></div>


<p class="">3. Create an API key and secret for your ksqlDB cluster.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
confluent api-key create --resource lksqld-pgx9ro
</pre></div>


<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="966" height="502" data-attachment-id="2895" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/ksqldb-create-api-keys-using-confluent-cli/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-create-api-keys-using-confluent-cli.gif?fit=966%2C502&amp;ssl=1" data-orig-size="966,502" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ksqldb-create-api-keys-using-confluent-cli" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-create-api-keys-using-confluent-cli.gif?fit=966%2C502&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-create-api-keys-using-confluent-cli.gif?resize=966%2C502&#038;ssl=1" alt="" class="wp-image-2895" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-create-api-keys-using-confluent-cli.gif?w=966&amp;ssl=1 966w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-create-api-keys-using-confluent-cli.gif?resize=450%2C234&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-create-api-keys-using-confluent-cli.gif?resize=600%2C312&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-create-api-keys-using-confluent-cli.gif?resize=300%2C156&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-create-api-keys-using-confluent-cli.gif?resize=768%2C399&amp;ssl=1 768w" sizes="(max-width: 966px) 100vw, 966px" /></figure>



<p class="">4. Get the ksqlDB cluster endpoint URL.</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="465" data-attachment-id="2899" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/ksqldb-server-endpoint-url-in-confluent-cloud/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?fit=1583%2C614&amp;ssl=1" data-orig-size="1583,614" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ksqldb-server-endpoint-url-in-confluent-cloud" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?fit=1200%2C465&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?resize=1200%2C465&#038;ssl=1" alt="Confluent ksqlDB cluster Endpoint url." class="wp-image-2899" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?resize=1200%2C465&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?resize=450%2C175&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?resize=600%2C233&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?resize=300%2C116&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?resize=768%2C298&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?resize=1536%2C596&amp;ssl=1 1536w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksqldb-server-endpoint-url-in-confluent-cloud.png?w=1583&amp;ssl=1 1583w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="">Save this information somewhere, as we will use them in the below steps. </p>



<figure class="is-style-default wp-block-image size-large is-resized"><a href="https://marketplace.visualstudio.com/items?itemName=AzureOps.ssiscatalogerpro&amp;ssr=false#overview" target="_blank" rel="noopener"><img data-recalc-dims="1" decoding="async" width="1200" height="148" data-attachment-id="4839" data-permalink="https://azureops.org/articles/azure-data-studio-for-sql-developers/scmw-horizontal-ad/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?fit=1326%2C163&amp;ssl=1" data-orig-size="1326,163" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="SCMW-horizontal-ad" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?fit=1200%2C148&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=1200%2C148&#038;ssl=1" alt="" class="wp-image-4839" style="object-fit:cover;width:811px;height:99px" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=1200%2C148&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=450%2C55&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=600%2C74&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=300%2C37&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=768%2C94&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?w=1326&amp;ssl=1 1326w" sizes="(max-width: 1200px) 100vw, 1200px" /></a></figure>



<h2 class="wp-block-heading">Initialize ksql-migrations metadata</h2>



<p class="">The confluent ksqldb-migrations tool uses <strong>MIGRATION_EVENTS</strong> &amp; <strong>MIGRATION_SCHEMA_VERSIONS</strong> topics to maintain the deployment log for the deployments made through ksql-migrations. To create these topics in the confluent cluster, follow the below steps. </p>



<p class="">1. Connect to the local ksqlDB-server docker container using bash. If you are using windows bash, you can execute the below command.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
docker-compose exec ksqldb-server bash
</pre></div>


<p class="">The ksql-migrations tool is available with all ksqlDB versions starting from ksqlDB 0.17 or Confluent Platform 6.2.</p>



<p class="">2. Execute the below command on the local ksqlDB-server container. </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
ksql-migrations new-project orders https://pksqld-zjyqd.westeurope.azure.confluent.cloud:443
</pre></div>


<p class="">Here, <em>order</em>s is the project&#8217;s name, and <em>https://pksqlc-zjyqd.westeurope.azure.confluent.cloud:443</em> is the ksqldb cluster endpoint.</p>



<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="967" height="500" data-attachment-id="2902" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/initialise-migration-metadata-in-ksqldbserver-local-container/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Initialise-migration-metadata-in-ksqldbserver-local-container.gif?fit=967%2C500&amp;ssl=1" data-orig-size="967,500" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Initialise-migration-metadata-in-ksqldbserver-local-container" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Initialise-migration-metadata-in-ksqldbserver-local-container.gif?fit=967%2C500&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Initialise-migration-metadata-in-ksqldbserver-local-container.gif?resize=967%2C500&#038;ssl=1" alt="" class="wp-image-2902" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Initialise-migration-metadata-in-ksqldbserver-local-container.gif?w=967&amp;ssl=1 967w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Initialise-migration-metadata-in-ksqldbserver-local-container.gif?resize=450%2C233&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Initialise-migration-metadata-in-ksqldbserver-local-container.gif?resize=600%2C310&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Initialise-migration-metadata-in-ksqldbserver-local-container.gif?resize=300%2C155&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Initialise-migration-metadata-in-ksqldbserver-local-container.gif?resize=768%2C397&amp;ssl=1 768w" sizes="(max-width: 967px) 100vw, 967px" /></figure>



<p class="">The above command will create <em>order\migrations\ksql-migrations.properties</em> file under the home directory in the ksqldb-server container as shown in the below image.</p>



<p class="">3. Edit the <code>ksql-migrations.properties</code> file with the following details. Values assigned to the variables are based on the name of the variables in the GitHub workflow file.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: yaml; title: ; notranslate">
ksql.server.url=${CONFLUENT_KSQLDB_ENDPOINT}
ksql.migrations.topic.replicas=3
ssl.alpn=true
ksql.auth.basic.username=${CONFLUENT_KSQLDB_API_KEY} 
ksql.auth.basic.password=${CONFLUENT_KSQLDB_API_SECRET}
ksql.migrations.dir.override=${CONFLUENT_MIGRATION_DIR}
</pre></div>


<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="509" data-attachment-id="2903" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/ksql-migration-properties-on-ksqldb-server/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?fit=1689%2C716&amp;ssl=1" data-orig-size="1689,716" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ksql-migration.properties-on-ksqldb-server" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?fit=1200%2C509&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?resize=1200%2C509&#038;ssl=1" alt="Edit ksql-migrations.properties file with settings related to confluent ksqlDB cluster." class="wp-image-2903" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?resize=1200%2C509&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?resize=450%2C191&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?resize=600%2C254&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?resize=300%2C127&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?resize=768%2C326&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?resize=1536%2C651&amp;ssl=1 1536w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration.properties-on-ksqldb-server.png?w=1689&amp;ssl=1 1689w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="">4. Now, run the below command to initiate migration metadata in the confluent cloud based on the configurations set in the above steps.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
ksql-migrations initialize-metadata -c orders/ksql-migrations.properties
</pre></div>


<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="972" height="509" data-attachment-id="2906" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/migration-medata-created-in-confluent-cloud/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Migration-medata-created-in-confluent-cloud.png?fit=972%2C509&amp;ssl=1" data-orig-size="972,509" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Migration-medata-created-in-confluent-cloud" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Migration-medata-created-in-confluent-cloud.png?fit=972%2C509&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Migration-medata-created-in-confluent-cloud.png?resize=972%2C509&#038;ssl=1" alt="" class="wp-image-2906" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Migration-medata-created-in-confluent-cloud.png?w=972&amp;ssl=1 972w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Migration-medata-created-in-confluent-cloud.png?resize=450%2C236&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Migration-medata-created-in-confluent-cloud.png?resize=600%2C314&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Migration-medata-created-in-confluent-cloud.png?resize=300%2C157&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Migration-medata-created-in-confluent-cloud.png?resize=768%2C402&amp;ssl=1 768w" sizes="(max-width: 972px) 100vw, 972px" /></figure>



<p class="">You should be able to see the below topic in the Confluent cloud.</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="359" data-attachment-id="2907" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/4-initiate-ksql-migration-confirmation/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?fit=1812%2C542&amp;ssl=1" data-orig-size="1812,542" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="4.Initiate-ksql-migration-confirmation" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?fit=1200%2C359&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?resize=1200%2C359&#038;ssl=1" alt="" class="wp-image-2907" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?resize=1200%2C359&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?resize=450%2C135&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?resize=600%2C179&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?resize=300%2C90&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?resize=768%2C230&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?resize=1536%2C459&amp;ssl=1 1536w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/4.Initiate-ksql-migration-confirmation.png?w=1812&amp;ssl=1 1812w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="has-background" style="background-color:#d2d0f0"><strong>Note: </strong>GitHub collaboration branch name and the workflow trigger branch name should be the same. </p>



<h2 class="wp-block-heading">Set up GitHub secrets for GitHub actions.</h2>



<p class=""><a href="https://docs.github.com/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets">Create GitHub secrets</a>&nbsp;for the ksqlDB cluster endpoint, API key, and API secret, respectively named:</p>



<ul class="wp-block-list">
<li class=""><code>CONFLUENT_KSQLDB_ENDPOINT</code></li>



<li class=""><code>CONFLUENT_KSQLDB_API_KEY</code></li>



<li class=""><code>CONFLUENT_KSQLDB_API_SECRET</code></li>
</ul>



<p class="">You have retrieved these secrets in the above steps.</p>



<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1112" height="421" data-attachment-id="2909" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/create-github-secrets-for-confluent-ksqldb-migrations/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Create-github-secrets-for-confluent-ksqldb-migrations.gif?fit=1112%2C421&amp;ssl=1" data-orig-size="1112,421" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Create-github-secrets-for-confluent-ksqldb-migrations" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Create-github-secrets-for-confluent-ksqldb-migrations.gif?fit=1112%2C421&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Create-github-secrets-for-confluent-ksqldb-migrations.gif?resize=1112%2C421&#038;ssl=1" alt="Set github secrets for confluent cloud." class="wp-image-2909" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Create-github-secrets-for-confluent-ksqldb-migrations.gif?w=1112&amp;ssl=1 1112w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Create-github-secrets-for-confluent-ksqldb-migrations.gif?resize=450%2C170&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Create-github-secrets-for-confluent-ksqldb-migrations.gif?resize=600%2C227&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Create-github-secrets-for-confluent-ksqldb-migrations.gif?resize=300%2C114&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/Create-github-secrets-for-confluent-ksqldb-migrations.gif?resize=768%2C291&amp;ssl=1 768w" sizes="(max-width: 1112px) 100vw, 1112px" /></figure>



<h2 class="wp-block-heading">We are all set to automate Confluent ksqlDB deployments</h2>



<p class="">It&#8217;s time to verify our setup. Start committing changes to the migrations folder in the GitHub repository.  For this demo, we will commit the three migrations files inside the <strong><a href="https://github.com/jzaralim/ksqldb-migrations-action">ksqldb-migrations-action</a></strong> Github repository.</p>



<ol class="wp-block-list">
<li class="">After the initial commit, the migrate-cloud-ksqldb workflow will be triggered. It will deploy the initial three ksql migration versions to the Confluent cloud cluster.</li>



<li class="">After migration ORDER_EVENTS stream would look like in the below image.</li>
</ol>



<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="466" data-attachment-id="2912" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/ksql-migration-first-commit-deployment/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-first-commit-deployment.gif?fit=1200%2C466&amp;ssl=1" data-orig-size="1200,466" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ksql-migration-first-commit-deployment" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-first-commit-deployment.gif?fit=1200%2C466&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-first-commit-deployment.gif?resize=1200%2C466&#038;ssl=1" alt="" class="wp-image-2912" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-first-commit-deployment.gif?w=1200&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-first-commit-deployment.gif?resize=450%2C175&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-first-commit-deployment.gif?resize=600%2C233&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-first-commit-deployment.gif?resize=300%2C117&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-first-commit-deployment.gif?resize=768%2C298&amp;ssl=1 768w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="">Let&#8217;s say, we need to add a column DESCRIPTION to the ORDER_EVENTS stream.  </p>



<ol class="wp-block-list">
<li class="">Add a new version file V000004__add_column_to_order_events.sql. </li>



<li class="">Commit the new version file, triggering a Github action, as shown in the image below.</li>
</ol>



<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="483" data-attachment-id="2914" data-permalink="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/ksql-migration-incremental-commit-deployment/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-incremental-commit-deployment.gif?fit=1200%2C483&amp;ssl=1" data-orig-size="1200,483" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ksql-migration-incremental-commit-deployment" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-incremental-commit-deployment.gif?fit=1200%2C483&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-incremental-commit-deployment.gif?resize=1200%2C483&#038;ssl=1" alt="Automate ksqlDB deployments " class="wp-image-2914" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-incremental-commit-deployment.gif?w=1200&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-incremental-commit-deployment.gif?resize=450%2C181&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-incremental-commit-deployment.gif?resize=600%2C242&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-incremental-commit-deployment.gif?resize=300%2C121&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2022/08/ksql-migration-incremental-commit-deployment.gif?resize=768%2C309&amp;ssl=1 768w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="has-background" style="background-color:#bcefca"><strong>Pro tips:</strong><br>1. The steps mentioned in this article must be done only once by a DevOps person, and individual developers need only to commit changes to the migrations folder. <br>2. Format of the migrations version file is Vxxxxxx__name_of_the_file.sql. That means &#8216;V&#8217; followed by an incremental six digits number with leading 0s. E.g., V000012__new_streams.SQL.<br>3. It is advisable to add the IF NOT EXISTS clause in CREATE STREAM/TABLE ksql statements. And IF EXISTS in DROP STREAM/TABLE ksql statements. This will avoid failures of version files in case of object availability conflict in the ksqlDB cluster. <br>4.  <a href="https://azureops.org/articles/filter-a-kafka-stream-by-date/" target="_blank" rel="noreferrer noopener">Learn</a> how to filter kstream by rowtime using ksql .</p>
<p>The post <a href="https://azureops.org/articles/automate-onfluent-ksqldb-deployments/">Automate Confluent ksqlDB deployments with ksql-migrations</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2885</post-id>	</item>
	</channel>
</rss>
