<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sahana T S on Medium]]></title>
        <description><![CDATA[Stories by Sahana T S on Medium]]></description>
        <link>https://medium.com/@sahanats11?source=rss-77ac86b305e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Ikk1vrbQL_pBwnZ2</url>
            <title>Stories by Sahana T S on Medium</title>
            <link>https://medium.com/@sahanats11?source=rss-77ac86b305e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 19:42:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sahanats11/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introduction to FreeMarker]]></title>
            <link>https://medium.com/@sahanats11/introduction-to-freemarker-a8ed668d685b?source=rss-77ac86b305e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8ed668d685b</guid>
            <dc:creator><![CDATA[Sahana T S]]></dc:creator>
            <pubDate>Wed, 08 Feb 2023 09:03:54 GMT</pubDate>
            <atom:updated>2023-02-08T09:03:54.415Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>What is FreeMarker?</strong></h3><p>Apache FreeMarker is a open source java template engine maintained by Apache foundation. Here Templates are written in FreeMarker Template Language (FTL). FTL is a simple and specialized language which focus on <strong>Module View Control</strong> (MVC) software design architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*_cO7m078i0oz0UGfISQq2g.png" /><figcaption>MVC</figcaption></figure><h4>MVC :</h4><p>MVC is a design pattern that which specifies that an application have three logical components Model(data + business logic related to data), View (Presentation information), Controller(Listnes events triggerd during view). Generally MVC is used for creating dynamic web pages the idea behind using MVC for creating dynamic web pages is to seperate designer from programmer.</p><p>Usually the data to be displayed and operations to be performed on data are taken care by java programmer or application after this FTL just generates textual pages that display the prepared data using templates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*jkjCRqQkgELp0gXAmGmQYg.png" /><figcaption>Pictorial Representation of Java code and FTL</figcaption></figure><p>FTL is a flexible template engine which can be used to generate many text-based formats like web pages, email, or XML files. It has no dependency on servlet, HTML, or HTTP so it can be used for non web tasks as well.</p><h3>Characters Of FTL</h3><ul><li>FTL is a powerful Template language which is easy to learn and contains Contitional blocks, iterations, assignments, string and arithmetic operations and formatting, macros and functions, including other templates etc.</li><li>FTL is light weight and can be used for both web and non web tasks including XML Processing.</li><li>It has Localized varities of Templates for formating date or time and tpo get Local sensitive numbers.</li><li>Through the pluggable adapters, java objects are exposed to the template as a tree of variable, which decides how the template sees them hence FTL is Versatile Data Model in Object wrapper.</li></ul><h3>Freemarker Template file</h3><p>A free marker template files will de saved with an extention of .ftl and the template contains following sections-</p><ul><li><strong>Text- </strong>Text which will be printed to the output as is.</li><li><strong>Interpolation- </strong>This section value is replaced with the calculated value in the output. Interpolation is determined by } {and}. As we further discuss interpolation below.</li><li><strong>FTL tags- </strong>FTL tags are a bit similar to the HTML tags, but they are instructions to the FreeMarker, and it will not be printed to the output.</li><li><strong>Comments- </strong>Comments are also similar to the HTML comments, but they are delimited by the tag &lt;# — and →. FreeMarker ignores comments, and it will not print in output.</li></ul><p>Sample FTL file to generate Email</p><pre>&lt;!doctype html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0&quot;&gt;<br>    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;ie=edge&quot;&gt;<br>    &lt;title&gt;Spring Boot Email using FreeMarker&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;div style=&quot;margin-top: 10px&quot;&gt;Greetings, ${name}&lt;/div&gt;<br>&lt;div&gt;Your username is &lt;b&gt;${email.mailto}&lt;/b&gt;&lt;/div&gt;<br>&lt;br/&gt;<br>&lt;div&gt; Have a nice day..!&lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Java logic</p><pre>String getEmailContent(EmailBody email) throws IOException, TemplateException {<br>        StringWriter stringWriter = new StringWriter();<br>        Map&lt;String, Object&gt; model = new HashMap&lt;&gt;();<br>        model.put(&quot;name&quot;, email.getMailto().split(&quot;@&quot;)[0]);<br>        model.put(&quot;email&quot;,email);<br>        model.put(&quot;senderName&quot;, &quot;Sender&quot;));<br>        configuration.getTemplate(&quot;email-template.ftlh&quot;).process(model, stringWriter);<br>        return stringWriter.getBuffer().toString();<br>    }</pre><h3>Challenges in Freemarker :</h3><ul><li>Creating new template is relatively expensive so it is important to reuse the same template object if possible for efficiency.</li><li><a href="https://freemarker.apache.org/docs/api/freemarker/template/Configuration.html#getTemplate-java.lang.String-">Configuration.getTemplate(String)</a> (and its overloads) does that (caching <a href="https://freemarker.apache.org/docs/api/freemarker/template/Template.html">Template</a>-s), but the constructor are not, so it&#39;s up to programmer to solve them.</li><li>Objects of Template class meant to be handled as immutable and thus thread-safe. However, it has some setter methods for changing FreeMarker settings.</li><li>In terms of customization there aren’t many options available for FreeMarker.</li></ul><h3>References:</h3><p><a href="https://freemarker.apache.org/docs">https://freemarker.apache.org/docs/api/freemarker/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8ed668d685b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fundamentals of Liquibase]]></title>
            <link>https://medium.com/@sahanats11/fundamentals-of-liquibase-9be58bc124a6?source=rss-77ac86b305e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9be58bc124a6</guid>
            <category><![CDATA[liquibase]]></category>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[Sahana T S]]></dc:creator>
            <pubDate>Mon, 07 Mar 2022 14:43:01 GMT</pubDate>
            <atom:updated>2022-03-07T15:03:50.005Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*iOjzknkOpd4cEa-p9oIQ4A.png" /><figcaption>Database versions</figcaption></figure><p>Liquibase is one of the database version control tools that will stand numerous coders in good stead to rapidly manage database schema changes.</p><p>The basic thought of Liquibase is to provide an automated way of generating database migration scripts to tell your DB Engine how to go from “Schema A” to “Schema B”, where “Schema A” can be any state ( including an empty database ),“Schema B” can be any other database schema and to keep a version log of each of the changes in those scripts.</p><p>The feature that is probably most attractive in Liquibase is its ability to roll changes back and forward from a specific point — saving you from the need to know what was the last change/script you ran on a specific DB instance.</p><h3><strong>Basic Concepts:</strong></h3><h4>Changeset :</h4><p>The changeset is a unit of change that Liquibase executes on a database. A changeset is uniquely tagged by an <strong>author</strong>, <strong>id</strong> attributes, and <strong>changelog file path</strong>.</p><p>Example of change set XML format:</p><pre>&lt;changeSet id=&quot;202010211812&quot; author=&quot;Author_name&quot;&gt;<br>  &lt;createTable tableName=&quot;Book&quot;&gt;<br>    &lt;column name=&quot;id&quot; type=&quot;bigint&quot;&gt;<br>      &lt;constraints primaryKey=&quot;true&quot; primaryKeyName=&quot;book_id_pk&quot; /&gt;<br>     &lt;/column&gt;<br>    &lt;column name=&quot;name&quot; type=&quot;varchar(250)&quot; /&gt;<br>    &lt;column name=&quot;price&quot; type=&quot;decimal&quot; /&gt;<br>  &lt;/createTable&gt;<br>&lt;/changeSet&gt;</pre><h4>Changelog :</h4><p>Changelog file is the source of all Liquibase changes. Changelog contains a sequentially list all data base changes (changesets). Liquibase uses this <em>changelog</em> record to audit the database and execute any changes that are not yet applied to the database. Changelog can be in XML or JSON or YAML or SQL format and even mix and match different types of changelogs is also allowed.</p><p>Please check out <a href="https://docs.liquibase.com/concepts/changelogs/working-with-changelogs.html"><strong>Examples</strong></a><strong> </strong>on change log of different formats for your reference.</p><h4>DATABASECHANGELOGLOCK table :</h4><p>This table is used by liquibase to ensure only one instance of Liquibase is running at one time.</p><h4>DATABASECHANGELOG table</h4><p>This table is used by liquibase to track which changesets have been run. The table tracks each changeset as a row, identified by a combination of the “id”, “author”, and “filename” columns.</p><p>There is no primary key on the table. This is to avoid any database-specific restrictions on key lengths. The composite of “id”, “author”, and “filename” is unique across all rows of the table.</p><h3>How to use Liquibase ?</h3><p>Liquibase can be used by embedding in application or by installing tool in machine explicitly. The below explanation is about installing the liquibase independently in machine and running from command line or terminal.</p><ul><li><a href="https://docs.liquibase.com/install/home.html"><strong>Install liquibase</strong></a> on your machine.</li><li>Use init project command to create project folder with changelog and liquibase.properties file.</li></ul><pre>liquibase init project --project-dir=&lt;path/to/some/directory&gt; --changelog-file=&lt;filename&gt; --format=&lt;sql|xml|json|yaml|yml&gt; --project-defaults-file=&lt;liquibase.properties&gt; --url=&lt;JDBC URL&gt; --username=&lt;username&gt; --password=&lt;password&gt;</pre><p>Or directly create a folder with changelog and liquibase.properties file manually with all the required details.</p><p>liquibase.properties file</p><pre>changeLogFile: ../db.changelog-version1<br>url: jdbc:postgresql://localhost:5432/liquibase_demo?<br>username: username<br>password: password<br>driver: org.postgresql.Driver<br>classpath: path/to/file/postgresql-42.2.19.jar</pre><p>Note : Traverse to the Project folder in commandline or terminal.</p><h3>Commands used in Liquibase</h3><h4>1. Update commands</h4><ul><li><strong>update</strong>: On execution of update command Liquibase look through changesets successively in a changelog file, compares unique identifiers (id + author+path to file name) to the value stored in DATABASECHANGELOG table if value not present in table then the changes in that corresponding change set will be deployed on the data base.</li></ul><pre>liquibase --changeLogFile=&lt;name of change log file&gt; update</pre><ul><li><strong>updateSQL:</strong> This will examine the raw SQL before updating it.</li></ul><pre>liquibase --changeLogFile=&lt;name of change log file&gt; updateSQL</pre><p>similarly we can use other update commands (<a href="https://docs.liquibase.com/commands/updatecount.html"><strong>updatecount</strong></a>, <a href="https://docs.liquibase.com/commands/updatecountsql.html"><strong>updateCountSQL</strong></a><strong>, </strong><a href="https://docs.liquibase.com/commands/updatetotag.html"><strong>updateToTag</strong></a><strong>, </strong><a href="https://docs.liquibase.com/commands/updatetotagsql.html"><strong>updateToTagSQL</strong></a><strong>, </strong><a href="https://docs.liquibase.com/commands/updatetestingrollback.html"><strong>updateTestingRollback</strong></a>)</p><h4>2. Rollback Commands:</h4><p>Liquibase supports roll back feature which allows to undo the changes made to data base. This process can be achieved either automatically or with a custom rollback command.</p><ul><li><strong>rollback: </strong>This command will rolls back all the changes made to the data base after a specified tag.</li></ul><pre>liquibase --changeLogFile=&lt;change log file&gt; rollback &lt;tag&gt;</pre><p>We can revert the changes of database to the date and time we need or specified number of change sets using <a href="https://docs.liquibase.com/commands/rollbacktodate.html"><strong>rollbacktodate</strong></a><strong>, </strong><a href="https://docs.liquibase.com/commands/rollbackcount.html"><strong>rollbackcount</strong></a><strong> </strong>respectively.</p><p>There are few helper commands <strong>(</strong><a href="https://docs.liquibase.com/commands/rollbacksqltag.html"><strong>rollbacksqltag</strong></a><strong>, </strong><a href="https://docs.liquibase.com/commands/rollbacktodatesql.html"><strong>rollbacktodatesql</strong></a><strong>, </strong><a href="https://docs.liquibase.com/commands/rollbackcountsql.html"><strong>rollbackcountsql</strong></a><strong>) </strong>that produces raw sql liquibase which can be run while executing the above rollback commands.</p><h3>3. Diff Commands</h3><p>Diff commands are basically used to find the differences between two different Data bases of same type or different types even the differences between previous version of database and current state of data base by using the snapshot of previous version data base.</p><ul><li><strong>diff: </strong>diff command writes differences between databases in to standard out.</li></ul><p>Add the below mentioned fields in liqibase.properties file</p><pre>changeLogFile: &lt;../path/changelogFile&gt;<br>driver: org.postgresql.Driver url:jdbc:postgresql://localhost:5432/liquibaseDB?<br>username: &lt;username&gt;<br>password: &lt;password&gt;<br>referenceDriver: org.postgresql.Driver referenceUrl://localhost:5432/referenceDB?<br>referenceUsername: &lt;username&gt;<br>referencePassword: &lt;password&gt;<br>classpath: path/to/file/postgresql-42.2.19.jar</pre><p>Here ulr, username, password are our target database url or snapshot and credentials to access the target database where referenceUrl, referenceUsername, referencePassword are source or reference database url or snapshot and credentials .</p><p>If required we can avoid the liqibase.properties file and can add all these properties in command itself. The sample command is given below.</p><pre>liquibase diff --driver=&lt;driver&gt; --url=&quot;&lt;url&gt;&quot; --username=&lt;username&gt; --password=&lt;password&gt; --referenceDriver=&lt;referenceDriver&gt; --referenceUrl=&quot;&lt;referenceUrl&gt;&quot; --referenceUsername=&lt;Username&gt; --referencePassword=&lt;password&gt;</pre><ul><li><strong>diffChangeLog: </strong>Instead of writing differences to standard out this command will append changes to the changelog file in any changelog supported format.</li></ul><p>Command sample command is given below.</p><pre>liquibase --changeLogFile=&lt;/path/dbchangelog&gt; --driver=&lt;driver&gt; --url=&quot;&lt;url&gt;&quot; --username=&lt;username&gt; --password=&lt;password&gt; --referenceDriver=&lt;referenceDriver&gt; --referenceUrl=&quot;&lt;referenceUrl&gt;&quot; --referenceUsername=&lt;Username&gt; --referencePassword=&lt;password&gt; diffChangeLog</pre><p>If required all properties can be stored in liquibase.properties file and can execute just liquibase diffChangeLog command.</p><pre>liquibase diffChangeLog</pre><h3>Pros and Cons of liquibase:</h3><h4>Pros:</h4><ul><li>Liquibase helps in tracking, managing and applying data base changes.</li><li>Liquibase tracks changes independently rather than using a single version to support multiple developers and/or code branches.</li><li>Database <a href="https://docs.liquibase.com/commands/history.html">history</a> documentation can be generated using liquibase.</li><li>Liquibase has ability to have the same change description on multiple database types (EX :- If application supports both MySQL and Postgres, we can have only one changelog that can be executed against both database types).</li><li>We can use if/then logic while applying changes.</li><li>Liquibase can run in <a href="https://www.liquibase.com/blog/3-ways-to-run-liquibase">3-ways</a> (by embed in to the application, by embed Liquibase into build tools, Run Liquibase to generate SQL for review)</li></ul><h4>Cons:</h4><ul><li>Path to the changelog file and name of changelog file which is already applied to database using liquibase should be not be changed because liquibase track the changes based on unique identifiers (id + author+path to file name) if filename or path changes then the files are considered new and executed again which may cause issue and through exceptions.</li></ul><h3>Conclusion:</h3><p>Schema versioning is really a great advantage. The automation of schema updates is surely an efficiency gain. Implementation effort and time of liquibase is relatively low and also the technology stack is minimally increased by Liquibase so it will be easy to implement and manage liquibase but it serves great benefits to easily develop, evolve and ship the application which is less fallible.</p><p>This Article illustrates the basic concepts of liquibase and basic commands can use in liquibase for full story of liquibase please refer <a href="https://docs.liquibase.com/home.html">docs</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9be58bc124a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monthly Window Based Aggregation In Kafka Stream]]></title>
            <link>https://medium.com/@sahanats11/monthly-window-based-aggregation-in-kafka-stream-6b811d7ed375?source=rss-77ac86b305e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b811d7ed375</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[kafka-streams]]></category>
            <category><![CDATA[aggregation]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[Sahana T S]]></dc:creator>
            <pubDate>Sun, 02 Jan 2022 18:25:14 GMT</pubDate>
            <atom:updated>2022-01-02T18:25:14.937Z</atom:updated>
            <content:encoded><![CDATA[<p>Introducing the month based windowed aggregation in kafka on real time streaming using session windows.</p><figure><img alt="Pictorial representation of aggregation in a monthly window" src="https://cdn-images-1.medium.com/max/941/1*eyrnRP-CNDyUiv0oi9AAgA.png" /><figcaption><strong>Monthly Window</strong></figcaption></figure><h3><strong>Session Windows:</strong></h3><p>Session windows are dynamically sized, non overlapping and data driven windows. A Session is a period of activity followed by defined time of inactivity. These windows do not have a fixed window size, the size of the window keep growing until no event received for predefined amount of time(the event received after a defined time of inactivity will fall under new session window).<br>Session windows aggregated the events by key into sessions.</p><h3>Monthly Windowed Aggregation Using Session windows:</h3><ul><li>Month wise window for aggregating(count) number of times the User logged in (from first to last day of that month).</li><li><em>userID</em> will be key.</li><li>Grouping 12 months in to 4 groups.</li><li>Create 4 ktables and assign one for each group.</li><li>The size of session window should be at least the number of days in that month(say for January it should be at least Duration.ofDays(31)) so that the session will be active until last day of the month (session will be active if we get one record on 1st of January and no record received through out month until 31st of January)</li><li>While grouping Months there should be a gap between last day of one month to first day of another month in the same group (Jan, May and August are in same group where as defined inactive period for this group is 31 since there is gap of 89 days between 31st January and 1st may and 89 &gt; 31 this session started for January will automatically end and create a new window when record received in may).</li></ul><pre>//Ktable for January, May and August months<br>KTable&lt;Windowed&lt;String&gt;, Long&gt; kTableJanMayAug =  loginDataStream.filter((k, v) -&gt; Integer.toString(calendar.get(Calendar.MONTH)).matches(&quot;0|4|7&quot;)).groupByKey()<br>            .windowedBy(SessionWindows.with(Duration.ofDays(31)))<br>            .count(Materialized.as(&quot;JanMayAug_Store&quot;));</pre><pre>//Ktable for Febraury, April, June, September and November months<br>KTable&lt;Windowed&lt;String&gt;, Long&gt; kTableFebAprJuneSeptNov =  loginDataStream.filter((k, v) -&gt; Integer.toString(calendar.get(Calendar.MONTH)).matches(&quot;1|3|5|8|10&quot;)).groupByKey()<br>            .windowedBy(SessionWindows.with(Duration.ofDays(30)))<br>            .count(Materialized.as(&quot;FebAprJuneSeptNov_Store&quot;));<br>   <br>//Ktable for March,July and October months months<br>KTable&lt;Windowed&lt;String&gt;, Long&gt; kTableMarchJulyOct =  loginDataStream.filter((k, v) -&gt; Integer.toString(calendar.get(Calendar.MONTH)).matches(&quot;2|6|9&quot;)).groupByKey()<br>            .windowedBy(SessionWindows.with(Duration.ofDays(31)))<br>            .count(Materialized.as(&quot;MarchJulyOct_Store&quot;));<br>   <br>//Ktable for December<br>KTable&lt;Windowed&lt;String&gt;, Long&gt; kTableDecember =  loginDataStream.filter((k, v) -&gt; Integer.toString(calendar.get(Calendar.MONTH)).matches(&quot;11&quot;)).groupByKey()<br>            .windowedBy(SessionWindows.with(Duration.ofDays(31)))<br>            .count(Materialized.as(&quot;December_Store&quot;));</pre><p><strong>Explanation:</strong></p><p>Assumption: Events in <em>loginDataStream </em>are received with <em>userID as key.</em></p><p>Step 1: Allowing stream to aggregate in <em>kTableJanMayAug </em>only when the event received in months January, May and August using filter.</p><pre>//Ktable for January, May and August months<br>KTable&lt;Windowed&lt;String&gt;, Long&gt; kTableJanMayAug =  loginDataStream.filter((k, v) -&gt; Integer.toString(calendar.get(Calendar.MONTH)).matches(&quot;0|4|7&quot;))</pre><p>Step2: Group By key where Key is <em>userID.</em></p><pre>//Ktable for January, May and August months<br>KTable&lt;Windowed&lt;String&gt;, Long&gt; kTableJanMayAug =  loginDataStream.filter((k, v) -&gt; Integer.toString(calendar.get(Calendar.MONTH)).matches(&quot;0|4|7&quot;)).groupByKey()</pre><p>Step3: Set window, here we used session window with duration of 31 days so for Jan if one record receives on 1st of Jan the window will be active till 31st of Jan. May will be the next month to allow aggregation at this table <em>kTableJanMayAug</em> so the session remains idle from Jan 31st to May 1st it is 89 days &gt; 31 days so a new session will start if they receive some data in May.</p><pre>//Ktable for January, May and August months<br>KTable&lt;Windowed&lt;String&gt;, Long&gt; kTableJanMayAug =  loginDataStream.filter((k, v) -&gt; Integer.toString(calendar.get(Calendar.MONTH)).matches(&quot;0|4|7&quot;)).groupByKey()<br>            .windowedBy(SessionWindows.with(Duration.ofDays(31)))</pre><p>Step4: Aggregate and storing the result in a local state store.</p><pre>//Ktable for January, May and August months<br>KTable&lt;Windowed&lt;String&gt;, Long&gt; kTableJanMayAug =  loginDataStream.filter((k, v) -&gt; Integer.toString(calendar.get(Calendar.MONTH)).matches(&quot;0|4|7&quot;)).groupByKey()<br>            .windowedBy(SessionWindows.with(Duration.ofDays(31)))<br>            .count(Materialized.as(&quot;JanMayAug_Store&quot;));</pre><p>Irrespective of non leap year or leap year the cycle repeats every year and create a new window every month.</p><h3>Conclusion:</h3><p>We have started out by grouping months, creating ktables for different groups then diverting stream to proper group for aggregation using filters and grouping it, defining session window for grouped stream, added count aggregator and at last saved in local state-store.</p><h3>References:</h3><ul><li><a href="https://kafka.apache.org/20/documentation/streams/developer-guide/dsl-api.html">https://kafka.apache.org/20/documentation/streams/developer-guide/dsl-api.html</a></li><li><a href="https://kafka.apache.org/20/documentation/streams/developer-guide/dsl-api.html#windowing">https://kafka.apache.org/20/documentation/streams/developer-guide/dsl-api.html#windowing</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b811d7ed375" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>