<?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 Mradul Pandey on Medium]]></title>
        <description><![CDATA[Stories by Mradul Pandey on Medium]]></description>
        <link>https://medium.com/@mradulpandey?source=rss-838b9037b5a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*sQgDqUb7DmK7HQGx.</url>
            <title>Stories by Mradul Pandey on Medium</title>
            <link>https://medium.com/@mradulpandey?source=rss-838b9037b5a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:06:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mradulpandey/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[How do I assess the quality of my tests?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/jinternals/how-do-i-assess-the-quality-of-my-tests-1d25c4c92338?source=rss-838b9037b5a8------2"><img src="https://cdn-images-1.medium.com/max/1400/1*vlw6i5JrPxD7U2NB06EiyA.png" width="1400"></a></p><p class="medium-feed-snippet">Coverage tells you what your tests ran. Mutation testing tells you what they would actually catch.</p><p class="medium-feed-link"><a href="https://medium.com/jinternals/how-do-i-assess-the-quality-of-my-tests-1d25c4c92338?source=rss-838b9037b5a8------2">Continue reading on Jinternals »</a></p></div>]]></description>
            <link>https://medium.com/jinternals/how-do-i-assess-the-quality-of-my-tests-1d25c4c92338?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d25c4c92338</guid>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 07:04:13 GMT</pubDate>
            <atom:updated>2026-09-18T07:04:13.402Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Reciprocal Rank Fusion, Without the Scary Math]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/jinternals/reciprocal-rank-fusion-without-the-scary-math-68421476c505?source=rss-838b9037b5a8------2"><img src="https://cdn-images-1.medium.com/max/1400/1*Zigx7lTeEtvi1cB3sscTqA.png" width="1400"></a></p><p class="medium-feed-snippet">Two search engines give you two different lists. Here&#x2019;s the simple trick modern hybrid search uses to merge them, using nothing harder&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/jinternals/reciprocal-rank-fusion-without-the-scary-math-68421476c505?source=rss-838b9037b5a8------2">Continue reading on Jinternals »</a></p></div>]]></description>
            <link>https://medium.com/jinternals/reciprocal-rank-fusion-without-the-scary-math-68421476c505?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/68421476c505</guid>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Mon, 14 Sep 2026 08:00:00 GMT</pubDate>
            <atom:updated>2026-09-29T15:44:23.581Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[PostgreSQL Indexes: Seq Scan vs Index Scan]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">One of the easiest ways to understand database indexes is to actually see what PostgreSQL does before and after creating an index.</p><p class="medium-feed-link"><a href="https://medium.com/jinternals/postgresql-indexes-seq-scan-vs-index-scan-3c7683fbdd0b?source=rss-838b9037b5a8------2">Continue reading on Jinternals »</a></p></div>]]></description>
            <link>https://medium.com/jinternals/postgresql-indexes-seq-scan-vs-index-scan-3c7683fbdd0b?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c7683fbdd0b</guid>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 10:15:11 GMT</pubDate>
            <atom:updated>2026-09-07T11:48:40.133Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[AI Agent]]></title>
            <link>https://medium.com/jinternals/ai-agent-1167e21b777b?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1167e21b777b</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[spring-ai]]></category>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Tue, 08 Jul 2025 06:38:16 GMT</pubDate>
            <atom:updated>2025-07-08T06:38:16.603Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i_9BQCeW7jre1Q3s" /><figcaption>AI Generated Image</figcaption></figure><p>An artificial intelligence (AI) agent is a software program that autonomously accomplishes a given objective. By leveraging AI capabilities on behalf of a user or system, these agents can manage intricate tasks and execute multi-step processes effectively.</p><p>In this blog, we’ll explore emerging patterns for AI agents and demonstrate how these patterns can be harnessed to solve diverse use cases.</p><h3>Core Capabilities of Effective AI Agents</h3><p>To be effective, AI agents should possess the following capabilities:</p><h4>1. Retrieval-Augmented Generation (RAG)</h4><ul><li>Provide up-to-date information.</li><li>Contextualize information across conversations.</li></ul><h4>2. Memory Access Mechanisms</h4><ul><li>Maintain context throughout tasks.</li><li>Retain and reference previous interactions.</li></ul><h4>3. Tool Integration</h4><ul><li>Extend agent capabilities by integrating external tools.</li><li>Enable agents to perform real-world tasks (e.g., create tickets, fetch data).</li></ul><h4>4. Multi-step Reasoning</h4><ul><li>Decompose complex problems into sub-problems.</li><li>Solve them sequentially or in parallel.</li></ul><h3><strong>Comparative Analysis of Large Language Models (LLMs) and AI Agents</strong></h3><h4><strong>Large Language Models (LLMs):</strong></h4><p>LLMs are advanced deep learning models trained on vast text corpora (books, articles, websites, etc.). This training enables them to understand and generate human language, detect patterns, apply grammar, and even demonstrate basic reasoning.</p><h4><strong>LLM Functionality:</strong></h4><p>LLMs operate on prompts. The quality and structure of a prompt significantly influence the output.</p><p>Prompt 1 — Asked ChatGPT for 5 movies directed by Christopher Nolan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0iffcI4NBs10n9h2ElvzJg.png" /></figure><p>Prompt 2 — Asked ChatGPT for 5 movies directed by Christopher Nolan, in a specific format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmjcopA-UYlQ3u0Mtsr-IA.png" /></figure><p>While LLMs are powerful, they are <em>reactive</em>, responding to inputs without memory, state, or actions beyond text generation.</p><h4><strong>AI Agents</strong></h4><p>AI agents combine the power of LLMs with <strong>tools</strong>, <strong>memory</strong>, <strong>RAG</strong>, and <strong>planning capabilities</strong>. They are designed to not only generate responses but also <em>take actions</em>, <em>make decisions</em>, and <em>interact with systems</em> autonomously.</p><blockquote><em>Think of them as enhanced LLMs with the ability to operate independently in real-world environments.</em></blockquote><p><strong>Support Chatbot AI Agent:</strong></p><p>I’ve developed a rudimentary support chatbot AI agent capable of responding to customer inquiries and generating tickets when contextual information is insufficient.</p><p>Given my career focus on Java technologies, I’ve chosen <strong>Spring AI</strong> for this demonstration. However, the core concepts apply universally, regardless of the programming language or framework.</p><h3>Application Modules:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a3PQR7Wgq2rIqDmD" /></figure><ul><li><a href="https://github.com/jinternals/support-agent/blob/main/support-agent-app">support-agent-app</a><br>Interacts with the LLM, MCP server, and vector store to perform intelligent support operations.</li><li><a href="https://github.com/jinternals/support-agent/blob/main/support-agent-etl">support-agent-etl</a><br>Responsible for loading data into the vector store for RAG-based retrieval.</li><li><a href="https://github.com/jinternals/support-agent/blob/main/support-mcp">support-mcp</a><br>MCP server that exposes support tools (e.g., for creating and managing tickets) to be invoked by the agent.</li></ul><p><a href="https://github.com/jinternals/support-agent">GitHub - jinternals/support-agent</a></p><h3>Limitations of AI Agents</h3><p>Despite their promise, AI agents have notable limitations:</p><h4>Security Risks</h4><ul><li>Agents are vulnerable to adversarial prompts that manipulate behavior.</li><li>Blind trust in agents can lead to misuse or acceptance of inaccurate outputs.</li></ul><h4>Integration Complexity</h4><ul><li>While the <strong>Model Context Protocol (MCP)</strong> helps standardize communication between tools and models, integration still demands manual wrapping of tools with metadata, schemas, and logic.</li><li>Building reliable workflows across tools remains a challenge due to a lack of abstractions for sequencing, state handling, and error recovery.</li></ul><h4>Latency &amp; Cost</h4><ul><li>Agents with multiple tools, planning, or memory are resource-intensive.</li><li>Performance may be slower and more costly compared to simpler LLM-based interactions.</li></ul><h3><strong>AI Agent — Patterns and Workflows</strong></h3><p>Below are emerging patterns in the industry. For more details on these patterns, please refer to <a href="https://www.anthropic.com/engineering/building-effective-agents">Anthropic’s Building effective agents</a>. Below are a few patterns from the blog.</p><ol><li><strong>The augmented LLM — </strong>LLM enhanced with external context (RAG, memory).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5fibRCGB39-QG0dU" /></figure><p><strong>2. Prompt chaining — </strong>Sequential prompts for multi-step tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*117x1Y-M2bgJ-y52" /></figure><p><strong>3. Routing — </strong>Dynamically route requests to appropriate tools or agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XrFfqMih46-h3_pb" /></figure><p><strong>4. Parallelization — </strong>Execute multiple sub-tasks simultaneously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xe8TV36bSEhQdFiK" /></figure><p><strong>5. Orchestrator-workers — </strong>A central agent delegates sub-tasks to worker agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qg86l1n7hnUHBSa8" /></figure><p><strong>6. Evaluator-optimizer — </strong>Agents evaluate and refine outputs over iterations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_B3tKrxB5B3I6UK4" /></figure><p>In our upcoming blog post, I will present a <strong>roadmap for building an AI agent framework</strong>. We’ll walk through identifying, implementing, and optimising agent systems for real-world applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1167e21b777b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jinternals/ai-agent-1167e21b777b">AI Agent</a> was originally published in <a href="https://medium.com/jinternals">Jinternals</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka SSL: Client Authentication— Part 2]]></title>
            <link>https://medium.com/jinternals/kafka-ssl-client-authentication-part-2-82c211d64eb6?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/82c211d64eb6</guid>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Sun, 10 May 2020 15:03:40 GMT</pubDate>
            <atom:updated>2021-12-02T10:08:43.336Z</atom:updated>
            <content:encoded><![CDATA[<p>In the <a href="https://medium.com/jinternals/kafka-ssl-setup-with-self-signed-certificate-part-1-c2679a57e16c">previous post</a>, we did an SSL encryption that already enables 1-way authentication in which the client authenticates the server certificate. For implementing client authentication, client need to present it’s certificate to broker for authenticatation.</p><h3>Setup Kafka broker:</h3><p>We will use the same setup as in the previous post but Kafka broker needs an additional property to enforce the client to use SSL.</p><pre>version: &#39;3.5&#39;<br><br>services:<br><br>  zookeeper:<br>    image: &quot;wurstmeister/zookeeper:latest&quot;<br>    ports:<br>      - &quot;2181:2181&quot;<br><br>  kafka:<br>    image: wurstmeister/kafka:2.12-2.2.0<br>    depends_on:<br>      - zookeeper<br>    ports:<br>      - &quot;9092:9092&quot;<br>    environment:<br>      KAFKA_ADVERTISED_LISTENERS: &#39;SSL://kafka:9092&#39;<br>      KAFKA_LISTENERS: &#39;SSL://0.0.0.0:9092&#39;<br>      KAFKA_AUTO_CREATE_TOPICS_ENABLE: &#39;true&#39;<br>      KAFKA_ZOOKEEPER_CONNECT: &#39;zookeeper:2181&#39;<br>      KAFKA_SSL_KEYSTORE_LOCATION: &#39;/certs/kafka.server.keystore.jks&#39;<br>      KAFKA_SSL_KEYSTORE_PASSWORD: &#39;serverpassword&#39;<br>      KAFKA_SSL_KEY_PASSWORD: &#39;serverpassword&#39;<br>      KAFKA_SSL_TRUSTSTORE_LOCATION: &#39;/certs/kafka.server.truststore.jks&#39;<br>      KAFKA_SSL_TRUSTSTORE_PASSWORD: &#39;serverpassword&#39;<br><strong>      KAFKA_SSL_CLIENT_AUTH: &#39;required&#39;<br></strong>      <em># KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: &#39;&#39;<br>      </em>KAFKA_SECURITY_INTER_BROKER_PROTOCOL: &#39;SSL&#39;<br>    volumes:<br>      - ./server_certs:/certs</pre><h3>Setup Kafka client:</h3><p>We need to do the same setup for our client, as we did for the broker in the previous blog. Please follow README.md for setup cluster and running the sample application. <a href="https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%202">https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%202</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_cgUlErppYgNW31P7_MHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RVINGdAULItIBJFRd-doNg.png" /></figure><h3>Source Code :</h3><p><a href="https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%202">https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%202</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82c211d64eb6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jinternals/kafka-ssl-client-authentication-part-2-82c211d64eb6">Kafka SSL: Client Authentication— Part 2</a> was originally published in <a href="https://medium.com/jinternals">Jinternals</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka SSL : Setup with self signed certificate — Part 1]]></title>
            <link>https://medium.com/jinternals/kafka-ssl-setup-with-self-signed-certificate-part-1-c2679a57e16c?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2679a57e16c</guid>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ssl]]></category>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Wed, 26 Feb 2020 04:14:57 GMT</pubDate>
            <atom:updated>2020-05-10T15:07:03.895Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kafka SSL : Setup with self signed certificate — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*D0Xk8hmBB3zuyhGl1TDu3A.png" /></figure><p>Understanding and setting up Kafka security is a complex process, I stumbled upon it numerous times and hence thought of creating step by step guide with fine-grained steps so that others don’t have to make the same mistakes. I am not Kafka or SSL expert but whatever knowledge I’ve accumulated so far, this blog post is a reflection of the same.</p><h3><strong>Terminologies and Descriptions:</strong></h3><h4>1. Certificate Authority (CA)</h4><p>A certificate authority (CA)<strong>,</strong> is a company or organization that acts to validate the identities of entities (such as websites, email addresses, companies, or individual persons) and bind them to cryptographic keys through the issuance of electronic documents known as digital certificates.</p><h4>2. Certificate signing request (CSR)</h4><p>CSR is an encoded message submitted by an applicant to a CA to get an SSL certificate. A certificate authority will use a CSR to create your SSL certificate, but it does not need your private key.</p><h4><strong>3. KeyStore</strong></h4><p>KeyStore is used to store private key and identity certificates that a specific program should present to both parties (server or client) for verification.</p><h4><strong>4. TrustStore</strong></h4><p>TrustStore is used to determine which certificates (broker or logical client identities) to trust (authenticate).</p><p>Following are two examples for TrustStore:</p><ol><li><strong>The TrustStore contains one or many certificates: </strong>The broker or logical client will trust any certificate listed in the TrustStore.</li><li><strong>The TrustStore contains a Certificate Authority:</strong> The broker or logical client will trust any certificate that was signed by the CA in the TrustStore.</li></ol><h3>Setup Kafka broker:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZkksRoMfFGYZ1QNxiSL3Q.png" /></figure><h4><strong>1. Create own private Certificate Authority (CA)</strong></h4><pre>openssl req -new -newkey rsa:4096 -days 365 -x509 -subj “/CN=Demo-Kafka” -keyout ca-key -out ca-cert -nodes</pre><h4><strong>2. Create Kafka Server Certificate and store in KeyStore:</strong></h4><pre>keytool -genkey -keystore kafka.server.keystore.jks -validity 365 -storepass &lt;password&gt; -keypass &lt;password&gt; -dname “CN=&lt;hostname&gt;” -storetype pkcs12</pre><pre># verify certificate</pre><pre>keytool -list -v -keystore kafka.server.keystore.jks</pre><h4>3. Create Certificate signed request (CSR):</h4><pre>keytool -keystore kafka.server.keystore.jks -certreq -file cert-file -storepass &lt;password&gt; -keypass &lt;password&gt;</pre><h4><strong>4. Get CSR Signed with the CA:</strong></h4><pre>openssl x509 -req -CA ca-cert -CAkey ca-key -in cert-file -out cert-file-signed -days 365 -CAcreateserial -passin pass:&lt;password&gt;</pre><pre># verify certificate</pre><pre>keytool -printcert -v -file cert-file-signed</pre><h4>5. Import CA certificate in KeyStore:</h4><pre>keytool -keystore kafka.server.keystore.jks -alias CARoot -import -file ca-cert -storepass &lt;password&gt; -keypass &lt;password&gt; -noprompt</pre><h4>6. Import Signed CSR In KeyStore:</h4><pre>keytool -keystore kafka.server.keystore.jks -import -file cert-file-signed -storepass &lt;password&gt; -keypass &lt;password&gt; -noprompt</pre><h4><strong>7. Import CA certificate In TrustStore:</strong></h4><pre>keytool -keystore kafka.server.truststore.jks -alias CARoot -import -file ca-cert -storepass &lt;password&gt; -keypass &lt;password&gt; -noprompt</pre><h4>8. Setup Kafka broker with KeyStore and TrustStore:</h4><p>Following is Kafka broker setup using <strong>wurstmeister/kafka</strong> images and docker-compose, code for the same is available in my public git repository. Please follow README.md for setup cluster and running the sample application. <a href="https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%201">https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%201</a></p><pre>version: &#39;3.5&#39;<strong><br><br></strong>services:<br><br>  zookeeper:<br>    image: &quot;wurstmeister/zookeeper:latest&quot;<br>    ports:<br>      - &quot;2181:2181&quot;<br><br>  kafka:<br>    image: wurstmeister/kafka:2.12-2.2.0<br>    depends_on:<br>      - zookeeper<br>    ports:<br>      - &quot;9092:9092&quot;<br>    environment:<br>      KAFKA_ADVERTISED_LISTENERS: &#39;SSL://kafka:9092&#39;<br>      KAFKA_LISTENERS: &#39;SSL://0.0.0.0:9092&#39;<br>      KAFKA_AUTO_CREATE_TOPICS_ENABLE: &#39;true&#39;<br>      KAFKA_ZOOKEEPER_CONNECT: &#39;zookeeper:2181&#39;<br>      KAFKA_SSL_KEYSTORE_LOCATION: &#39;/certs/kafka.server.keystore.jks&#39;<br>      KAFKA_SSL_KEYSTORE_PASSWORD: &#39;serverpassword&#39;<br>      KAFKA_SSL_KEY_PASSWORD: &#39;serverpassword&#39;<br>      KAFKA_SSL_TRUSTSTORE_LOCATION: &#39;/certs/kafka.server.truststore.jks&#39;<br>      KAFKA_SSL_TRUSTSTORE_PASSWORD: &#39;serverpassword&#39;<br>      <em># KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: &#39;&#39;<br>      </em>KAFKA_SECURITY_INTER_BROKER_PROTOCOL: &#39;SSL&#39;<br>    volumes:<br>      - ./server_certs:/certs</pre><h3>Setup Kafka client:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVQuTlLJ8BybBKoarM6Row.png" /></figure><h4>1. Import CA certificate In TrustStore:</h4><pre>keytool -keystore kafka.client.truststore.jks -alias CARoot -import -file ca-cert -storepass &lt;password&gt; -keypass &lt;password&gt; -noprompt</pre><h4>2. Setup Kafka client application with TrustStore:</h4><p>Following is spring boot application config with truststore, code for the same is available in my public git repository. Please follow README.md for setup cluster and running the sample application. <a href="https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%201">https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%201</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YQvCIXTVwf4BS9rsmL2BTw.png" /></figure><h3>Multiple Broker SSL Setup</h3><p>Following should be the topology for your multi-node cluster, every node is the cluster will have their own KeyStore and they will share same TrustStore (CA will be same for all the brokers in a cluster), similarly, clients will share the same TrustStore, Please fork and modify sample application and scripts to setup multi-node cluster (Home Work For You).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TreeUfGDwgBhMjmPGmW77A.png" /></figure><h3>Source Code :</h3><p><a href="https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%201">https://github.com/jinternals/kafka_ssl_setup/tree/master/Part%201</a></p><p>So far setup we have done is only for encrypting traffic between Kafka broker and client. In the next post, we will see how to <em>authenticate client using SSL.</em></p><p><strong>Next:</strong> <a href="https://medium.com/@mradulpandey/kafka-ssl-client-authentication-part-2-82c211d64eb6">https://medium.com/@mradulpandey/kafka-ssl-client-authentication-part-2-82c211d64eb6</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2679a57e16c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jinternals/kafka-ssl-setup-with-self-signed-certificate-part-1-c2679a57e16c">Kafka SSL : Setup with self signed certificate — Part 1</a> was originally published in <a href="https://medium.com/jinternals">Jinternals</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build docker images with and maven]]></title>
            <link>https://medium.com/jinternals/build-docker-images-with-and-maven-901ec0d9de58?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/901ec0d9de58</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[maven]]></category>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Sun, 15 Sep 2019 14:22:34 GMT</pubDate>
            <atom:updated>2021-03-04T09:16:44.711Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build docker images with maven and docker command line</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N7z1IK4_P1tNYdAX81HuWA.jpeg" /></figure><p>Containerisation of applications became an essential part of most software projects, as it helps in bundling the application with an environment that provides consistent deployment in different environments (dev/prod). Containerized applications need to be built with specific application version and commit information. In this blog we will use maven to filter Dockerfile with application version and commit information:</p><ol><li>Create docker file template with maven variables in src/main/docker folder:</li></ol><pre><strong>FROM </strong>java:8-jre<br><strong>MAINTAINER </strong>Mradul Pandey <strong>&lt;</strong>pandeymradul@gmail.com<strong>&gt;<br><br>LABEL </strong>VERSION=<strong>&quot;@project.version@&quot;<br>LABEL </strong>DESCRIPTION=<strong>&quot;@project.description@&quot;<br>LABEL </strong>GIT_COMMIT_ID=<strong>&quot;@git.commit.id@&quot;<br><br>ADD </strong>.<strong>/</strong>@project.build.finalName@.jar <strong>/</strong>app<strong>/<br>CMD </strong>[<strong>&quot;java&quot;</strong>, <strong>&quot;-Xmx200m&quot;</strong>, <strong>&quot;-jar&quot;</strong>, <strong>&quot;/app/@project.build.finalName@.jar&quot;</strong>]<br><br><strong>EXPOSE </strong>8080</pre><p>2. Update pom.xml to filter Dockerfile and git commit id plugin:</p><pre><em>&lt;?</em><strong>xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;</strong><em>?&gt;<br></em>&lt;<strong>project ... </strong>&gt;<br>   ...<br>   &lt;<strong>build</strong>&gt;<br>   &lt;<strong>resources</strong>&gt;<br>      &lt;<strong>resource</strong>&gt;<br>         &lt;<strong>directory</strong>&gt;src/main/docker&lt;/<strong>directory</strong>&gt;<br>         &lt;<strong>filtering</strong>&gt;true&lt;/<strong>filtering</strong>&gt;<br>         &lt;<strong>includes</strong>&gt;<br>            &lt;<strong>include</strong>&gt;Dockerfile&lt;/<strong>include</strong>&gt;<br>         &lt;/<strong>includes</strong>&gt;<br>         &lt;<strong>targetPath</strong>&gt;${project.build.directory}/docker-resources&lt;/<strong>targetPath</strong>&gt;<br>      &lt;/<strong>resource</strong>&gt;<br>   &lt;/<strong>resources</strong>&gt;<br><br>   &lt;<strong>plugins</strong>&gt;<br>      &lt;<strong>plugin</strong>&gt;<br>         &lt;<strong>groupId</strong>&gt;org.springframework.boot&lt;/<strong>groupId</strong>&gt;<br>         &lt;<strong>artifactId</strong>&gt;spring-boot-maven-plugin&lt;/<strong>artifactId</strong>&gt;<br>         &lt;<strong>executions</strong>&gt;<br>            &lt;<strong>execution</strong>&gt;<br>               &lt;<strong>goals</strong>&gt;<br>                  &lt;<strong>goal</strong>&gt;build-info&lt;/<strong>goal</strong>&gt;<br>               &lt;/<strong>goals</strong>&gt;<br>            &lt;/<strong>execution</strong>&gt;<br>         &lt;/<strong>executions</strong>&gt;<br>      &lt;/<strong>plugin</strong>&gt;<br>      &lt;<strong>plugin</strong>&gt;<br>         &lt;<strong>groupId</strong>&gt;pl.project13.maven&lt;/<strong>groupId</strong>&gt;<br>         &lt;<strong>artifactId</strong>&gt;git-commit-id-plugin&lt;/<strong>artifactId</strong>&gt;<br>      &lt;/<strong>plugin</strong>&gt;<br>   &lt;/<strong>plugins</strong>&gt;<br>&lt;/<strong>build</strong>&gt;<br><br>&lt;/<strong>project</strong>&gt;</pre><p>3. Build application:</p><pre>mvn clean install</pre><p>4. Build Docker image:</p><pre>docker build -t docker-image:latest -f target/docker-resources/Dockerfile target/</pre><p>Working code is available in the following Github repository: <a href="https://github.com/jinternals/docker-image">https://github.com/jinternals/docker-image</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=901ec0d9de58" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jinternals/build-docker-images-with-and-maven-901ec0d9de58">Build docker images with and maven</a> was originally published in <a href="https://medium.com/jinternals">Jinternals</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Pods]]></title>
            <link>https://medium.com/jinternals/kubernetes-pods-d66c1a577320?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d66c1a577320</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Thu, 17 Jan 2019 10:17:47 GMT</pubDate>
            <atom:updated>2019-01-17T10:17:47.364Z</atom:updated>
            <content:encoded><![CDATA[<p>Pods are the fundamental deployable unit in Kubernetes. They are mortal and atomic in nature. They born and die, don’t resurrect.</p><ul><li>Pods are scheduled on the node.</li><li>Containers in the pod share same IP, PORT, and VOLUMES.</li><li>Multiple containers can be deployed in a pod.</li><li>Containers used IPC within the same pod for communication.</li><li>Containers can look-up each other using localhost in Pod.</li></ul><p><strong>Pods and Controllers</strong></p><p>A controller can create and manage multiple Pods for you, handling replication and rollout and providing self-healing capabilities at cluster scope. For example, if a Node fails, the Controller might automatically replace the pod by scheduling an identical replacement on a different Node.</p><p>Some example of controllers:</p><ul><li>Deployment</li><li>StatefulSet</li><li>DaemonSet</li></ul><h4><strong>Pod </strong>lifecycle <strong>phase:</strong></h4><p>Every pod in the kubernets cluster has lifecycle phases. Here are the possible values for phase:</p><ul><li><strong>Pending</strong>: The Pod has been accepted by the Kubernetes system, but one or more of the Container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while.</li><li><strong>Running:</strong> The Pod has been bound to a node, and all of the Containers have been created. At least one Container is still running or is in the process of starting or restarting.</li><li><strong>Succeeded:</strong> All Containers in the Pod have terminated in success, and will not be restarted.</li><li><strong>Failed:</strong> All Containers in the Pod have terminated, and at least one Container has terminated in failure. That is, the Container either exited with non-zero status or was terminated by the system.</li><li><strong>Unknown: </strong>For some reason, the state of the pod could not be obtained, typically due to an error in communicating with the host of the Pod.</li></ul><h4><strong>Pod conditions:</strong></h4><p>A Pod has a PodStatus, contains details for the current condition of this pod. Here are the possible values for conditions:</p><ul><li>PodScheduled</li><li>Ready</li><li>Initialized</li><li>Unschedulable</li></ul><h4><strong>Container probes:</strong></h4><p>It is often better if the system at large can be aware of the readiness state of different components, or if components are visible only when they are truly ready.</p><p>To achieve this kubelet calls a Handler implemented by the Container. There are three types of handlers:</p><ul><li>ExecAction: Run a command that returns 0 for success</li><li>TCPSocketAction: Just check that a port is open.</li><li>HTTPGetAction: Performs an HTTP Get request against the Container’s IP address on a specified port and path. It’s considered successful if the response has a status code greater than or equal to 200 and less than 400.</li></ul><p><strong>Liveness or readiness probes</strong></p><ol><li><strong>Liveness probe:</strong> Check your containers are alive.</li><li><strong>Readiness probe: </strong>Check if your containers are ready to serve traffic.</li></ol><h4><strong>Restart policy:</strong></h4><p>RestartPolicy only refers to restarts of the Containers by the kubelet on the same node. The default value is always. <strong>restartPolicy</strong> applies to all Containers in the Pod. <strong>restartPolicy</strong> only refers to restarts of the Containers by the kubelet on the same node.</p><p>Possible values:</p><ul><li>Always</li><li>OnFailure</li><li>Never</li></ul><h4><strong>Init Containers:</strong></h4><p>Init container allow to run certain commands before running main containers. Init containers run sequential order.</p><ul><li>They always run to completion.</li><li>Each one must complete successfully before the next one is started.</li><li>Adhere restartPolicy of pod.</li><li>Init Containers do not support readiness probes.</li></ul><h4>Example code:</h4><p>Full code is available on following git URL:</p><p><a href="https://github.com/jinternals/kubernetes/tree/master/2.%20kubernetes%20pod">https://github.com/jinternals/kubernetes/tree/master/2.%20kubernetes%20pod</a></p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: user<br>  namespace: demo<br>  labels:<br>    env: dev<br>spec:<br>  containers:<br>  - name: user<br>    image: jinternals/user:latest<br>    resources:<br>      requests:<br>        cpu: &quot;500m&quot;<br>        memory: &quot;128Mi&quot;<br>      limits:<br>        cpu: &quot;1000m&quot;<br>        memory: &quot;256Mi&quot;<br>    ports:<br>      - containerPort: 8080<br>        name: http<br>        protocol: TCP<br>    readinessProbe:<br>      httpGet:<br>        path: /health<br>        port: 8012<br>      initialDelaySeconds: 15<br>      timeoutSeconds: 1<br>      periodSeconds: 5<br>      failureThreshold: 3<br>    livenessProbe:<br>      httpGet:<br>        path: /health<br>        port: 8012<br>      initialDelaySeconds: 15<br>      timeoutSeconds: 1<br>      periodSeconds: 5<br>      failureThreshold: 3<br>  initContainers:<br>    - name: init-mongo<br>      image: busybox<br>      command: [&#39;sh&#39;, &#39;-c&#39;, &#39;until nslookup mongo; do echo waiting for mongo; sleep 2; done;&#39;]<br>  restartPolicy: Always</pre><h4>Multi-container pod example:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GsICwcWnZsOCZdrnLDtB3g.png" /><figcaption>Multi-container pod</figcaption></figure><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: nginx<br>  namespace: demo<br>spec:<br>  restartPolicy: Never<br>  containers:<br>  - name: nginx-container<br>    image: nginx<br>    volumeMounts:<br>    - name: shared-data<br>      mountPath: /usr/share/nginx/html<br>  - name: data-container<br>    image: debian<br>    volumeMounts:<br>    - name: shared-data<br>      mountPath: /pod-data<br>    command: [&quot;/bin/sh&quot;]<br>    args: [&quot;-c&quot;, &quot;echo Hello world from container &gt; /pod-data/index.html&quot;]<br>  volumes:<br>    - name: shared-data<br>      emptyDir: {}</pre><p><a href="https://medium.com/jinternals/kubernetes-namespace-258ef82f365a">Previous</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d66c1a577320" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jinternals/kubernetes-pods-d66c1a577320">Kubernetes Pods</a> was originally published in <a href="https://medium.com/jinternals">Jinternals</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Object Creation & “this” in java]]></title>
            <link>https://medium.com/jinternals/object-creation-this-in-java-df8ce7d4171b?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/df8ce7d4171b</guid>
            <category><![CDATA[jinternals]]></category>
            <category><![CDATA[this]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Thu, 25 Oct 2018 16:49:09 GMT</pubDate>
            <atom:updated>2018-10-25T16:49:09.212Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we will take a look inside JVM object creation and “this” object reference.</p><h4>Everyone knows how to create a class:</h4><pre><strong>public class </strong>Rectangle {<br>    <strong>int width</strong>;<br>    <strong>int height</strong>;<br><br>    <strong>public </strong>Rectangle(<strong>int </strong>width, <strong>int </strong>height) {<br>        <strong>this</strong>.<strong>width </strong>= width;<br>        <strong>this</strong>.<strong>height </strong>= height;<br>    }<br><br>    <strong>public int </strong>getHeight() {<br>        Rectangle rectangle = <strong>new </strong>Rectangle(4, 5);<br>        <strong>return height</strong>;<br>    }<br><br>    <strong>public int </strong>getWidth() {<br>        <strong>return width</strong>;<br>    }<br>}</pre><h4>How you create an object:</h4><pre>Rectangle <strong>rectangle </strong>= <strong>new </strong>Rectangle(4,5);</pre><h4>How JVM understands the object creation:</h4><p>During the compilation phase, JVM creates a method name &lt;init&gt; with the same parameters as your constructor. So Object creation for Rectangle class will look like this.</p><pre>Rectangle <strong>rectangle </strong>= <strong>new </strong>Rectangle; <br>Rectangle.&lt;init&gt;(rectangle,4,5);</pre><h4>This looks strange let&#39;s expand &lt;init&gt;(rectangle,4,5):</h4><p>So the first parameter of every instance method is always reference of its object. Internally this first parameter is referred to as “this”.</p><pre>Rectangle.&lt;init&gt;(rectangle,4,5);<br><br>&lt;init&gt;(Rectangle <strong>this</strong>, <strong>int </strong>width, <strong>int </strong>height)<br>{<br>        <strong>this</strong>.width = width;<br>        <strong>this</strong>.height = height<br> }</pre><h4>JVM’s instruction set for object creation and assignment:</h4><pre>Rectangle rectangle = <strong>new </strong>Rectangle(4,5);</pre><p>translates to</p><pre><strong>new </strong>          #2                  <em>// class Rectangle<br></em>dup<br>iconst_4<br>iconst_5<br>invokespecial #3                  <em>// Method Rectangle.&quot;&lt;init&gt;&quot;:(II)V<br></em>astore_1</pre><h4>JVM’s instruction set for object creation:</h4><pre><strong>new </strong>Rectangle(4,5);</pre><p>translates to</p><pre>new           #2                  // class Rectangle<br>dup<br>iconst_4<br>iconst_5<br>invokespecial #3                  // Method Rectangle.&quot;&lt;init&gt;&quot;:(II)V<br>pop</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df8ce7d4171b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jinternals/object-creation-this-in-java-df8ce7d4171b">Object Creation &amp; “this” in java</a> was originally published in <a href="https://medium.com/jinternals">Jinternals</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservice Orchestration vs Choreography]]></title>
            <link>https://medium.com/jinternals/microservice-orchestration-vs-choreography-17269e3f6017?source=rss-838b9037b5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/17269e3f6017</guid>
            <category><![CDATA[choreography]]></category>
            <category><![CDATA[jinternals]]></category>
            <category><![CDATA[orchestration]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Mradul Pandey]]></dc:creator>
            <pubDate>Wed, 24 Oct 2018 10:57:53 GMT</pubDate>
            <atom:updated>2018-10-24T10:57:53.033Z</atom:updated>
            <content:encoded><![CDATA[<p>As we start developing microservices, sooner or later we see services start interacting with each other due to the complex nature of the business transaction.</p><p>This interaction style can be categorized as Orchestration or Choreography.</p><h4>Orchestration:</h4><p>The orchestration is the automated arrangement, coordination, and management of the computer system, middleware, and services. These services, middleware, and the computer system know who can perform a given task.</p><p>If services are aware to whom they should delegate the task for fulfillment then that can be described as service orchestration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1NImin3RgS_ooIVBGcXcPQ.png" /><figcaption>Orchestration</figcaption></figure><p>As in the above image, user service is aware of search and email service for searching and sending an email.</p><h4>Choreography:</h4><p>Service choreography is a form of service composition in which the interaction protocol between several partners is defined from a global perspective.</p><p>If services are not aware to whom they should delegate the task and services on other end subscribes only to events in which they are interested then it is known as service choreography.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1iJXj4If4a-hDIGN9AfHmw.png" /><figcaption>choreography</figcaption></figure><p>As in the above image, user service is only aware of the golobal bus to notify others.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17269e3f6017" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jinternals/microservice-orchestration-vs-choreography-17269e3f6017">Microservice Orchestration vs Choreography</a> was originally published in <a href="https://medium.com/jinternals">Jinternals</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>