<?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 Pankaj Singh on Medium]]></title>
        <description><![CDATA[Stories by Pankaj Singh on Medium]]></description>
        <link>https://medium.com/@pankajsingh_78597?source=rss-b8eb462cff28------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nHiWPe1sXRnzLiIa.</url>
            <title>Stories by Pankaj Singh on Medium</title>
            <link>https://medium.com/@pankajsingh_78597?source=rss-b8eb462cff28------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:16:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pankajsingh_78597/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 to Create and Publish a Java Library to Maven Central with GitHub Actions]]></title>
            <link>https://medium.com/@pankajsingh_78597/how-to-create-and-publish-a-java-library-to-maven-central-with-github-actions-e591ea4114bb?source=rss-b8eb462cff28------2</link>
            <guid isPermaLink="false">https://medium.com/p/e591ea4114bb</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[plugin-development]]></category>
            <category><![CDATA[senior-developer]]></category>
            <category><![CDATA[maven-central]]></category>
            <dc:creator><![CDATA[Pankaj Singh]]></dc:creator>
            <pubDate>Sat, 05 Jul 2025 23:17:57 GMT</pubDate>
            <atom:updated>2025-07-05T23:17:57.842Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever built a reusable Java component or Spring Boot starter that you wanted to share across multiple projects — or even with the world?</p><p>Thanks to modern tooling, <strong>publishing a Java library to Maven Central is easier than ever</strong>. In this guide, I’ll walk you through the <strong>entire process</strong>, including:</p><p>✅ Creating a clean Maven project<br> ✅ Registering with the <strong>Sonatype Central Portal</strong> (no Jira required!)<br> ✅ Generating GPG keys and secrets<br> ✅ Automating publishing with <strong>GitHub Actions</strong></p><p>Let’s get started. 🚀</p><h3>🧱 Step 1: Set Up Your Maven Project</h3><p>Start by generating a Maven project:</p><pre>mvn archetype:generate -DgroupId=io.github.yourusername \<br>  -DartifactId=my-awesome-library \<br>  -DarchetypeArtifactId=maven-archetype-quickstart \<br>  -DinteractiveMode=false</pre><p>Make sure your project includes:</p><ul><li>A valid open-source license (MIT, Apache-2.0, etc.)</li><li>A README.md and LICENSE file</li><li>JavaDocs for public classes</li><li>Unit tests</li><li>A clean GitHub repository (public)</li></ul><h3>✅ Step 2: Register with Sonatype Central Portal</h3><p>Sonatype has greatly simplified the process of publishing to Maven Central using the <strong>Central Portal</strong>. Here’s how to get set up:</p><h3>🔐 2.1 Sign In with GitHub</h3><ol><li>Visit <a href="https://central.sonatype.org/publish/central-portal/">https://central.sonatype.org/publish/central-portal/</a></li><li>Click <strong>“Sign In with GitHub”</strong> and authorize access</li></ol><p>This creates your Sonatype account linked to GitHub.</p><h3>🏷 2.2 Create a Namespace (GroupId)</h3><p>Next, request a namespace — this is your Maven groupId, typically:</p><ul><li>io.github.yourusername</li><li>com.yourcompany.project</li></ul><p>To do this:</p><ol><li>Go to <strong>Request Namespace</strong></li><li>Enter:</li></ol><ul><li><strong>GroupId</strong>: (e.g., io.github.sipankaj)</li><li><strong>Repo URL</strong>: (e.g., <a href="https://github.com/yourusername/your-lib)">https://github.com/yourusername/your-lib)</a></li><li>Choose a valid license (MIT, Apache 2.0)</li></ul><p>3. Ensure the GitHub repo:</p><ul><li>Has a LICENSE</li><li>Is public</li><li>Lists your GitHub username in the pom.xml’s &lt;developers&gt; section</li></ul><p>✅ Once approved, you’ll receive deploy access for this namespace.</p><h3>🔑 2.3 Create a Publishing Token</h3><p>Now generate your credentials for deployment:</p><ol><li>Go to <strong>My Profile &gt; Users</strong></li><li>Select yourself or create a deploy user</li><li>Click <strong>Access Tokens</strong></li><li>Create a new token → copy the <strong>username</strong> and <strong>token</strong></li></ol><p>We’ll use these in GitHub Actions.</p><h3>🔐 Step 3: Generate a GPG Key</h3><p>Maven Central requires all artifacts to be <strong>signed with a GPG key</strong>.</p><h3>3.1 Generate Key</h3><pre>gpg --full-generate-key</pre><p>Choose RSA 4096 bits, never expire, and provide your name/email.</p><h3>3.2 Export the Keys</h3><pre># Private key (for GitHub secret)<br>gpg --armor --export-secret-keys YOUR_KEY_ID &gt; private.key<br><br># Public key (to share)<br>gpg --armor --export YOUR_KEY_ID &gt; public.key</pre><p>Upload the <strong>public key</strong> to the keyserver:</p><pre>gpg --keyserver keyserver.ubuntu.com --send-keys YOUR_KEY_ID</pre><h3>🔐 Step 4: Add GitHub Secrets</h3><p>Go to your GitHub repo → <strong>Settings &gt; Secrets and Variables &gt; Actions</strong>, and add:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFhZ6z_Jz2gjJt8xtio8Uw.png" /></figure><p>To encode your private key:</p><pre>base64 -w 0 private.key &gt; gpg.b64</pre><p>Then copy the contents of gpg.b64 into the GPG_PRIVATE_KEY secret.</p><h3>📝 Step 5: Update Your pom.xml</h3><p>Update your pom.xml with the required metadata and plugins.</p><h3>Project Metadata:</h3><pre>&lt;groupId&gt;io.github.yourusername&lt;/groupId&gt;<br>&lt;artifactId&gt;my-awesome-library&lt;/artifactId&gt;<br>&lt;version&gt;1.0.0&lt;/version&gt;<br>&lt;name&gt;My Awesome Library&lt;/name&gt;<br>&lt;description&gt;A reusable Java library for XYZ&lt;/description&gt;<br>&lt;url&gt;https://github.com/yourusername/my-awesome-library&lt;/url&gt;</pre><pre>&lt;licenses&gt;<br>  &lt;license&gt;<br>    &lt;name&gt;MIT License&lt;/name&gt;<br>    &lt;url&gt;https://opensource.org/licenses/MIT&lt;/url&gt;<br>  &lt;/license&gt;<br>&lt;/licenses&gt;</pre><pre>&lt;developers&gt;<br>  &lt;developer&gt;<br>    &lt;id&gt;yourusername&lt;/id&gt;<br>    &lt;name&gt;Your Name&lt;/name&gt;<br>    &lt;email&gt;you@example.com&lt;/email&gt;<br>  &lt;/developer&gt;<br>&lt;/developers&gt;</pre><pre>&lt;scm&gt;<br>  &lt;url&gt;https://github.com/yourusername/my-awesome-library&lt;/url&gt;<br>  &lt;connection&gt;scm:git:git://github.com/yourusername/my-awesome-library.git&lt;/connection&gt;<br>  &lt;developerConnection&gt;scm:git:ssh://git@github.com/yourusername/my-awesome-library.git&lt;/developerConnection&gt;<br>&lt;/scm&gt;</pre><h3>Distribution Management:</h3><pre>&lt;distributionManagement&gt;<br>  &lt;repository&gt;<br>    &lt;id&gt;central&lt;/id&gt;<br>    &lt;url&gt;https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/&lt;/url&gt;<br>  &lt;/repository&gt;<br>&lt;/distributionManagement&gt;</pre><h3>🔧 Required Plugins</h3><pre>&lt;build&gt;<br>  &lt;plugins&gt;    <br>&lt;!-- Sign with GPG --&gt;<br>    &lt;plugin&gt;<br>      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>      &lt;artifactId&gt;maven-gpg-plugin&lt;/artifactId&gt;<br>      &lt;version&gt;3.1.0&lt;/version&gt;<br>      &lt;executions&gt;<br>        &lt;execution&gt;<br>          &lt;id&gt;sign-artifacts&lt;/id&gt;<br>          &lt;phase&gt;verify&lt;/phase&gt;<br>          &lt;goals&gt;&lt;goal&gt;sign&lt;/goal&gt;&lt;/goals&gt;<br>        &lt;/execution&gt;<br>      &lt;/executions&gt;<br>    &lt;/plugin&gt;<br>&lt;!-- Attach sources --&gt;<br>    &lt;plugin&gt;<br>      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>      &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;<br>      &lt;version&gt;3.2.1&lt;/version&gt;<br>      &lt;executions&gt;<br>        &lt;execution&gt;&lt;id&gt;attach-sources&lt;/id&gt;&lt;goals&gt;&lt;goal&gt;jar&lt;/goal&gt;&lt;/goals&gt;&lt;/execution&gt;<br>      &lt;/executions&gt;<br>    &lt;/plugin&gt;<br>    &lt;!-- Attach javadocs --&gt;<br>    &lt;plugin&gt;<br>      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>      &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;<br>      &lt;version&gt;3.4.1&lt;/version&gt;<br>      &lt;executions&gt;<br>        &lt;execution&gt;&lt;id&gt;attach-javadocs&lt;/id&gt;&lt;goals&gt;&lt;goal&gt;jar&lt;/goal&gt;&lt;/goals&gt;&lt;/execution&gt;<br>      &lt;/executions&gt;<br>    &lt;/plugin&gt;<br>  &lt;/plugins&gt;<br>&lt;/build&gt;</pre><h3>🤖 Step 6: GitHub Actions Workflow</h3><p>Create a GitHub Actions workflow at .github/workflows/maven-release.yml:</p><pre>name: Publish to Maven Central<br>on:<br>  push:<br>    tags:<br>      - &#39;v*&#39;<br>jobs:<br>  publish:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: Checkout code<br>        uses: actions/checkout@v4<br>      - name: Import GPG key<br>        run: |<br>          echo &quot;${{ secrets.GPG_PRIVATE_KEY }}&quot; | base64 --decode &gt; private.key<br>          gpg --batch --import private.key<br>      - name: Set up Java<br>        uses: actions/setup-java@v4<br>        with:<br>          distribution: temurin<br>          java-version: 21<br>          server-id: central<br>          server-username: ${{ secrets.OSSRH_USERNAME }}<br>          server-password: ${{ secrets.OSSRH_PASSWORD }}<br>          gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}<br>          cache: maven<br>      - name: Configure Maven settings<br>        run: |<br>          mkdir -p ~/.m2<br>          echo &quot;&lt;settings&gt;&lt;servers&gt;&lt;server&gt;&lt;id&gt;central&lt;/id&gt;&quot; &gt; ~/.m2/settings.xml<br>          echo &quot;&lt;username&gt;${{ secrets.OSSRH_USERNAME }}&lt;/username&gt;&quot; &gt;&gt; ~/.m2/settings.xml<br>          echo &quot;&lt;password&gt;${{ secrets.OSSRH_PASSWORD }}&lt;/password&gt;&quot; &gt;&gt; ~/.m2/settings.xml<br>          echo &quot;&lt;/server&gt;&lt;/servers&gt;&lt;/settings&gt;&quot; &gt;&gt; ~/.m2/settings.xml<br>      - name: Deploy to Maven Central<br>        run: mvn clean deploy -P release -DskipTests -Dgpg.passphrase=&quot;${{ secrets.GPG_PASSPHRASE }}&quot;</pre><h3>🚀 Step 7: Release It!</h3><p>To publish your library:</p><pre>git tag v1.0.0<br>git push origin v1.0.0</pre><p>GitHub Actions will build, sign, and upload the library to Sonatype, where it will become available on:</p><ul><li><a href="https://search.maven.org/">https://search.maven.org</a></li><li><a href="https://central.sonatype.org/">https://central.sonatype.org</a></li></ul><p>🎉 Done!</p><h3>🛠 Common Troubleshooting</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6MG5imCMr9EQFshfu_9jg.png" /></figure><h3>🏁 Final Thoughts</h3><p>Creating and publishing a Maven library may seem intimidating, but with the modern Sonatype Portal and GitHub Actions, it’s now an automated and repeatable process.</p><p>✅ You save time<br> ✅ You ensure consistency<br> ✅ You give back to the Java community</p><p>If you’re building reusable components — <strong>share them</strong>. Your future self (and others) will thank you.</p><p>🔗 Useful Links:</p><ul><li><a href="https://central.sonatype.org/publish/central-portal/">Sonatype Central Portal</a></li><li><a href="https://search.maven.org/">Search Maven</a></li><li><a href="https://keyserver.ubuntu.com/">GPG Key Upload</a></li></ul><p>💬 Found this helpful? Let me know or follow for more articles on building libraries, Spring Boot internals, and cloud-native development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e591ea4114bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing remote-config-spring-boot-starter: A Plug-and-Play Way to Load Configs from GCS or SFTP…]]></title>
            <link>https://medium.com/@pankajsingh_78597/introducing-remote-config-spring-boot-starter-a-plug-and-play-way-to-load-configs-from-gcs-or-sftp-e5edecd72aea?source=rss-b8eb462cff28------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5edecd72aea</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[gcp-migration]]></category>
            <category><![CDATA[configuration-management]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Pankaj Singh]]></dc:creator>
            <pubDate>Sat, 05 Jul 2025 19:45:29 GMT</pubDate>
            <atom:updated>2025-07-07T00:49:30.388Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introducing r<strong>emote-config-spring-boot-starter</strong>: A Plug-and-Play Way to Load Configs from GCS or SFTP in Spring Boot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rwxKhXFpVqZvwJB-zKuBQ.png" /></figure><p><strong>📖 Read for Free:</strong><br> <a href="https://medium.com/@pankajsingh_78597/introducing-remote-config-spring-boot-starter-a-plug-and-play-way-to-load-configs-from-gcs-or-sftp-e5edecd72aea?source=friends_link&amp;sk=7f4bb7330db6947bce3cd07f90276c14">Access the full article here with a free friend link</a></p><p>Recently, I was working on a project involving the migration of backend processes to Google Cloud Platform (GCP). One of the requirements was to run Spring Boot services on <strong>Cloud Run</strong>, and these services needed to execute based on <strong>use-case-specific YAML configuration files</strong>.</p><p>Now, each of these YAML configs lived in different GitHub repositories (owned by different teams), and they were uploaded to <strong>GCS buckets</strong>. This meant the Spring application had to load <strong>different configs dynamically at runtime</strong>, depending on the use case and trigger.</p><p>Instead of writing boilerplate code in each Spring Boot app to load remote configs before context initialization, I thought to generalize this into a reusable Spring Boot starter — and that’s how <a href="https://github.com/sipankaj/remote-config-spring-boot-starter">remote-config-spring-boot-starter</a> was born.</p><h3>The Problem: Decentralized Configs in the Cloud Era</h3><p>There are multiple ways to handle dynamic configuration in Spring:</p><ul><li>You can mount configs at runtime.</li><li>You can read externalized configs in @PostConstruct.</li><li>Or inject custom PropertySourceLoaders.</li></ul><p>But all of these approaches required repetitive setup, boilerplate logic, and didn’t feel truly <strong>plug-and-play</strong>.</p><p>So I decided to generalize the solution and build a reusable library that handles this concern cleanly — <a href="https://github.com/sipankaj/remote-config-spring-boot-starter"><strong>remote-config-spring-boot-starter</strong></a>.</p><h3>Introducing: remote-config-spring-boot-starter</h3><p>This library lets you define remote config sources via environment variables, and it <strong>loads them before the Spring </strong><strong>ApplicationContext initializes</strong>, just like a native application.yml.</p><p>It supports:</p><p>✅ GCS buckets<br> ✅ SFTP servers (with secret support via GCP Secret Manager or HashiCorp Vault)<br> ✅ Runtime selection via environment or YAML<br> ✅ Extendable design — supports future addition of AWS S3, Azure Blob, etc.</p><h3>How It Works</h3><p>Here’s how you can integrate it in 3 easy steps:</p><h3>1. Add the dependency</h3><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;io.github.sipankaj&lt;/groupId&gt;<br>    &lt;artifactId&gt;remote-config-spring-boot-starter&lt;/artifactId&gt;<br>    &lt;version&gt;1.0.11&lt;/version&gt;<br>&lt;/dependency&gt;</pre><h3><strong>2. Enable the annotation</strong></h3><pre>@EnableRemoteConfig<br>@SpringBootApplication<br>public class MyApp {<br>    public static void main(String[] args) {<br>        SpringApplication.run(MyApp.class, args);<br>    }<br>}</pre><p>And configure it via environment variables:</p><h4>☁️ <strong>For GCS:</strong></h4><pre>| Variable                         | Description                               |<br>| -------------------------------- | ----------------------------------------- |<br>| `REMOTE_CONFIG_TYPE`             | Must be `GCS`                             |<br>| `REMOTE_CONFIG_BUCKET_OR_HOST`   | GCS bucket name                           |<br>| `REMOTE_CONFIG_FILE`             | Path to the config file inside the bucket |<br>| `GOOGLE_APPLICATION_CREDENTIALS` | Path to the GCP service account key file  |</pre><h4>🔐 For SFTP:</h4><pre>| Variable                                | Description                           |<br>| --------------------------------------- | ------------------------------------- |<br>| `REMOTE_CONFIG_TYPE`                    | Must be `SFTP`                        |<br>| `REMOTE_CONFIG_BUCKET_OR_HOST`          | Hostname of the SFTP server           |<br>| `REMOTE_CONFIG_PORT`                    | SFTP port (default: `22`)             |<br>| `REMOTE_CONFIG_USERNAME`                | SFTP username                         |<br>| `REMOTE_CONFIG_FILE`                    | Path to the config file on the server |<br>| `REMOTE_CONFIG_CREDENTIAL_SOURCE`       | `ENV` (default), `GCP`, or `VAULT`    |<br>| *(If using `ENV` as credential source)* |                                       |<br>| `REMOTE_CONFIG_PASSWORD`                | (Optional) SFTP password              |<br>| `REMOTE_CONFIG_PRIVATE_KEY_PATH`        | (Optional) Path to private key file   |<br>| `REMOTE_CONFIG_PRIVATE_KEY_PASSPHRASE`  | (Optional) Private key passphrase     |</pre><h3>Why Not Use Mounting or Post-Initialization?</h3><p>There are other ways to load dynamic configs — like mounting files via entrypoints or loading after @PostConstruct. But these have drawbacks:</p><ul><li>Mounting config files requires custom CI/CD logic and access to bucket keys.</li><li>Post-initialization loading means config values won’t be available for conditional beans, profiles, or early context decisions.</li></ul><p>This library solves both by <strong>injecting the remote config as a native Spring property source</strong> at the correct lifecycle phase.</p><h3>What’s Next?</h3><p>The code is structured using <strong>SOLID principles</strong> and a factory pattern that makes it easy to plug in other loaders. Planned features include:</p><ul><li>✅ Amazon S3 support</li><li>✅ Azure Blob integration</li><li>✅ Enhanced caching and fallback</li></ul><p>The code is open source and available here:<br> 🔗 <a href="https://github.com/sipankaj/remote-config-spring-boot-starter">https://github.com/sipankaj/remote-config-spring-boot-starter</a></p><h3>Try It, Use It, Improve It</h3><p>If you’re working with Spring Boot applications on the cloud and need to <strong>load configs dynamically at runtime</strong>, give this starter a try. It’s available on Maven Central and designed to be dropped into your application with minimal effort.</p><p>I’d love your feedback and contributions. If you have ideas, use cases, or improvements, feel free to fork, PR, or raise issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5edecd72aea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unraveling the Dry Loop Mystery: A Personal Journey with a Fiber Internet Provider in Canada]]></title>
            <link>https://medium.com/@pankajsingh_78597/unraveling-the-dry-loop-mystery-a-personal-journey-with-a-fiber-internet-provider-in-canada-eec501e11d39?source=rss-b8eb462cff28------2</link>
            <guid isPermaLink="false">https://medium.com/p/eec501e11d39</guid>
            <category><![CDATA[telecommunication]]></category>
            <category><![CDATA[telecom]]></category>
            <category><![CDATA[fiber-optics]]></category>
            <dc:creator><![CDATA[Pankaj Singh]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 01:59:21 GMT</pubDate>
            <atom:updated>2024-01-17T04:01:27.148Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*mZkYppr88AUN551bAQqMJw@2x.jpeg" /></figure><h3>Introduction:</h3><p>In the dynamic realm of telecommunications, the allure of high-speed fiber internet is a beacon for those seeking faster and more reliable connectivity. Opting for a leading provider in Canada, my anticipation for superior service was met with a twist when delving into the intricacies of the dry loop offering.</p><h3>The Appeal of Fiber Internet:</h3><p>In the pursuit of an upgraded internet connection, my choice fell upon a renowned telecommunications provider in Canada, known for its commitment to delivering high-speed fiber-optic internet. The promise of faster downloads, seamless streaming, and dependable connectivity seemed too enticing to resist. Little did I anticipate the journey that unfolded in my exploration of the provider’s services.</p><h3>The Dry Loop Dilemma:</h3><p>Post the installation of the fiber internet connection, I eagerly logged into my account to explore the associated services. To my surprise, I discovered an enigmatic addition — a phone line with a ZERO-dollar-rated plan and service. What further baffled me was that the associated number was not provisioned to the network.</p><p>Seeking clarity and resolution, I reached out to the provider’s customer support. The representative explained that the phenomenon I observed was linked to a “dry loop” service associated with my fiber internet connection.</p><h3>Deciphering Dry Loop:</h3><p>In the realm of telecommunications, a dry loop refers to a phone line without an active voice service. Essentially, it is a physical connection that facilitates the delivery of internet services over existing telephone lines without the necessity for an active phone service. While this concept is not uncommon, the confusion arose when the associated phone line surfaced in my account with no apparent functionality and a price tag of zero dollars.</p><h3>The Enigma of the Unprovisioned Number:</h3><p>Delving deeper into the situation, it became evident that the associated phone number was not provisioned to the network, rendering it inactive for any voice services. While the customer service representative assured me that this wouldn’t impact my internet services, the inclusion of an inactive phone line in my account prompted contemplation on the aspects of transparency and communication from the provider.</p><h3>Key Takeaways:</h3><p>My encounter with the dry loop service from this Canadian telecommunications provider underscores the importance of comprehensive communication and transparency. While the dry loop itself is a legitimate practice, the inclusion of what appeared to be an inactive phone line in my account without clear communication raised unnecessary concerns.</p><p>Customers should be informed about any additional services associated with their accounts, even if they are complimentary or inactive. Clear and transparent communication from the provider can mitigate confusion, ensuring a smoother customer experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eec501e11d39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining API Stub Generation with Swagger Project]]></title>
            <link>https://medium.com/@pankajsingh_78597/streamlining-api-stub-generation-with-swagger-project-adb41e7024c5?source=rss-b8eb462cff28------2</link>
            <guid isPermaLink="false">https://medium.com/p/adb41e7024c5</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[swagger-codegen]]></category>
            <category><![CDATA[openapi-generator]]></category>
            <category><![CDATA[swagger]]></category>
            <category><![CDATA[openapi-specification]]></category>
            <dc:creator><![CDATA[Pankaj Singh]]></dc:creator>
            <pubDate>Thu, 26 Oct 2023 00:07:56 GMT</pubDate>
            <atom:updated>2023-12-21T04:38:58.012Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Efficient API development often starts with generating stubs that serve as placeholders for actual endpoints. Swagger Project, with its powerful code generation capabilities, streamlines this process. In this article, we’ll explore how Swagger Project can be used to generate API stubs and demonstrate a practical implementation.</blockquote><h4>Prerequisites</h4><p>Before we dive into the implementation, make sure you have the following installed:</p><ul><li>JDK (Java Development Kit)</li><li>Maven</li><li>Swagger Codegen Plugin</li></ul><h4>Configuring Swagger Codegen Maven Plugin</h4><p>First, add the Swagger Codegen Maven Plugin to your project’s pom.xml file. This plugin will automate the generation of API stubs. Here’s an example -</p><pre>&lt;!-- Add Swagger Codegen Maven Plugin to build configuration --&gt;<br>&lt;build&gt;<br>    &lt;plugins&gt;<br>        &lt;plugin&gt;<br>            &lt;groupId&gt;io.swagger&lt;/groupId&gt;<br>            &lt;artifactId&gt;swagger-codegen-maven-plugin&lt;/artifactId&gt;<br>            &lt;version&gt;2.4.27&lt;/version&gt;<br>            &lt;executions&gt;<br>                &lt;execution&gt;<br>                    &lt;id&gt;generate-apis&lt;/id&gt;<br>                    &lt;phase&gt;generate-sources&lt;/phase&gt;<br>                    &lt;goals&gt;<br>                        &lt;goal&gt;generate&lt;/goal&gt;<br>                    &lt;/goals&gt;<br>                    &lt;configuration&gt;<br>                        &lt;inputSpec&gt;${swagger.file}&lt;/inputSpec&gt;<br>                        &lt;language&gt;spring&lt;/language&gt;<br>                        &lt;!-- Additional configurations can be added here --&gt;<br>                        ...<br>                    &lt;/configuration&gt;<br>                &lt;/execution&gt;<br>            &lt;/executions&gt;<br>        &lt;/plugin&gt;<br>        ...<br>    &lt;/plugins&gt;<br>&lt;/build&gt;</pre><p>Replace ${swagger.file} with the path to your Swagger file.</p><h4>Generating API Stubs</h4><p>Once the plugin is configured, run the following Maven command to trigger the stub generation:</p><pre>mvn clean install</pre><p>Swagger Codegen will process the Swagger file and generate API stubs in your specified language (in this case, Spring).</p><h4>POC: Swagger Generator Example</h4><p>To demonstrate this process, we’ve set up a sample project on GitHub: Swagger Generator Example.</p><p>This repository contains a basic Spring Boot application with a Swagger file (swagger.yaml). The Swagger Codegen Maven Plugin is already configured in the pom.xml file.</p><p>Running the POC</p><ol><li>Clone the repository:</li></ol><pre>git clone git@github.com:sipankaj/SwaggerGeneratorExample.git</pre><p>2. Navigate to the project directory:</p><pre>cd SwaggerGeneratorExample</pre><p>3. Generate API stubs:</p><pre>mvn clean install</pre><p>4. Check the generated API stubs in the src/main/java directory.</p><h4>Conclusion</h4><p>Automating API stub generation with Swagger Project and Maven significantly accelerates the development process. By incorporating the Swagger Codegen Maven Plugin into your project, you can ensure that API stubs are generated efficiently and consistently. This approach not only saves time but also leads to more reliable and standardized code.</p><p>Feel free to explore the <a href="https://github.com/sipankaj/SwaggerGeneratorExample">Swagger Generator Example repository</a> for a hands-on experience. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adb41e7024c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying mTLS (Mutual Authentication)]]></title>
            <link>https://medium.com/@pankajsingh_78597/demystifying-mtls-mutual-authentication-a-comprehensive-guide-2f2e5a232f3d?source=rss-b8eb462cff28------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f2e5a232f3d</guid>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[mtls-authentication]]></category>
            <category><![CDATA[mutual-tls]]></category>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[Pankaj Singh]]></dc:creator>
            <pubDate>Wed, 25 Oct 2023 23:40:49 GMT</pubDate>
            <atom:updated>2023-12-18T01:59:05.936Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*5AhmKpictNXuxSXieUPvOA.png" /></figure><blockquote>In the realm of secure communications, Transport Layer Security (TLS) is a well-established protocol that safeguards client-server interactions over the internet. It authenticates servers and encrypts data transmissions, ensuring confidentiality and integrity. To delve into mTLS (mutual authentication), it’s essential to first grasp the workings of conventional TLS.</blockquote><h4>Critical Components of TLS:</h4><ol><li>Encryption Keys:<br> — TLS employs a mechanism known as public-key encryption, utilizing two keys: a public key and a private key. These keys work in tandem, ensuring that only the corresponding key can decrypt the data.</li><li>Digital Certificates:<br> — A data file containing the public key, the certificate issuer’s identity, and the certificate’s expiration date. It serves to authenticate the server.</li><li>TLS Handshake:<br> — This process validates the digital certificate and establishes secret keys that enable secure data exchange between client and server.</li></ol><h4>Understanding Traditional TLS:</h4><p>In a standard TLS setup, the server possesses a digital certificate and a public/private key pair, while the client does not. The procedure unfolds as follows:</p><ol><li>Client initiates a “hello” message, specifying supported TLS versions and encryption algorithms.</li><li>Server responds with its selected TLS version and cipher suite.</li><li>Server sends its digital certificate, encompassing its public key.</li><li>Client validates the server’s certificate using a trusted root certificate authority, extracting the server’s public key.</li><li>Client generates a session symmetric key, encrypts it with the server’s public key, and sends it to the server.</li><li>Server decrypts the key with its private key.</li><li>Both parties employ this symmetric key for secure data exchange.</li></ol><h4>Enter mTLS (Mutual Authentication):</h4><p>mTLS operates similarly to TLS but adds an extra layer of security. In mTLS, both the client and server must authenticate themselves using digital certificates. This ensures identity verification of both parties and thwarts unauthorized access.</p><h4>The mTLS procedure entails:</h4><ol><li>Client and server exchange supported TLS versions and cipher suites.</li><li>Server sends its digital certificate, including its public key.</li><li>Client verifies the server’s certificate, extracting the server’s public key.</li><li>Client sends its digital certificate to the server.</li><li>Server authenticates the client’s certificate, extracting the client’s public key.</li><li>Server generates a session symmetric key, encrypts it with the client’s public key, and sends it to the client.</li><li>Client decrypts the symmetric key using its private key.</li><li>Client generates a session symmetric key, encrypts it with the server’s public key, and sends it to the server.</li><li>Server decrypts the symmetric key using its private key.</li><li>Both parties employ their respective symmetric keys for secure data exchange.</li></ol><h4>Practical Implementation with Kafka:</h4><p>For a hands-on demonstration of mTLS in action with Kafka, refer to this <a href="https://github.com/sipankaj/kafka-mTLS"><strong>GitHub repository</strong></a>. The provided script and Docker Compose file walk you through generating certificates, building Docker images, and running the Kafka cluster with mTLS enabled.</p><ol><li>Clone the Git repository.</li><li>Utilize the provided script to generate the necessary certificates.</li><li>Build and run the Docker Compose file, which defines a Kafka cluster, producer, and consumer services, each configured for mTLS.</li></ol><h4>Conclusion:</h4><p>mTLS enhances security by requiring both client and server authentication using digital certificates. This extra layer of identity verification strengthens the integrity of data exchanges. By understanding the inner workings of TLS and mTLS, you’re equipped to implement robust security measures in your communication protocols. Explore the <a href="https://github.com/sipankaj/kafka-mTLS"><strong>GitHub repository</strong></a> to gain practical experience with mTLS and Kafka. Elevate your security posture and safeguard sensitive information in transit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f2e5a232f3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining Batch Processing with Spring Data Flow: Unlocking Efficiency, Scalability, and…]]></title>
            <link>https://medium.com/@pankajsingh_78597/streamlining-batch-processing-with-spring-data-flow-unlocking-efficiency-scalability-and-ed0a645b13e1?source=rss-b8eb462cff28------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed0a645b13e1</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[batch-processing]]></category>
            <dc:creator><![CDATA[Pankaj Singh]]></dc:creator>
            <pubDate>Wed, 25 Oct 2023 23:18:22 GMT</pubDate>
            <atom:updated>2023-10-26T00:24:33.941Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*zS7fFd2avsR5-437SNnwew.png" /></figure><h3>Streamlining Batch Processing with Spring Data Flow: Unlocking Efficiency, Scalability, and Manageability</h3><blockquote>In today’s data-driven world, organizations often encounter challenges when processing substantial volumes of data. To tackle these issues, a transition from a monolithic setup to Spring Data Flow is suggested. This dynamic and streamlined approach empowers organizations with advanced batch processing capabilities. Leveraging the potential of Spring Cloud Data Flow, this migration enhances overall efficiency, scalability, and manageability of batch-processing tasks in the cloud environment.</blockquote><h3>Benefits of Transitioning to Spring Data Flow</h3><h4>Modularity and Scalability</h4><ol><li>Break down monolithic batch processes into manageable components.</li><li>Utilize Spring Data Flow to orchestrate these components as independent microservices, allowing for scalability to meet evolving processing demands.</li></ol><h4>Flexibility in Processing Pipelines</h4><ol><li>Design and manage complex batch processing workflows using Spring Cloud Data Flow’s intuitive visual interface or DSL (Domain Specific Language).</li><li>Empower teams to adapt and modify processing pipelines as business requirements evolve, ensuring flexibility and agility.</li></ol><h4>Resource Efficiency</h4><ol><li>Containerize batch processing applications as efficient Spring Boot applications, optimizing resource utilization.</li><li>Leverage Kubernetes for dynamic scaling, enabling efficient allocation of resources and minimizing waste.</li></ol><h4>Kubernetes Orchestration</h4><ol><li>Capitalize on Kubernetes’ powerful orchestration capabilities to automate scheduling and management of batch processing tasks as pods.</li><li>Each job spawns a pod upon execution or requirement, resulting in efficient resource allocation and utilization.</li></ol><h4>Defining Job Dependency as Composed Tasks</h4><ol><li>Define intricate processing workflows with dependencies using Spring Cloud Data Flow’s composed tasks feature.</li><li>Seamlessly execute interdependent jobs, promoting a streamlined and cohesive batch processing system.</li></ol><h4>Scheduling and Job Orchestration:</h4><ol><li>Leverage Spring Cloud Data Flow’s scheduling capabilities to automate the execution of batch processing tasks at specified intervals.</li><li>Enhance operational efficiency by reducing manual intervention and ensuring timely execution of batch jobs.</li></ol><h4>Application Registration via CI/CD:</h4><ol><li>Streamline the process of registering new applications in Spring Cloud Data Flow by integrating it with the CI/CD pipeline.</li><li>Enable seamless deployment and registration of applications, facilitating an efficient development and deployment process.</li></ol><h4>Monitoring Capabilities:</h4><ol><li>Gain real-time insights into the status and performance of batch processing workflows using Spring Cloud Data Flow’s comprehensive monitoring tools.</li><li>Utilize integrated logging and monitoring solutions for proactive issue detection and resolution, enhancing operational efficiency.</li></ol><h3>Setting up Spring Data Flow with Docker Compose:</h3><p>To get started with Spring Data Flow, you can use the provided Docker Compose configuration below. This setup complements the benefits outlined above, enabling you to swiftly implement and explore Spring Data Flow’s capabilities in your environment.</p><h4>Prerequisites</h4><p>Before you begin, ensure that you have the following tools and prerequisites installed:</p><ol><li>Docker: <a href="https://docs.docker.com/get-docker/">Install Docker</a></li><li>Git: <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">Install Git</a></li></ol><h4>Step 1: Clone the Repository</h4><p>The first step is to clone the repository containing the Docker Compose configuration and setup files. Open your terminal and execute the following command:</p><pre>git clone https://github.com/sipankaj/batch-processing.git<br>cd batch-processing</pre><p>This will clone the repository to your local machine.</p><h4>Step 2: Review the Docker Compose File</h4><p>Inside the repository, you will find a docker-compose.yaml file. This file defines the services and configurations for your Spring Data Flow environment. You can customize it to suit your requirements.</p><p>Here’s a brief overview of some key services defined in the docker-compose.yaml file:</p><ul><li>mysql: A MySQL database container used for Spring Data Flow’s data storage.</li><li>spring-data-flow-server: The Spring Data Flow server itself.</li><li>kafka-broker and zookeeper: Apache Kafka and Zookeeper containers for stream processing.</li><li>app-import-stream and app-import-task: Containers for importing stream and task applications into Spring Data Flow.</li></ul><p>Ensure that the file is configured to your specifications before proceeding.</p><h4>Step 3: Launch the Spring Data Flow Environment</h4><p>To launch the Spring Data Flow environment, open your terminal and navigate to the directory where the docker-compose.yaml file is located. Then, execute the following command:bashCopy cod</p><pre>docker-compose up -d</pre><p>This command will start all the services defined in the Docker Compose file as background processes.</p><h4>Step 4: Access the Spring Data Flow Dashboard</h4><p>Once the Docker containers are up and running, you can access the Spring Data Flow dashboard by opening your web browser and navigating to http://localhost:9393/dashboard. The dashboard provides a user-friendly interface for creating, deploying, and managing data pipelines.</p><h3>Conclusion:</h3><p>The transition from a monolithic setup to Spring Data Flow offers a myriad of benefits for organizations seeking to enhance their batch processing capabilities. By embracing a microservices-oriented architecture and harnessing the power of Spring Cloud Data Flow, organizations can unlock significant improvements in efficiency, scalability, and manageability. With features such as modularity, flexibility in processing pipelines, resource efficiency, Kubernetes orchestration, defined job dependencies, scheduling and job orchestration, application registration via CI/CD, and monitoring capabilities, Spring Data Flow empowers organizations to optimize their batch processing workflows in the cloud environment. Now is the time to embrace this transformative technology and unlock the full potential of your batch processing systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed0a645b13e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka Implementation in C Language with librdkafka: A Practical Guide]]></title>
            <link>https://medium.com/@pankajsingh_78597/kafka-implementation-in-c-language-with-librdkafka-a-practical-guide-40998e6e8705?source=rss-b8eb462cff28------2</link>
            <guid isPermaLink="false">https://medium.com/p/40998e6e8705</guid>
            <dc:creator><![CDATA[Pankaj Singh]]></dc:creator>
            <pubDate>Sun, 16 Jul 2023 21:10:08 GMT</pubDate>
            <atom:updated>2023-07-16T21:11:37.946Z</atom:updated>
            <content:encoded><![CDATA[<h4>Apache Kafka has gained immense popularity as a distributed streaming platform for building real-time data pipelines and streaming applications. While Kafka provides client libraries for various programming languages, this article will focus on implementing Kafka in the C language using the librdkafka library. We will explore the features of librdkafka, step-by-step setup instructions, and a practical example showcasing its capabilities.</h4><h4>Overview of librdkafka:</h4><p>librdkafka is a high-performance C library that provides a full-featured Kafka client implementation. It offers a wide range of functionality, including message production, consumption, metadata management, and support for Kafka’s various reliability and delivery semantics.</p><h4>Features of librdkafka:</h4><p>librdkafka is a high-performance C library that offers a comprehensive set of features for interacting with Apache Kafka. Let’s explore some of its key features:</p><ol><li>Message Production and Consumption: librdkafka provides functions for both producing and consuming messages from Kafka topics. It offers flexible options for configuring message payloads, keys, and metadata.</li><li>High Performance: librdkafka is designed to achieve high throughput and low latency. It leverages efficient buffering and batching techniques to optimize message transmission between producers and consumers.</li><li>Message Serialization: librdkafka supports various serialization formats, including Avro, JSON, and Protobuf, allowing seamless integration with different data serialization requirements.</li><li>Partitioning and Replication: The library provides intelligent partitioning strategies that distribute messages across Kafka partitions. It also supports replica management for ensuring fault tolerance and data redundancy.</li><li>Message Compression: librdkafka supports data compression techniques such as gzip, snappy, and lz4. This feature helps reduce network bandwidth usage and storage requirements for messages.</li><li>Error Handling and Reliability: librdkafka offers robust error handling mechanisms, allowing developers to handle and recover from various Kafka-related errors effectively. It also supports different reliability and delivery semantics, including at-most-once, at-least-once, and exactly-once semantics.</li><li>Configuration Flexibility: librdkafka provides a wide range of configuration options, allowing fine-tuning of various aspects such as network settings, message batching, and authentication mechanisms.</li></ol><h4>Step-by-Step Setup Instructions:</h4><p>To set up and use librdkafka in your C project, follow these step-by-step instructions:</p><ol><li>Install the librdkafka Library:</li></ol><p>Option 1: Use a Package Manager: If available, you can use your operating system’s package manager (e.g., apt, yum, brew) to install librdkafka.</p><p>Option 2: Build from Source: Alternatively, you can download the librdkafka source code from the official GitHub repository (<a href="https://github.com/edenhill/librdkafka">https://github.com/edenhill/librdkafka</a>) and follow the provided build instructions for your platform.</p><p>2. Include the librdkafka Header Files: In your C code, include the necessary librdkafka header files to access its functions and data structures. The most common header to include is &lt;librdkafka/rdkafka.h&gt;.</p><p>3. Link against the librdkafka Library: Configure your build system (e.g., Makefile, CMakeLists.txt) to link against the librdkafka library during the compilation process. Ensure that the necessary library paths and flags are set correctly.</p><p>4. Initialize librdkafka: Before using any librdkafka functions, initialize the library by calling rd_kafka_conf_new() to create a Kafka configuration object. This object holds various configuration settings for librdkafka.</p><p>5. Configure Kafka Properties: Set the desired Kafka properties by calling relevant functions such as rd_kafka_conf_set() on the configuration object. Common properties include bootstrap servers, client ID, authentication credentials, and more.</p><p>6. Create Kafka Producers and Consumers: Use the initialized configuration object to create Kafka producer and consumer instances by calling rd_kafka_new() with the appropriate configuration.</p><p>7. Perform Message Production and Consumption: Utilize librdkafka’s functions to produce messages to Kafka topics using the producer instance. Similarly, use the consumer instance to consume messages from subscribed topics.</p><p>8. Handle Errors and Shutdown: Implement proper error handling logic to handle potential errors that may occur during message production and consumption. Also, gracefully shut down the producer and consumer instances when finished.</p><h4><strong>Practical Example:</strong></h4><p>For a practical example showcasing librdkafka’s capabilities, please refer to the following GitHub repository:<a href="https://github.com/sipankaj/kafka-using-c"> Kafka C Producer and Consumer Example</a>. The example provides source code demonstrating how to produce and consume Kafka events using librdkafka in the C language.</p><h4><strong>Conclusion</strong>:</h4><p>Implementing Kafka in the C language using the librdkafka library empowers developers to leverage the full potential of Kafka’s distributed streaming capabilities. Through exploring the rich features of librdkafka, following the step-by-step setup instructions, and studying the practical example, you are now equipped to integrate Kafka seamlessly into your C projects. Unlock the power of real-time data pipelines and stream processing with Kafka and librdkafka in your C applications. Remember to refer to the official librdkafka documentation for comprehensive information on configuration options, advanced features, and error handling techniques.</p><p>Happy Kafka programming with C and librdkafka!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40998e6e8705" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>