<?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 Mahdi Tilab on Medium]]></title>
        <description><![CDATA[Stories by Mahdi Tilab on Medium]]></description>
        <link>https://medium.com/@mtilab?source=rss-247eceb0317c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hLpsHvfSIpiq1qAhyOIEfw.jpeg</url>
            <title>Stories by Mahdi Tilab on Medium</title>
            <link>https://medium.com/@mtilab?source=rss-247eceb0317c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 04:41:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mtilab/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[Building Trustworthy AI Agents: Why Hallucination Is an Engineering Problem, Not Just an AI Problem]]></title>
            <link>https://mtilab.medium.com/building-trustworthy-ai-agents-why-hallucination-is-an-engineering-problem-not-just-an-ai-problem-66bffa7ff364?source=rss-247eceb0317c------2</link>
            <guid isPermaLink="false">https://medium.com/p/66bffa7ff364</guid>
            <category><![CDATA[autonomy]]></category>
            <category><![CDATA[ai-hallucination]]></category>
            <category><![CDATA[ai-agnets]]></category>
            <dc:creator><![CDATA[Mahdi Tilab]]></dc:creator>
            <pubDate>Sun, 02 Aug 2026 17:55:16 GMT</pubDate>
            <atom:updated>2026-08-02T17:55:16.144Z</atom:updated>
            <content:encoded><![CDATA[<h3>The future of AI engineering won’t be defined by who builds the most autonomous agents. It will be defined by who builds the most reliable ones.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-uh9UAws6fuxuXr2uI943w.png" /></figure><p>The biggest challenge holding back AI agents in production isn’t a lack of intelligence.</p><p><strong>It is a lack of trust.</strong></p><p>An AI agent can analyze system architecture, issue API calls, search internal documentation, write complex code, and automate end-to-end workflows. But the moment it confidently delivers incorrect information, its business value evaporates instantly.</p><pre>+-------------------------------------------------------------+<br>|               TRADITIONAL SOFTWARE VS. AI AGENTS             |<br>+-------------------------------------------------------------+<br>| Traditional Software Fails: Crashes, exceptions, thrown bugs.|<br>| AI Agents Fail: Sound confident, look right, perfect syntax  |<br>|                 — but are completely wrong.                  |<br>+-------------------------------------------------------------+</pre><p>When an agent invents non-existent APIs, suggests broken configurations, generates code based on outdated dependencies, or falsely claims an action was completed when no tool was executed — that is not merely a model limitation.</p><p><strong>That is an engineering architecture flaw.</strong></p><h3>Moving From Primitive Chatbots to Agentic Architecture</h3><p>The fundamental shift in modern AI development isn’t about using larger models. It’s about building better systems around them.</p><h3>The Primitive Chatbot Pattern</h3><pre>[ User ] ---&gt; ( LLM ) ---&gt; [ Unverified Response ]</pre><p><em>Relies entirely on parametric memory (what the model “remembers” from training).</em></p><h3>The Enterprise Agent Pattern</h3><pre>                      [ User ]<br>                         |<br>                         v<br>              [ Agent Orchestrator ]<br>                         |<br>      +------------------+------------------+<br>      |                  |                  |<br> [ Planner ]        [ Memory ]          [ Tools ]<br>      |                                     |<br>      v                                     v<br> [ Reasoning ]                     [ APIs / DB / Search ]<br>      |                                     |<br>      +------------------+------------------+<br>                         |<br>                         v<br>                [ Knowledge Base ]<br>                         |<br>                         v<br>               [ Verification Loop ]<br>                         |<br>                         v<br>               [ Trusted Response ]</pre><p>The enterprise system doesn’t demand that the LLM “know” everything. Instead, it turns the LLM into an orchestrator that can <strong>Retrieve, Reason, Execute, and Verify.</strong></p><h3>The Golden Rule of Agent Engineering</h3><blockquote><strong><em>Never ask an LLM to generate information that a system can retrieve, calculate, or verify.</em></strong></blockquote><blockquote><em>LLMs are reasoning engines, not databases.</em></blockquote><h3>3 Core Architectural Patterns for High-Reliability Agents</h3><h3>Pattern 1: Ground Agents in Enterprise Knowledge (RAG)</h3><p>Without context, an LLM naturally fills in knowledge gaps with assumptions. Giving your agent real-time access to internal GitHub repos, API specifications, and business rules grounds its reasoning in actual data.</p><pre>[ User Question ]<br>       |<br>       v<br>[ Retrieval Layer ] ---&gt; ( GitHub / Confluence / Live APIs )<br>       |<br>       v<br>[ Vector Database / Knowledge Base ]<br>       |<br>       v<br>[ Agent Execution ] ---&gt; [ Grounded Response ]</pre><h3>Pattern 2: Prefer Deterministic Tools Over Model Guessing</h3><p>If the answer exists in a database, an API, or a calculation, force the agent to query it explicitly.</p><pre>❌ BAD:<br>User: &quot;What is the customer&#39;s subscription status?&quot;<br>Agent (guessing): &quot;The customer is likely active.&quot;</pre><pre>✅ RELIABLE:<br>User: &quot;What is the customer&#39;s subscription status?&quot;<br>Agent ---&gt; Call Customer API ---&gt; Query DB ---&gt; [ Verified Answer ]</pre><h3>Pattern 3: Hybrid Verification Loops</h3><p>Relying on a single agent execution is a recipe for silent failures. Top engineering teams separate execution from validation by pairing probabilistic agents with deterministic tools.</p><pre>[ User Goal ]<br>      |<br>      v<br>[ Planner Agent ]<br>      |<br>      v<br>[ Execution Agent ]<br>      |<br>      v<br>[ Hybrid Verification ]<br>   ├── Deterministic Checks (Linters, Compilers, JSON Schemas)<br>   └── Secondary LLM Verification (Grounding &amp; Fact Check)<br>      |<br>      v<br>[ Trusted Output ]</pre><h3>Agentic Engineering in the Enterprise Real-World</h3><p>The paradigm is shifting from <strong>AI-assisted coding</strong> (autocomplete) to full <strong>Agentic Engineering</strong> (autonomous execution with guardrails).</p><pre>Stage 1: Code Completion   --&gt; &quot;Suggest the next 5 lines&quot;<br>Stage 2: Code Context      --&gt; &quot;Understand repository &amp; dependencies&quot;<br>Stage 3: Agentic Workflows  --&gt; &quot;Analyze requirements, modify files, run tests, report diffs&quot;</pre><h3>Ecosystem Frameworks in Action</h3><ul><li><strong>Spring AI (Java):</strong> Elevates Java applications by integrating RAG pipelines, structured outputs, memory management, and tool-calling primitives directly into standard Spring Boot microservices.</li><li><strong>Embabel:</strong> Introduces explicit agent-oriented programming models in Java. Instead of a loose chatClient.call(prompt), it defines formal entities for <strong>Goals, Planning, Tool Execution, and Validation</strong>.</li></ul><h3>The Production Agent Checklist</h3><p>Before deploying an AI agent to production, audit your architecture against these five non-negotiables:</p><ul><li>[ ] <strong>Ground the Context:</strong> Deploy RAG and live repository indexing so the model never operates in a vacuum.</li><li>[ ] <strong>Enforce Tool Usage:</strong> Never let an agent estimate dates, IDs, balances, or statuses — give it execution access to APIs, databases, and sandboxes.</li><li>[ ] <strong>Implement Hybrid Validation:</strong> Combine deterministic software gates (AST parsers, unit tests, schema validators) with LLM verifiers.</li><li>[ ] <strong>Control Autonomy:</strong> Use a human-in-the-loop pattern (<em>AI proposes $\rightarrow$ Human approves $\rightarrow$ AI executes</em>) for destructive actions.</li><li>[ ] <strong>Continuous Observability:</strong> Monitor the <strong>RAG Triad</strong> (Context Relevance, Groundedness, Answer Relevance) and log agent execution chains for latency and token cost drift.</li></ul><h3>Final Thoughts: The Goal Is Trustworthy Autonomy</h3><p>The winner of the next era of software development won’t be the team that gives an AI agent maximum freedom. <strong>It will be the team that builds the strongest engineering framework around it.</strong></p><pre>Powerful Models + Grounded Context + Real Tools + Deterministic Verification = Production Trust</pre><p>The future isn’t just about building autonomous AI — it’s about building <strong>trustworthy autonomy</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66bffa7ff364" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why ‘Code is Truth, Docs Rot’ Is Becoming Obsolete in the AI Era]]></title>
            <link>https://mtilab.medium.com/why-code-is-truth-docs-rot-is-becoming-obsolete-in-the-ai-era-ab301b309de8?source=rss-247eceb0317c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab301b309de8</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[docs-as-code]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[developer-experience]]></category>
            <dc:creator><![CDATA[Mahdi Tilab]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 20:48:28 GMT</pubDate>
            <atom:updated>2026-06-16T20:48:28.199Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQmwSO4RiFQnc5PVAeLTVQ.png" /><figcaption>The Shift from “Code is Truth, Docs Rot” to Docs-as-Code in the AI Era</figcaption></figure><p>For years, software engineering lived by a simple mantra:</p><blockquote><em>“Code is truth. Documentation always rots.”</em></blockquote><p>And honestly, we had good reasons to believe it.</p><p>Requirements changed. Teams moved fast. Documentation became outdated weeks after it was written. Developers learned to trust the source code more than any Confluence page, wiki, or architecture diagram.</p><p>But AI is changing the economics of documentation.</p><p>The old belief that documentation is a liability is becoming increasingly expensive. In the AI era, high-quality documentation is no longer just for humans — it is fuel for intelligent systems.</p><h3>Why “Code is Truth” Worked</h3><p>Traditional software teams faced a painful reality:</p><ul><li>Documentation required manual effort.</li><li>Maintaining docs felt like a second job.</li><li>Outdated documentation was often worse than no documentation.</li><li>Developers naturally gravitated toward reading the code.</li></ul><p>As a result, many organizations adopted an implicit policy:</p><blockquote><em>If you want to know how the system works, read the code.</em></blockquote><p>This worked reasonably well when the primary consumer of knowledge was another developer.</p><p>But today’s consumers are different.</p><h3>AI Doesn’t Read Your Mind</h3><p>Modern AI coding assistants can generate code, explain architectures, create tests, review pull requests, and onboard new developers.</p><p>However, they have one major limitation:</p><p>They only know what they can access.</p><p>The source code tells AI <em>how</em> the system works.</p><p>Documentation tells AI <em>why</em> it works that way.</p><p>Without context, AI often produces technically correct but strategically wrong solutions.</p><p>For example:</p><p>The code may show that a payment service calls three downstream systems.</p><p>The documentation explains:</p><ul><li>Regulatory requirements</li><li>Business constraints</li><li>Security decisions</li><li>Historical trade-offs</li><li>Domain terminology</li><li>Architectural boundaries</li></ul><p>These are things that rarely exist in source code.</p><h3>Documentation Has Become Training Data</h3><p>In the past, documentation was a passive artifact.</p><p>Today, it is active context.</p><p>Every architecture decision record (ADR), API specification, domain model, and business rule can be consumed by AI agents and coding assistants.</p><p>Well-structured documentation enables AI to:</p><ul><li>Generate better code</li><li>Produce more accurate designs</li><li>Reduce hallucinations</li><li>Accelerate onboarding</li><li>Preserve organizational knowledge</li><li>Improve consistency across teams</li></ul><p>The quality of AI output increasingly depends on the quality of organizational knowledge.</p><p>And organizational knowledge lives in documentation.</p><h3>Docs-as-Code Is No Longer Optional</h3><p>The solution is not writing more documents.</p><p>The solution is treating documentation like software.</p><p>This is the essence of Docs-as-Code:</p><ul><li>Version-controlled documentation</li><li>Documentation reviewed through pull requests</li><li>Documentation changes shipped alongside code changes</li><li>Automated validation</li><li>Continuous publishing</li><li>Documentation ownership embedded in development workflows</li></ul><p>When documentation sits next to code, it evolves with the system instead of lagging behind it.</p><h3>The New Engineering Feedback Loop</h3><p>The traditional loop looked like this:</p><p>Code → Deploy → Maintain</p><p>The AI-enabled loop looks different:</p><p>Code → Documentation → AI Context → Better Code</p><p>Documentation is no longer the output of engineering.</p><p>Documentation becomes part of the development pipeline itself.</p><p>Every design decision, business capability, and architectural constraint becomes reusable context for both humans and AI.</p><h3>What High-Performing Teams Will Do</h3><p>The most effective engineering organizations over the next decade will not necessarily be those with the best AI tools.</p><p>They will be those with the best knowledge systems.</p><p>They will:</p><ul><li>Maintain architecture decision records.</li><li>Keep domain knowledge close to the code.</li><li>Document business intent, not only implementation details.</li><li>Build searchable knowledge repositories.</li><li>Treat documentation as a first-class engineering asset.</li></ul><p>Because in an AI-first world, knowledge compounds.</p><p>And the teams that capture knowledge effectively will move faster than those relying solely on source code.</p><h3>Final Thought</h3><p>For years, developers said:</p><blockquote><em>“Code is truth, docs rot.”</em></blockquote><p>In the AI era, a more accurate statement may be:</p><blockquote><em>“Code tells us how. Documentation tells AI why.”</em></blockquote><p>And increasingly, the teams that document their thinking will outperform the teams that only document their code.</p><p>Share your thought with me via <a href="https://www.linkedin.com/in/mahdi-tilab/">https://www.linkedin.com/in/mahdi-tilab/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab301b309de8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an MCP Server with Spring Boot and Spring AI — A Practical Guide]]></title>
            <link>https://mtilab.medium.com/building-an-mcp-server-with-spring-boot-and-spring-ai-a-practical-guide-909596893dda?source=rss-247eceb0317c------2</link>
            <guid isPermaLink="false">https://medium.com/p/909596893dda</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring-ai]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Mahdi Tilab]]></dc:creator>
            <pubDate>Mon, 30 Mar 2026 21:19:48 GMT</pubDate>
            <atom:updated>2026-03-30T21:19:48.207Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N8MSDFsIlYEuc_kPgh8AKg.png" /><figcaption>Building an MCP Server with Spring Boot and Spring AI — A Practical Guide</figcaption></figure><p>I was working with GitHub Copilot CLI as an AI agent to automate some internal workflows at work. At some point I needed the agent to read a Google Slides presentation, create a copy, rewrite it for a new audience, and update it — all without me lifting a finger.</p><p>Sounds simple. But the agent had no way to talk to Google Drive.</p><p>I looked for an existing MCP server. Nothing quite fit. So I built one — using <strong>Spring Boot</strong> and <strong>Spring AI</strong> — and in this article I’ll show you exactly how to do the same for any API you need.</p><p><strong>Model Context Protocol (MCP)</strong> is an open protocol introduced by Anthropic that standardizes how AI models communicate with external tools and data sources. Think of it as a USB-C standard for AI integrations — you build a server once, and any compatible AI client (GitHub Copilot, Claude Desktop, Cursor, VS Code) can use it.</p><p>An MCP server exposes <strong>tools</strong> — functions the AI can call, with typed parameters and descriptions. The AI decides when and how to call them based on the user’s intent.</p><p>The architecture looks like this:</p><pre>User → AI Agent (Copilot / Claude / Cursor) ↕ MCP Protocol MCP Server (your Spring Boot app) ↕ External API (Google Drive, Jira, Slack, etc.)</pre><p>Spring AI added first-class MCP server support via spring-ai-starter-mcp-server. The integration is minimal boilerplate: you annotate plain Java methods with @Tool, Spring AI handles the protocol, JSON schema generation, and STDIO transport automatically.</p><p>No manual JSON-RPC, no schema writing, no protocol plumbing. Just Java.</p><p>Add the Spring AI BOM for version management:</p><p>That’s it for configuration. STDIO transport means the MCP client launches your JAR as a subprocess and communicates via stdin/stdout — no HTTP server needed.</p><p>Here’s the core concept. You create a @Component class, inject your API client, and annotate methods with @Tool:</p><p>Spring AI reads the annotations, generates a JSON schema for the parameters, and registers the tool with the MCP protocol. The AI agent sees the tool name and description and knows when to call it.</p><p>Then register it as a ToolCallbackProvider bean:</p><p>That’s the entire framework. Everything else is just your business logic.</p><p>Let me walk through how I built gdrive-mcp-server - a fully working MCP server that gives AI agents access to Google Drive.</p><p>Google Drive uses OAuth2. I load credentials from a tokens.json file and build the Drive client:</p><p>Updating a Google Doc is straightforward — upload plain text and the Drive API converts it:</p><p>Here’s where it gets interesting. Unlike Docs and Sheets, <strong>the Drive API cannot convert plain text into a Google Slides presentation</strong>. You’ll get a conversionUnsupportedConversionPath error if you try.</p><p>You need the <strong>Google Slides API</strong> and its batchUpdate endpoint, which accepts a list of structured requests. This requires adding a separate dependency:</p><p>The strategy I used:</p><ol><li>Delete all existing slides (except the first — the API requires at least one)</li><li>Create new slides with TITLE_AND_BODY layout</li><li>Re-fetch to get shape IDs</li><li>Insert text into title, body, and notes placeholders</li></ol><p>Here’s the core loop:</p><blockquote><strong><em>Gotcha:</em></strong><em> If a shape has no existing text, </em><em>deleteText with range </em><em>ALL will throw a </em><em>400 Bad Request because </em><em>startIndex == endIndex == 0. Always check for existing text before deleting.</em></blockquote><p>Speaker notes live on a separate notesPage per slide. Each notes page has a BODY placeholder. Writing to it is the same pattern:</p><p>To keep things simple for the AI, I designed a plain text format:</p><pre>Slide Title Slide body content line 1 Slide body content line 2 [notes] Speaker notes go here --- Second Slide Title Second slide body [notes] Notes for second slide</pre><ul><li>--- on its own line separates slides</li><li>[notes] starts the speaker notes section for that slide</li></ul><p>The same format is used for both reading and writing, so the AI can read a presentation, modify it, and write it back in one flow.</p><p>Build the JAR:</p><pre>mvn clean package -DskipTests</pre><p>Add to ~/.copilot/mcp-config.json:</p><p>Add to ~/Library/Application Support/Claude/claude_desktop_config.json:</p><p>Restart the client, and your tools are live. The AI now has Google Drive access.</p><p>Here’s a real example of what became possible once the server was running. I asked Copilot CLI:</p><blockquote>“Read this presentation, create a copy, and rewrite it as a developer onboarding guide.”</blockquote><p>The agent:</p><ol><li>Called read_file to extract all slide content and notes</li><li>Called create_presentation to make a new empty presentation</li><li>Called update_presentation with the rewritten content - 20 slides, structured and formatted</li></ol><p>All in one prompt, no manual steps.</p><p><strong>1. Write clear </strong><strong>@Tool descriptions.</strong> The AI decides when to call your tool based on the description alone. Be explicit about what the tool does, what it accepts, and what it returns.</p><p><strong>2. Not all Google APIs are equal.</strong> The Drive API is great for Docs and Sheets but can’t update Slides. Know the limits of your upstream API before designing your tools.</p><p><strong>3. Guard against API edge cases.</strong> The deleteText bug I hit - failing on empty shapes - is the kind of thing that only surfaces at runtime. Test with both empty and populated resources.</p><p><strong>4. Match your text format to how AIs think.</strong> A simple, consistent plain text format (with clear delimiters like --- and markers like [notes]) is much more reliable than complex JSON for AI-generated content.</p><p><strong>5. STDIO transport is dead simple.</strong> No ports, no HTTP server, no authentication between client and server. The MCP client just spawns your JAR as a subprocess.</p><p>The full project is open source: 👉 <a href="https://github.com/m-tilab/gdrive-mcp-server"><strong>https://github.com/m-tilab/gdrive-mcp-server</strong></a></p><p>It includes all 12 tools, OAuth2 setup instructions, and configuration examples for Copilot CLI, Claude Desktop, VS Code, and Cursor.</p><p>Some ideas I’m considering:</p><ul><li>Adding Google Sheets read support with named range queries</li><li>Supporting file uploads (images, PDFs)</li><li>Slide formatting via the Slides API (fonts, colors, layouts)</li></ul><p>MCP is still young but the ecosystem is growing fast. Building your own server for any internal API — your company’s CRM, your issue tracker, your internal wiki — is now a weekend project.</p><p>What would you build?</p><p><em>Found this useful? Give it a clap and follow for more posts on AI agents, Spring Boot, and developer tooling.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=909596893dda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effortless Local Development with Spring Boot Docker Compose Support]]></title>
            <link>https://mtilab.medium.com/effortless-local-development-with-spring-boot-docker-compose-support-c3f348075794?source=rss-247eceb0317c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3f348075794</guid>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Mahdi Tilab]]></dc:creator>
            <pubDate>Wed, 07 Jan 2026 13:00:26 GMT</pubDate>
            <atom:updated>2026-01-07T16:21:59.966Z</atom:updated>
            <content:encoded><![CDATA[<h3>Effortless Local Development with Spring Boot Docker Compose Support + example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2G5KOQVzqVIbxxxeKECZkA.jpeg" /><figcaption>Docker compose and Spring boot Integration</figcaption></figure><p>Local development often comes with a familiar pain: <strong>managing external services</strong>.<br> Databases, message brokers, caches — all of them need to be installed, configured, started, stopped, and kept in sync with your application.</p><p>Spring Boot introduces a <strong>first-class development-time integration with Docker Compose</strong> that removes most of this friction. In this article, I’ll show how spring-boot-docker-compose helps you stay connected to your containers automatically and focus on coding instead of infrastructure.</p><h3>The Problem with Traditional Local Setup</h3><p>A typical Spring Boot project depends on services like:</p><ul><li>PostgreSQL</li><li>Redis</li><li>Kafka</li><li>MongoDB</li></ul><p>Traditionally, developers have to:</p><ol><li>Install Docker</li><li>Write a compose.yml</li><li>Run docker compose up</li><li>Configure application.yml with ports and credentials</li><li>Remember to stop containers later</li></ol><p>This process is:</p><ul><li>Error-prone</li><li>Easy to forget</li><li>Different for each developer</li></ul><h3>Spring Boot’s Development-time Services</h3><p>Spring Boot introduces <strong>development-time services</strong>, designed specifically for local development.</p><p>Out of the box, Spring Boot supports:</p><ul><li><strong>Docker Compose</strong></li><li><strong>Testcontainers</strong></li></ul><p>These services are:</p><ul><li>Enabled only during development</li><li>Automatically disabled in production</li><li>Fully integrated with Spring Boot’s auto-configuration</li></ul><h3>Adding Docker Compose Support</h3><p>Enabling Docker Compose support is extremely simple.</p><h3>build.gradle</h3><pre>dependencies {<br>    implementation &#39;org.springframework.boot:spring-boot-starter-webmvc&#39;<br>    developmentOnly &#39;org.springframework.boot:spring-boot-docker-compose&#39;<br>    runtimeOnly &#39;org.postgresql:postgresql&#39;<br>}</pre><blockquote><em>💡 The key point:<br> </em><em>spring-boot-docker-compose is marked as </em><strong><em>developmentOnly</em></strong><em>, so it never leaks into production builds.</em></blockquote><h3>Define Your Services Once</h3><p>Place a compose.yaml next to your project.</p><h3>Example: PostgreSQL</h3><pre>services:<br>  postgres:<br>    image: &#39;postgres:latest&#39;<br>    environment:<br>      - &#39;POSTGRES_DB=mydatabase&#39;<br>      - &#39;POSTGRES_PASSWORD=secret&#39;<br>      - &#39;POSTGRES_USER=myuser&#39;<br>    ports:<br>      - &#39;5432&#39;</pre><p>That’s it. No port guessing. No manual startup.</p><h3>What Happens When You Start the Application?</h3><p>When you run your Spring Boot application, Spring does the following <strong>automatically</strong>:</p><ol><li>Detects compose.yaml</li><li>Runs docker compose up</li><li>Waits until containers are healthy</li><li>Creates <strong>service connection beans</strong></li><li>Injects correct connection details</li><li>Starts your application</li><li>Stops containers when the app shuts down (by default)</li></ol><p>From your logs:</p><pre>Using Docker Compose file compose.yaml<br>Container postgres-1 Starting<br>Container postgres-1 Healthy</pre><p>No extra commands needed.</p><h3>Zero Configuration for Database Connections</h3><p>Spring Boot identifies services by <strong>container image name</strong>.</p><p>Because your container uses postgres, Spring Boot automatically creates a JdbcConnectionDetails bean.</p><p>That means:</p><ul><li>No spring.datasource.url</li><li>No hardcoded ports</li><li>No environment-specific config</li></ul><p>Spring Boot discovers the <strong>mapped port dynamically</strong> and wires it correctly.</p><p>Your application just works.</p><h3>Why This Is a Big Deal</h3><h3>✅ Faster Onboarding</h3><p>New developers clone the repo and run the app — no setup docs required.</p><h3>✅ No Port Conflicts</h3><p>Docker Compose can use random local ports. Spring Boot adapts automatically.</p><h3>✅ Production-like Environment</h3><p>You use real services, not mocks or embedded databases.</p><h3>✅ Clean Separation</h3><p>Development tooling stays out of production artifacts.</p><h3>✅ IDE-Friendly</h3><p>Just press <strong>Run</strong> in IntelliJ. Containers start with your app.</p><h3>Lifecycle Control (Optional)</h3><p>You can customize container behavior:</p><pre>spring.docker.compose.lifecycle-management=start-and-stop<br>spring.docker.compose.stop.command=down<br>spring.docker.compose.stop.timeout=1m</pre><p>Or disable lifecycle management entirely:</p><pre>spring.docker.compose.lifecycle-management=none</pre><h3>Docker Compose vs Testcontainers</h3><p><strong>Docker Compose vs Testcontainers</strong></p><p><strong>Docker Compose</strong></p><ul><li>YAML-based configuration</li><li>Great for team-wide local development</li><li>Uses shared service containers</li><li>Very fast startup</li></ul><p><strong>Testcontainers</strong></p><ul><li>Java-based configuration</li><li>Ideal for tests and isolated environments</li><li>Uses isolated containers per test or setup</li><li>Highly flexible</li></ul><p>Spring Boot supports <strong>both</strong>, and you can even mix them.</p><h3>When Should You Use This?</h3><p>spring-boot-docker-compose is perfect if:</p><ul><li>Your app depends on external services</li><li>You want zero-config local setup</li><li>You value fast feedback loops</li><li>You want consistent environments across the team</li></ul><h3>Final Thoughts</h3><p>Spring Boot’s Docker Compose support is not just a convenience — it’s a <strong>developer productivity feature</strong>.</p><p>By letting Spring Boot manage containers at development time, you:</p><ul><li>Write less configuration</li><li>Avoid environment drift</li><li>Focus on business logic</li></ul><p>If you’re using Spring Boot and Docker, this should be your default choice for local development.</p><p>Also, you can find sample repo here: <a href="https://github.com/m-tilab/spring-boot-docker-compose-support-postgres">https://github.com/m-tilab/spring-boot-docker-compose-support-postgres</a></p><p>Happy coding! ☕🐳🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3f348075794" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transactional Pub/Sub in Spring for Multi-Instance, Production-Grade Systems]]></title>
            <link>https://mtilab.medium.com/transactional-pub-sub-in-spring-for-multi-instance-production-grade-systems-7eaac2b6894b?source=rss-247eceb0317c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7eaac2b6894b</guid>
            <category><![CDATA[outbox-pattern]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[pubnub]]></category>
            <dc:creator><![CDATA[Mahdi Tilab]]></dc:creator>
            <pubDate>Sun, 30 Nov 2025 19:48:19 GMT</pubDate>
            <atom:updated>2025-11-30T19:48:19.710Z</atom:updated>
            <content:encoded><![CDATA[<p>When building distributed systems with Spring Boot, one recurring challenge appears sooner or later:</p><blockquote><strong><em>How do we publish and consume events in a way that is consistent with database transactions, especially when the system runs on multiple instances?</em></strong></blockquote><p>In simple setups, sending a message after saving something in the database seems fine. But in real-world, multi-instance microservice environments, this can easily lead to inconsistent data, lost messages, or duplicate events.</p><p>This article breaks down:</p><ul><li>What “transactional pub/sub” really means</li><li>The safest patterns in multi-instance systems</li><li>Which solutions work at scale</li><li>What you <em>should</em> use in production with Spring</li></ul><h3>The Core Problem</h3><p>Consider this common code:</p><pre>@Transactional<br>public void createOrder(Order order) {<br>    orderRepository.save(order);<br>    publisher.publish(new OrderCreatedEvent(order));<br>}</pre><p>Here is the risk:</p><ol><li>The message is published ✅</li><li>The database transaction fails and rolls back ❌</li><li>Now other services think the order exists, but it doesn’t</li></ol><p>This breaks the fundamental principle of <strong>data consistency</strong>.</p><p>We need a way to ensure:</p><blockquote><em>The message is </em><strong><em>only published if and when</em></strong><em> the database transaction is committed successfully.</em></blockquote><p>That is where transactional pub/sub comes in.</p><h3>Solution 1 — @TransactionalEventListener (Local only)</h3><p>Spring provides a powerful but often misunderstood feature:</p><pre>@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)</pre><p>Example:</p><h3>Publisher</h3><pre>@Transactional<br>public void createOrder(Order order) {<br>    orderRepository.save(order);<br>    applicationEventPublisher.publishEvent(new OrderCreatedEvent(order));<br>}</pre><h3>Listener</h3><pre>@Component<br>public class OrderListener {</pre><pre>    @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)<br>    public void handle(OrderCreatedEvent event) {<br>        System.out.println(&quot;Order successfully committed: &quot; <br>            + event.getOrder().getId());<br>    }<br>}</pre><p>This guarantees:</p><p>✅ Event is fired only after commit<br> ❌ No event if rollback occurs</p><p><strong>However:</strong></p><p>This mechanism is <strong>only local to that Spring instance</strong>.</p><p>If you run 10 instances of this app:</p><ul><li>Each instance receives only <em>its own</em> events</li><li>There is <strong>no inter-instance communication</strong></li></ul><h3>Use this when:</h3><ul><li>You need in-process consistency</li><li>For cache updates, audit logs, metrics, internal workflows</li></ul><h3>Do NOT use this for:</h3><ul><li>Microservice-to-microservice messaging</li><li>Multi-node coordination</li><li>Integration events for other systems</li></ul><h3>Solution 2 — The Transactional Outbox Pattern (BEST)</h3><p>The <strong>Transactional Outbox Pattern</strong> is the industry-proven solution for transactional messaging in distributed systems.</p><p>Instead of publishing directly to Kafka, SQS, or RabbitMQ, we write the event to an outbox table inside the <strong>same database transaction</strong>.</p><pre>@Transactional<br>public void createOrder(Order order) {<br>    orderRepository.save(order);</pre><pre>    OutboxEvent event = new OutboxEvent(<br>        &quot;ORDER_CREATED&quot;,<br>        convertToJson(order)<br>    );</pre><pre>    outboxRepository.save(event);<br>}</pre><p>Now there is <strong>only one truth: the database</strong>.</p><p>After commit, a separate process publishes messages from the Outbox.</p><h3>Publishing strategies:</h3><h4>Option A — Polling worker (recommended)</h4><p>A background job runs:</p><pre>SELECT * <br>FROM outbox <br>WHERE published = false<br>FOR UPDATE SKIP LOCKED<br>LIMIT 100;</pre><p>Then it:</p><ol><li>Sends the event to Kafka/SQS/SNS</li><li>Marks it as published = true</li></ol><p>This is <strong>100% safe for multi-instance setups</strong> because:</p><ul><li>SKIP LOCKED prevents double processing</li><li>All services share one DB</li><li>No race conditions</li><li>No duplicates</li></ul><p>✅ Kubernetes safe<br> ✅ Multi-replica safe<br> ✅ Cloud-native</p><h4>Option B — CDC with Debezium (enterprise scale)</h4><p>Instead of polling:</p><ul><li>Debezium listens to DB commit log</li><li>Streams changes to Kafka</li><li>Kafka distributes to consumers</li></ul><p>This is what companies like Netflix, Uber, and Airbnb use.</p><h3>Solution 3 — Kafka Transactions (Advanced &amp; risky)</h3><p>Kafka supports transactions:</p><pre>spring.kafka.producer.transaction-id-prefix=tx-</pre><pre>@Transactional<br>public void createOrder(Order order) {<br>   orderRepository.save(order);<br>   kafkaTemplate.send(&quot;orders&quot;, order);<br>}</pre><p>But in multi-instance environments:</p><ul><li>Each producer must have unique IDs</li><li>Fencing issues can occur</li><li>Failed instances can block partitions</li><li>Hard to operate &amp; debug</li></ul><p>✅ Works<br> ❌ Complex<br> ❌ Not recommended for most systems</p><p>The <strong>Outbox Pattern</strong> is simply better.</p><h3>Does This Work in Multi-Instance Setups?</h3><p>Here is the honest answer:</p><p>Pattern Multi-instance safe? Recommended TransactionalEventListener ❌ (local only) For internal only Kafka Transactions ⚠️ (fragile) Rarely Outbox Pattern ✅✅✅ <strong>BEST</strong> Debezium (CDC) ✅✅✅✅✅ For scale</p><p>If you run:</p><ul><li>Multiple pods in Kubernetes</li><li>Docker Swarm</li><li>AWS ECS / EKS</li><li>Multiple Spring Boot nodes</li></ul><p><strong>You want the Outbox pattern.</strong></p><h3>Final Architecture (Production Ready)</h3><pre>[ Spring Boot — Multiple Instances ]<br>     |<br>     |   ( single transaction )<br>     V<br>[ Database + Outbox Table ]<br>     |<br>     |   (Publisher / CDC / Poller)<br>     V<br>[ Kafka / SNS / SQS ]<br>     |<br>     V<br>[ Downstream Services ]</pre><p>This architecture guarantees:</p><p>✅ Strong consistency<br> ✅ No data loss<br> ✅ No double sending<br> ✅ Multi-instance safety<br> ✅ Fully scalable</p><p>Perfect for:</p><ul><li>Microservices</li><li>Event-driven systems</li><li>Payment systems</li><li>Airline / booking / fintech systems</li></ul><h3>Conclusion</h3><p>If you’re using Spring Boot and care about consistency in distributed systems:</p><blockquote><strong><em>Use the Transactional Outbox pattern.</em></strong></blockquote><p>Not only is it the safest solution — it’s the same pattern used by the biggest technology companies in the world.</p><p>If you are serious about production-grade architecture in Spring, this is a must-have in your toolbox.</p><p>If you’d like, next I can provide you with:</p><p>✅ Full Spring Boot code<br> ✅ Outbox entity &amp; schema<br> ✅ Multi-instance safe scheduler<br> ✅ Kafka &amp; AWS SQS versions<br> ✅ Architecture diagram image for Medium</p><p>Just reply with: <strong>“Give me the code version”</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7eaac2b6894b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Declarative REST Clients with Spring Boot 4 / Spring Framework 7]]></title>
            <link>https://blog.stackademic.com/declarative-rest-clients-with-spring-framework-7-31eaba02d004?source=rss-247eceb0317c------2</link>
            <guid isPermaLink="false">https://medium.com/p/31eaba02d004</guid>
            <category><![CDATA[spring-framework]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot-4]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Mahdi Tilab]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 10:31:26 GMT</pubDate>
            <atom:updated>2025-07-30T05:35:51.529Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Declarative REST Clients with Spring Framework 7" src="https://cdn-images-1.medium.com/max/1024/1*W9FvfiYNsabMzLy9scUEMQ.jpeg" /></figure><p>In the ever-evolving world of Spring Boot, working with HTTP clients has become progressively more powerful, clean, and declarative. As of Spring Framework 6 and Spring Boot 3, there are three distinct ways to make HTTP requests, each offering different levels of abstraction and convenience:</p><ul><li>Using RestClient (Spring Framework 6.1+)</li><li>Using a Declarative HTTP Interface (Spring Framework 6.0+)</li><li>Using @ImportHttpServices (Spring Framework 7+ / Spring Boot 4+)</li></ul><p>In this article, we’ll walk through each of these generations using the same API — the <a href="https://jsonplaceholder.typicode.com/">JSONPlaceholder</a> fake user service — and explore how Spring Boot’s HTTP client capabilities have matured.</p><h3>🌱 1st Generation: Using RestClient – A Modern RestTemplate Replacement</h3><p>Spring Framework 6 introduced the RestClient as a modern alternative to the legacy RestTemplate. It’s fluent, easier to test, and aligns with recent design trends.</p><h3>Data Model</h3><p>Let’s define the model classes to represent the JSONPlaceholder /users API:</p><pre>public record User(<br>    Integer id,<br>    String name,<br>    String username,<br>    String email,<br>    Address address,<br>    String phone,<br>    String website,<br>    Company company<br>) {}<br>public record Address(String street, String suite, String city, String zipcode, Geo geo) {}<br>public record Geo(Double lat, Double lng) {}<br>public record Company(String name, String catchPhrase, String bs) {}</pre><h3>RestClient Wrapper</h3><pre>@Component<br>public class UserRestClient {<br>    private final RestClient restClient;<br>    public UserRestClient(RestClient.Builder builder) {<br>        this.restClient = builder<br>                .baseUrl(&quot;https://jsonplaceholder.typicode.com&quot;)<br>                .build();<br>    }<br>    public List&lt;User&gt; getUsers() {<br>        return restClient.get()<br>                .uri(&quot;/users&quot;)<br>                .retrieve()<br>                .body(new ParameterizedTypeReference&lt;&gt;() {});<br>    }<br>    public User getUserById(Integer id) {<br>        return restClient.get()<br>                .uri(&quot;/users/{id}&quot;, id)<br>                .retrieve()<br>                .body(User.class);<br>    }<br>}</pre><h3>Exposing an Endpoint</h3><pre>@RestController<br>@RequestMapping(&quot;/users&quot;)<br>public class UserController {<br>    private final UserRestClient userRestClient;<br>    <br>    public UserController(UserRestClient userRestClient) {<br>        this.userRestClient = userRestClient;<br>    }<br>    @GetMapping(&quot;&quot;)<br>    public List&lt;User&gt; getUsers() {<br>        return userRestClient.getUsers();<br>    }<br>    @GetMapping(&quot;/{id}&quot;)<br>    public User getUserById(@PathVariable Integer id) {<br>        return userRestClient.getUserById(id);<br>    }<br>}</pre><p>✅ This solution is clean and fluent, and ideal if you want more control over the underlying request logic.</p><h3>🧩 2nd Generation: Declarative HTTP Client Using HttpServiceProxyFactory</h3><p>Spring 6 makes it even easier to define HTTP clients by simply declaring interfaces — similar to how Feign works.</p><h3>Declarative Interface</h3><pre>public interface UserHttpClient {<br>    @GetExchange(&quot;/users&quot;)<br>    List&lt;User&gt; getUsers();<br>    @GetExchange(&quot;/users/{id}&quot;)<br>    User getUserById(@PathVariable Integer id);<br>}</pre><h3>Configuration Class</h3><pre>@Configuration<br>public class HttpClientConfiguration {<br>    @Bean<br>    RestClient.Builder restClient() {<br>        return RestClient.builder();<br>    }<br>    @Bean<br>    UserHttpClient userHttpClient(RestClient.Builder builder) {<br>        RestClient restClient = builder<br>                .baseUrl(&quot;https://jsonplaceholder.typicode.com&quot;)<br>                .build();<br>        HttpServiceProxyFactory factory = HttpServiceProxyFactory<br>                .builderFor(RestClientAdapter.create(restClient))<br>                .build();<br>        return factory.createClient(UserHttpClient.class);<br>    }<br>}</pre><h3>Controller</h3><pre>@RestController<br>@RequestMapping(&quot;/users/httpclient&quot;)<br>public class UserHttpClientController {<br><br>    private final UserHttpClient userHttpClient;<br>    public UserHttpClientController(UserHttpClient userHttpClient) {<br>        this.userHttpClient = userHttpClient;<br>    }<br>    @GetMapping(&quot;&quot;)<br>    public List&lt;User&gt; getUsers() {<br>        return userHttpClient.getUsers();<br>    }<br>    @GetMapping(&quot;/{id}&quot;)<br>    public User getUserById(@PathVariable Integer id) {<br>        return userHttpClient.getUserById(id);<br>    }<br>}</pre><p>✅ A major win here is the reduction of boilerplate and configuration. You define your client contract and Spring generates the implementation.</p><h3>🚀 3rd Generation: Declarative HTTP Clients with @ImportHttpServices introduced in Spring Framework 7</h3><p>Starting from <strong>Spring Framework 7</strong> (Spring Boot 4), you can simplify things even more by letting Spring automatically scan and register your declarative interfaces using the powerful @ImportHttpServices annotation.</p><h3>Update Your Configuration</h3><p>You no longer need to manually create your proxy bean:</p><pre>@Configuration<br>@ImportHttpServices(<br>    group = &quot;users&quot;,<br>    basePackages = &quot;com.example.declarativeinterfacehttpclient.httpclient&quot;<br>)<br>public class HttpClientConfiguration {<br>  @Bean<br>    RestClient.Builder restClient() {<br>        return RestClient.builder();<br>    }<br>}</pre><p>The UserHttpClient interface remains the same. Spring will automatically detect and register it using the group and base package.</p><p>This makes the code:</p><ul><li>Even more concise</li><li>More aligned with annotation-driven development</li><li>Easier to maintain in large-scale applications</li></ul><h3>💬 Final Thoughts</h3><p>Spring’s HTTP client evolution reflects a clear trend: <strong>toward more declarative, concise, and maintainable code</strong>. Each generation serves its purpose — from hands-on control with RestClient to fully declarative services that Spring auto-discovers for you.</p><p>If you’re starting a new Spring Boot 4+ project, give @ImportHttpServices a try. It’s powerful, clean, and perfectly suited for modern REST-based microservices.</p><h3>📦 Sample Project</h3><p>You can find the source code for all three generations in this <a href="https://github.com/m-tilab/declarative-interface-http-client">GitHub repository</a>.</p><p><em>Written by Mahdi Tilab, a Java/Spring enthusiast exploring the cleanest ways to build modern backends. If you enjoyed this, follow me for more Spring tips and architecture write-ups!</em></p><p>Also, I am looking for a new opportunity. Look over <a href="https://www.linkedin.com/in/mahdi.tilab">my LinkedIn</a> if you are a Tech recruiter.</p><p>Good Luck! :-)</p><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏️<strong>️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/@InPlainEnglish"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a> | <a href="https://twitch.tv/inplainenglish"><strong>Twitch</strong></a></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31eaba02d004" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/declarative-rest-clients-with-spring-framework-7-31eaba02d004">Declarative REST Clients with Spring Boot 4 / Spring Framework 7</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is an OpenTelemetry-powered observability solution?]]></title>
            <link>https://blog.stackademic.com/what-is-an-opentelemetry-powered-observability-solution-008789b1adeb?source=rss-247eceb0317c------2</link>
            <guid isPermaLink="false">https://medium.com/p/008789b1adeb</guid>
            <category><![CDATA[observability]]></category>
            <dc:creator><![CDATA[Mahdi Tilab]]></dc:creator>
            <pubDate>Thu, 10 Oct 2024 08:59:44 GMT</pubDate>
            <atom:updated>2024-10-10T11:06:03.723Z</atom:updated>
            <content:encoded><![CDATA[<p>An <strong>OpenTelemetry-powered observability solution</strong> refers to using the <strong>OpenTelemetry</strong> project as the foundation for implementing observability across distributed systems. OpenTelemetry is an open-source framework that provides tools, APIs, and SDKs for generating, collecting, and exporting telemetry data (metrics, logs, and traces) from applications and systems to be monitored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n840mDSb2wQ_h0vE29_PpA.png" /></figure><h3>Key Components of OpenTelemetry:</h3><p><strong>1. Tracing</strong>: Tracks the flow of requests through a distributed system by capturing spans and traces, allowing you to understand how different services interact.<br><strong>2. Metrics</strong>: Provides data about system performance, such as request rates, error rates, and latency, which are crucial for monitoring the health of an application.<br><strong>3. Logs</strong>: Captures event data that can provide insights into system behavior or failures.</p><h3>Why OpenTelemetry-Powered Observability?</h3><p><strong>1. Vendor-Neutral:</strong> OpenTelemetry is cloud-agnostic and allows exporting data to various backends, making it flexible for different observability tools like Prometheus, Grafana, Jaeger, Zipkin, etc.<br><strong>2. Unified Telemetry:</strong> It standardizes telemetry data (logs, metrics, traces), which makes it easier to monitor distributed applications from a single point, reducing tool fragmentation.<br><strong>3. End-to-End Visibility: </strong>By providing a unified way to collect and correlate traces, logs, and metrics, OpenTelemetry allows teams to get a complete view of their system’s health and performance.<br><strong>4. Integration with Modern Architectures:</strong> OpenTelemetry is designed for microservices and cloud-native environments, making it ideal for modern application architectures like Kubernetes and serverless computing.</p><h3>Example Workflow:</h3><p><strong>1. Instrumentation:</strong> Developers instrument their applications using OpenTelemetry SDKs (for Java, Python, etc.) to generate traces, metrics, and logs.<br><strong>2. Exporting Telemetry:</strong> The collected telemetry data is exported to a back-end observability platform (like Prometheus, Jaeger, or a cloud-based service such as AWS X-Ray or Azure Monitor).<br><strong>3. Visualization &amp; Alerts:</strong> Observability platforms then visualize the data, set up alerts, and provide dashboards for monitoring application performance.</p><p>This makes OpenTelemetry a critical part of building a robust observability solution for large-scale, distributed systems.</p><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a> | <a href="https://cofeed.app/"><strong>CoFeed</strong></a> | <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=008789b1adeb" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/what-is-an-opentelemetry-powered-observability-solution-008789b1adeb">What is an OpenTelemetry-powered observability solution?</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up OWASP Dependency Check in a Gradle or Maven Project]]></title>
            <link>https://mtilab.medium.com/setting-up-owasp-dependency-check-in-a-gradle-or-maven-project-7d084ab7a7e4?source=rss-247eceb0317c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d084ab7a7e4</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[maven]]></category>
            <dc:creator><![CDATA[Mahdi Tilab]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 09:40:10 GMT</pubDate>
            <atom:updated>2024-10-01T01:38:12.369Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is OWASP?</h3><p>OWASP stands for Open Web Application Security Project, a non-profit foundation dedicated to improving the security practices of applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RBkTqlyTBlp9zDjRDFh7Tg.png" /></figure><h3>What is OWASP Dependency Check?</h3><p>OWASP Dependency Check is a Software Composition Analysis tool that can be integrated into your project. It checks all dependencies for vulnerabilities and reports them, allowing you to identify and address security gaps introduced by external dependencies. However, it only reports vulnerabilities; addressing them is your responsibility.</p><h3>Setting up OWASP Dependency Check in a Gradle Project</h3><p>Dependency Check is available as a plugin in the Maven repository. To add it to your Gradle project, insert the following code into your build.gradle file and synchronize the project:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ddbe69913fedf20842120dcb581b29bf/href">https://medium.com/media/ddbe69913fedf20842120dcb581b29bf/href</a></iframe><p>Replace `{Plugin-version}` with the latest version available, which you can find on the Maven repository or Gradle plugins page.</p><p>To fail the build if any dependency has a Vulnerability Score CVSS greater than 8 (a common threshold), add failBuildOnCVSS property.</p><p>for your maven, add the bellow snippet tags in pom.xml.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47188e54a1be1794e9caeabf47d0b7f3/href">https://medium.com/media/47188e54a1be1794e9caeabf47d0b7f3/href</a></iframe><p>You can include additional properties as needed, such as cveValidForHours, skip, junitFailOnCVSS, etc.</p><p>To check if the build passes, run the dependencyCheckAnalyze task in the terminal:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52726bd46f87eec0504c115cd9f600f1/href">https://medium.com/media/52726bd46f87eec0504c115cd9f600f1/href</a></iframe><p>If the build succeeds, it indicates there are no critical vulnerabilities.<br>Add it to your CI/CD as a stage and task!</p><p>Good Luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d084ab7a7e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[23 Notes to Learn Kotlin for Experienced Java Developers]]></title>
            <link>https://blog.stackademic.com/23-notes-to-learn-kotlin-for-experienced-java-developers-80fecb7f440a?source=rss-247eceb0317c------2</link>
            <guid isPermaLink="false">https://medium.com/p/80fecb7f440a</guid>
            <category><![CDATA[crash-course]]></category>
            <category><![CDATA[syntax]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[kotlinlearning]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Mahdi Tilab]]></dc:creator>
            <pubDate>Thu, 09 Nov 2023 12:24:06 GMT</pubDate>
            <atom:updated>2023-11-13T09:41:49.879Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I have been improving my knowledge for some Interviews. Some companies use Kotlin instead of Java. JetBrains developed Kotlin which is mostly used for Android development.</p><figure><img alt="Kotlin for experiences Java Developers" src="https://cdn-images-1.medium.com/max/1024/1*qdZQwtBYu3tJpPDqRqnz_A.jpeg" /></figure><p>In this article, I tried to collect some useful information on to how switch to Kotlin for experienced Java developers to look at it and easily and fast learn Kotlin syntax:</p><pre>fun main() {<br>    // 1. Kotlin doesn&#39;t need to class definition<br>    // 2. semicolon is not mandatory<br>    // 3. If we don&#39;t have any argument we can omit it<br>    println(&quot;Hello World&quot;)<br><br>    // 4. val is equals to final in java and its immutable <br>    // we can&#39;t assign value more than one<br>    val name = &quot;kotlin&quot;<br>    var lang = &quot;java&quot;<br><br>    // 5. var is mutable<br>    lang = &quot;js&quot;;<br><br>    // 6. Kotlin same as Java support type inference which means<br>    // we don&#39;t need to specify the type of variable, <br>    // and it can differ from the context<br><br>    // 7. To specify the variable type, we can add it front of <br>    // variable name with a colon (:)<br>    val lastname: String = &quot;lastname&quot;<br><br>    // 8. By default, Kotlin is null safety which means we cannot assign <br>    // null to a variable<br>    var notNullable: String = &quot;nullable&quot;;<br>    // nullable = null;<br><br>    // 9. If we want to assign null, we can add question mark (?) <br>    // after variable type<br>    var nullable: String? = &quot;nullable&quot;<br>    nullable = null;<br><br>    // 10. String templates: in Kotlin, we can use dollar sign ($) <br>    // as prefix to use variable in your String literals<br>    println(&quot;Hello, $lang&quot;);<br><br>    // 11. String templates: To do some logic we can use braces<br>    println(&quot;Hello, ${1 + 2}&quot;);<br><br>    // 12. create Array<br>    val arr = arrayOf(1, 2, 3)<br>    println(arr[0])<br><br>    // 13. specified IntArray | ShortArray | LongArray<br>    var intArr: IntArray = intArrayOf(1, 2, 3)<br><br>    // 14. readline from console<br>    val age = Integer.valueOf(readLine())<br><br>    // 15. Return result of condition to a variable<br>    val result = if (age &gt;= 21) &quot;You are allow to Drink!&quot; <br>      else &quot;You are not allow to Drink&quot;<br>    println(result)<br><br>    // 16. when expression same as switch in Java<br>    print(&quot;Which day is today?&quot;)<br>    var day = readLine()<br><br>    val food = when (day) {<br>        &quot;Monday&quot;, &quot;Wednesday&quot; -&gt; &quot;Chicken&quot;<br>        &quot;Friday&quot; -&gt; &quot;Bacon&quot;<br>        else -&gt; &quot;Pizza&quot;<br>    }<br>    println(food);<br><br>    // 17. When without argument<br>    val food2 = when {<br>        day == &quot;Monday&quot; -&gt; &quot;Chicken&quot;<br>        day == &quot;Friday&quot; -&gt; &quot;Bacon&quot;<br>        else -&gt; &quot;Pizza&quot;<br>    }<br>    println(food2);<br><br>    // 18. for loops difference in Java<br>    val list = listOf&lt;String&gt;(&quot;Kotlin&quot;, &quot;Java&quot;, &quot;Python&quot;, &quot;C++&quot;)<br>    val map = mapOf(1 to &quot;Kotlin&quot;, 2 to &quot;Java&quot;, 3 to &quot;Python&quot;, 4 to &quot;C++&quot;)<br><br>    for (a in intArr) {<br>        print(a)<br>    }<br><br>    for (a in list) {<br>        print(a)<br>    }<br><br>    for ((key, value) in map) {<br>        print(&quot;$key =&gt; $value&quot;)<br>    }<br>    // 19. loop 1 to 9 (contain 1 and 9) using double dot (..)<br>    for (i in 1..9) {<br>        print(i)<br>    }<br><br>    // 20. loop 1 to 9 (contain only 1) using until keyword<br>    for (i in 1 until 9) {<br>        print(i)<br>    }<br><br>    // 21. loop 1 to 9 (contain only 1) using until keyword with <br>    // step 2 (every other number)<br>    for (i in 1 until 9 step 2) {<br>        print(i)<br>    }<br><br>    // 22. Countdown loop 9 to 1 (contain 1 and 9) using downTo keyword<br>    for (i in 9 downTo 1) {<br>        print(i)<br>    }<br><br>    // 23. Extension function can allow you to add a new functionality <br>    // to current classes (Kotlin or Java SDK)<br>    // In bellow example, getEmotion function extended String Class<br>    fun String.getEmotion(): String {<br><br>        return when {<br>            last() == &#39;!&#39; -&gt; &quot;Exciting&quot;<br>            last() == &#39;?&#39; -&gt; &quot;Curious&quot;<br>            else -&gt; &quot;Calm&quot;<br>        }<br>    }<br><br>    val s = &quot;How are you?&quot;<br>    println(s.getEmotion())<br>}<br></pre><p>I put all the notes inside the code. If you are not feel free to let me know!</p><p>Good Luck!</p><h3>Stackademic</h3><p><em>Thank you for reading until the end. Before you go:</em></p><ul><li><em>Please consider </em><strong><em>clapping</em></strong><em> and </em><strong><em>following</em></strong><em> the writer! 👏</em></li><li><em>Follow us on </em><a href="https://twitter.com/stackademichq"><strong><em>Twitter(X)</em></strong></a><em>, </em><a href="https://www.linkedin.com/company/stackademic"><strong><em>LinkedIn</em></strong></a><em>, and </em><a href="https://www.youtube.com/c/stackademic"><strong><em>YouTube</em></strong></a><strong><em>.</em></strong></li><li><em>Visit </em><a href="http://stackademic.com/"><strong><em>Stackademic.com</em></strong></a><em> to find out more about how we are democratizing free programming education around the world.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80fecb7f440a" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/23-notes-to-learn-kotlin-for-experienced-java-developers-80fecb7f440a">23 Notes to Learn Kotlin for Experienced Java Developers</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>