<?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 Suchak Jani on Medium]]></title>
        <description><![CDATA[Stories by Suchak Jani on Medium]]></description>
        <link>https://medium.com/@suchakjani?source=rss-40dab14536f6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*JZLpXPUXbCVODWyy.</url>
            <title>Stories by Suchak Jani on Medium</title>
            <link>https://medium.com/@suchakjani?source=rss-40dab14536f6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 01:39:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@suchakjani/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[Your ClientHello Just Got Fat, and Nobody Warned the Firewalls]]></title>
            <link>https://suchakjani.medium.com/your-clienthello-just-got-fat-and-nobody-warned-the-firewalls-2a171ca42ea6?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a171ca42ea6</guid>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[post-quantum-cryptography]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Fri, 02 Oct 2026 20:50:02 GMT</pubDate>
            <atom:updated>2026-10-02T20:50:02.153Z</atom:updated>
            <content:encoded><![CDATA[<p><em>OpenSSL 3.5 and Java 27 now prefer hybrid post quantum key exchange out of the box. Wherever both ends of your wire run them, the cryptography is ready. Your network path probably is not.</em></p><h3>The Clock Already Ran Out on Harvest Now, Decrypt Later</h3><p>For years, post quantum cryptography(pqc) sat in the same mental folder as asteroid insurance: real, eventually, someone else’s problem for now. That framing was always wrong. This year it became dangerous.</p><h4><strong>The PQC Issue</strong></h4><p>Here is the mechanism, stated plainly. An adversary does not need a working quantum computer today to steal your data today. They need storage. TLS traffic protected only by classical key exchange, ECDH or RSA without a quantum resistant component, can be captured in transit right now and archived. It sits there, encrypted and useless, until a cryptanalytically relevant machine exists to open it. Harvest now, decrypt later is not a future threat model. It is a present tense exfiltration strategy with a delayed payoff, and the delay is the entire point.</p><p>Now ask the uncomfortable question. How long does your data need to stay secret? A patient’s health record: often decades. A financial ledger entry tied to an ongoing audit. A merger term sheet. Corporate IP that took six years to build. You can rotate a password before lunch. You cannot protect a health diagnosis which could be decrypted later if action is not taken.</p><h3>The New Defaults: OpenSSL 3.5 at the Edge, Java 27 in the Core</h3><p>Here’s the thing that caught my attention: something quite structural shifted in TLS, and it didn’t wait for anyone’s mandate. Back in April 2025, OpenSSL 3.5 (an LTS release) changed its defaults to prefer hybrid post-quantum groups, sending X25519MLKEM768 alongside plain X25519 as its key shares. Since that’s the library sitting under many nginx and HAProxy builds, and under plenty of appliances too, an edge that re-encrypts traffic to your backends now plays both roles: server to your users, client to your services. Rebuild on a newer base image or move to a distro release that ships 3.5, and the preference changes. Nobody files a change request for a default. Then on 15 September 2026, the other half arrived. Java 27 shipped JEP 527, bringing hybrid post-quantum key exchange for TLS 1.3 straight into javax.net.ssl, with X25519MLKEM768 at the front of the default list. No bolt-on provider, no code changes, just the new behaviour out of the box for anything using the JDK’s built-in TLS stack, as long as nobody has pinned the group list. And that’s the catch on both sides. A hardened nginx config with ssl_ecdh_curve, a HAProxy curves line, or a JVM started with jdk.tls.namedGroups will all override the new defaults, and plenty of copy-and-paste hardening guides set exactly those.</p><p>I want to be honest about the bigger picture, though. Java 27 isn’t an LTS release, most enterprise fleets still run LTS versions, and lots of edges are still on older OpenSSL builds because that’s what their distro or vendor ships. So right now this lives in the services that upgrade early, with LTS backports likely to follow, and that actually makes things harder rather than easier. Oracle has already published its backport timeline: JDK 25 with the October 2026 patch update, JDK 21 and 17 in the first half of 2027, and JDK 8 and 11 not until the second half. Hence we won’t get one tidy change window where everything breaks together. We’ll get scattered failures, one upgraded peer at a time, that look completely unrelated to each other. Edge first, core seventeen months later. Where both ends are current, the path from browser to JVM can now be quantum-resistant end to end, which is genuinely good news for confidentiality, the very thing “harvest now, decrypt later” goes after. But authentication still rests on classical certificates. And when it does go wrong, it’s a failure mode nobody really owns, because two ecosystems shipped two defaults without ever testing them against your network.</p><h3>Why the Hybrid Matters</h3><p>You might be wondering why hybrid rather than going pure post-quantum, and the honest answer is that neither bet is safe on its own. Classical elliptic curve cryptography has decades of cryptanalysis behind it, but it falls apart completely against a capable quantum machine. Lattice-based schemes like ML-KEM are believed to resist quantum attacks, yet they’re young; NIST only finalised ML-KEM as FIPS 203 in August 2024, and young cryptography has occasionally had some bad decades. The hybrid construction sidesteps that by deriving the shared secret from X25519 and ML-KEM-768 together, so an attacker has to break both elliptic curve discrete log and module learning with errors. If either one holds, the session holds. I’d stress that this isn’t indecision dressed up as strategy. For a general enterprise, it’s the most defensible way to deploy quantum resistance before the new maths has earned its reputation (some government profiles are moving straight to pure ML-KEM, but most of us aren’t in that position). And the cost is widely misunderstood: ML-KEM-768 runs in tens of microseconds on commodity silicon, roughly on par with X25519, so most likely the real price you pay is in bytes, not cycles. See The NIST workshop paper in references below.</p><h3>What Can Break: The Operational Reality Check</h3><p>So why does any of this matter on the wire? <strong>Size</strong>. The hybrid key share alone is 1,216 bytes (a 1,184-byte ML-KEM public key plus the 32-byte X25519 share), and once you add the standalone x25519 share and the usual extensions, a ClientHello that used to weigh a few hundred bytes now lands somewhere around 1,500 to 1,800. Standard Ethernet MTU is 1,500, and after 40 bytes of IP and TCP headers you’ve got 1,460 bytes of payload, less with TCP timestamps. So in most cases the ClientHello may simply not fit in one segment anymore. Now, this is where a lot of write-ups get it wrong. A healthy TCP stack doesn’t care: it sends both segments in the same flight, with no IP fragmentation and no extra round trip. What breaks is code that assumed the whole ClientHello always arrives in the first packet, like TLS inspection engines, load balancers and servers that parse a single read and give up. It’s common enough that the failure even has its own name and website, tldr.fail. And honestly, we’ve already run this experiment in public. When Chrome 124 turned on hybrid Kyber by default on desktop in April 2024, enterprises found out very quickly which boxes were broken. Some SSL-inspecting firewalls dropped the split ClientHello, and at least one major vendor carried it as a known issue in a current release. Browser users got a flag to switch it off and admins got a group policy. Your Java services have an equivalent lever in jdk.tls.namedGroups, but only if someone knows it exists and can roll it out per service at 2am.</p><p>The second failure is older, and frankly nastier. Servers have always sent multi-packet certificate flights, so the server-to-client direction has long been exercised with full-sized packets during the handshake. The client side hasn’t. Before this change, the first full-sized packet a client sent usually came mid-transfer; now it’s the ClientHello itself. If a tunnel’s real MTU is smaller than the assumed MSS and someone is filtering ICMP “fragmentation needed”, that segment just vanishes, and by default TCP retransmits it at the same size into the same hole. A Path MTU blackhole that used to look like a stalled upload now looks like a connection that never establishes at all. And Java makes it worse. JSSE doesn’t impose its own handshake timeout; it waits on the socket read timeout, which HttpURLConnection defaults to zero, meaning forever, and the java.net.http HttpClient sets no request timeout unless you ask for one. So threads quietly hang until a pool runs dry or some outer timeout fires, and when the error finally surfaces it usually reads “Read timed out” or “Remote host terminated the handshake”. Neither says a word about packet size. So teams rotate certificates, roll back the JDK, the symptom goes away, and nobody ever learns why. Meanwhile, your synthetic checks can stay happily green, because a prober sitting inside the datacenter may never cross the broken box. For more details see “Extra: Java handshake timeouts and silent failures” below.</p><h3>The Engineering Directive: Test in Staging</h3><p>So maybe it’s time we stopped treating this as a 2030 compliance exercise. The work is genuinely not that big maybe, but it belongs to many teams, and that’s exactly why it won’t happen unless someone assigns it mind space. My suggestion is to get your security, network and platform engineering leads in a room together, because this failure lives right in the seams between them. Start by taking an inventory of which edges and services actually run OpenSSL 3.5 or Java 27, and which ones pin their group lists and so quietly opt out of the new defaults. Then point a staging OpenSSL 3.5 ingress at a Java 27 backend and check that the hybrid group really is selected. Capture the handshake, confirm the ClientHello spans two segments, and send it across the paths that actually matter: your VPN tunnels, cross-region peering, and yes, that inspection appliance nobody has patched since 2021.</p><p>While you’re at it, ask your middleware vendors directly whether they handle a split ClientHello, and fix any ICMP filtering you come across. Set explicit client timeouts so that when things do fail, they fail loudly rather than hanging in silence. Then keep an eye on handshake p99 for a week. In my view, the teams that do this now will most likely spend a quiet weekend on it. The teams that wait may well end up spending an incident review on it instead.</p><h3>Technical Addendum</h3><p>On the Java side, named groups are controlled through a system property. Set it explicitly in staging so you know exactly what the JVM offers:</p><pre>-Djdk.tls.namedGroups=&quot;X25519MLKEM768,x25519,secp256r1&quot;</pre><p>Order is preference order. Keep x25519 and secp256r1 so older peers still complete a handshake. Be deliberate about pinning this in production: a pinned list also opts you out of future default changes. If an unpatched middlebox breaks during an incident, removing X25519MLKEM768 from the list returns the ClientHello to classical size while you fix the path. That is a temporary trade: you give up harvest now, decrypt later protection on that service until it is restored. To confirm what was actually negotiated, run with:</p><pre>-Djavax.net.debug=ssl:handshake</pre><p>and read the named group inside the ServerHello key_share extension. Do not assume the property took effect.</p><p>On the OpenSSL side, verification is one command from a machine running OpenSSL 3.5 or later:</p><pre>openssl s_client -connect api.example.com:443 -groups X25519MLKEM768 -brief</pre><p>Read the negotiated group line. If the handshake fails, or succeeds only when you drop the flag, a profile override or an older build is forcing classical fallback. Run it again without the flag to see what the server prefers when offered everything.</p><p>In Wireshark, filter on tls.handshake.type == 1 and check how many TCP segments the ClientHello spans.</p><p><strong>The wire math (As I see it…)</strong></p><p>Building blocks:</p><ul><li>X25519 share: 32 bytes</li><li>ML KEM 768 encapsulation key: 1,184 bytes</li><li>ML KEM 768 ciphertext: 1,088 bytes</li></ul><p><strong>Outbound (client to server, the ClientHello)</strong></p><ul><li>Hybrid key share: 1,184 + 32 = 1,216 bytes</li><li>The standalone x25519 share is still sent alongside it, so this is added, not swapped</li><li>Net growth: roughly 1,200 bytes</li><li>A ClientHello of a few hundred bytes becomes roughly 1,500 to 1,800</li><li>Segment budget: 1,500 MTU minus 40 bytes of IP and TCP headers = 1,460 bytes, less with TCP timestamps</li><li>Result: in most cases the ClientHello no longer fits in one segment. This is the direction most likely to break things.</li></ul><p><strong>Inbound (server to client, the ServerHello)</strong></p><ul><li>Hybrid key share: 1,088 + 32 = 1,120 bytes</li><li>It replaces a 32 byte classical share</li><li>Net growth: roughly 1,100 bytes</li><li>Result: usually not a problem, because the server’s flight already spans several segments for the certificate chain</li></ul><p><strong>What to do with it</strong></p><p>Budget for the outbound growth in MSS planning, verify Path MTU Discovery end to end, and test on the longest path you own rather than the lab switch down the hall.</p><h3>References</h3><ul><li>OpenJDK JEP 527: <a href="https://openjdk.org/jeps/527">https://openjdk.org/jeps/527</a></li><li>JDK 27 Release Notes: <a href="https://jdk.java.net/27/release-notes">https://jdk.java.net/27/release-notes</a></li><li>JDK TLS PQC: <a href="https://inside.java/2026/02/17/tls-post-quantum-hybrid-key-exchange/">Post-Quantum Hybrid Key Exchange for TLS 1.3 — Inside.java</a></li><li>Backporting to older JDKs: <a href="https://devops.com/java-27-tackles-post-quantum-security-and-a-faster-patch-cadence/">Java 27 Tackles Post-Quantum Security and a Faster Patch Cadence — DevOps.com</a></li><li>NIST FIPS 203 (ML KEM Standard): <a href="https://csrc.nist.gov/pubs/fips/203/final">https://csrc.nist.gov/pubs/fips/203/final</a></li><li>The NIST workshop paper with speed aspects :<a href="https://csrc.nist.gov/csrc/media/Events/2025/workshop-on-guidance-for-kems/documents/papers/ml-kem-is-great-paper.pdf">ML-KEM is Great! What’s Missing?</a></li><li>OpenSSL 3.5 Release Notes: <a href="https://openssl-library.org/news/openssl-3.5-notes/">https://openssl-library.org/news/openssl-3.5-notes/</a></li><li>tldr.fail (split ClientHello failures): <a href="https://tldr.fail/">https://tldr.fail/</a></li><li>BleepingComputer, Chrome 124 post quantum TLS breakage: <a href="https://www.bleepingcomputer.com/news/security/google-chromes-new-post-quantum-cryptography-may-break-tls-connections/">https://www.bleepingcomputer.com/news/security/google-chromes-new-post-quantum-cryptography-may-break-tls-connections/</a></li><li>Kaspersky, why larger ClientHello messages broke connections: <a href="https://www.kaspersky.com/blog/postquantum-cryptography-2024-implementation-issues/52095/">https://www.kaspersky.com/blog/postquantum-cryptography-2024-implementation-issues/52095/</a></li></ul><h3>Extra: Java handshake timeouts and silent failures</h3><h4>1. JSSE has no separate handshake timeout; it waits on the socket read timeout</h4><p>Several widely used libraries have had to fix this behaviour by setting a socket timeout before calling startHandshake().</p><ul><li><strong>grpc-java, PR #13081 (September 2026)</strong> — describes a middlebox or unresponsive server that completes the TCP handshake and acknowledges the ClientHello but never sends a ServerHello or RST, leaving sslSocket.startHandshake() blocked indefinitely in a socket read. <a href="https://github.com/grpc/grpc-java/pull/13081">https://github.com/grpc/grpc-java/pull/13081</a></li><li><strong>PostgreSQL JDBC driver, PR #3040 (2023)</strong> — applies the connect timeout before SSLSocket.startHandshake() after reports that SSL connections did not honour the connection timeout. <a href="https://github.com/pgjdbc/pgjdbc/pull/3040">https://github.com/pgjdbc/pgjdbc/pull/3040</a></li><li><strong>Apache HttpClient, HTTPCLIENT-1478</strong> — the socket timeout was set only after startHandshake(), so threads could hang during the TLS handshake. <a href="https://issues.apache.org/jira/browse/HTTPCLIENT-1478">https://issues.apache.org/jira/browse/HTTPCLIENT-1478</a></li></ul><h4>2. HttpURLConnection defaults its read timeout to zero, meaning infinite</h4><ul><li><strong>Javadoc, </strong><strong>java.net.URLConnection</strong> — setReadTimeout: a timeout of zero is interpreted as an infinite timeout. <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/URLConnection.html">https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/URLConnection.html</a></li><li><strong>OpenJDK source, </strong><strong>URLConnection.java</strong> — the readTimeout field is declared without an initialiser, so it defaults to zero. HttpURLConnection inherits it. <a href="https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/net/URLConnection.java">https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/net/URLConnection.java</a></li></ul><p>A JVM-wide default can be set with the sun.net.client.defaultReadTimeout system property, which is also unset by default.</p><h4>3. java.net.http.HttpClient sets no request timeout unless asked</h4><ul><li><strong>Javadoc, </strong><strong>HttpRequest.Builder.timeout</strong> — not setting a timeout has the same effect as setting an infinite duration, i.e. block forever. <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpRequest.Builder.html">https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpRequest.Builder.html</a></li></ul><h4>4. The resulting errors say nothing about packet size</h4><ul><li><strong>Stack trace showing where the error is raised</strong> — SSLHandshakeException: Remote host terminated the handshake is thrown from SSLSocketImpl.handleEOF, meaning the connection closed mid-handshake. <a href="https://www.mail-archive.com/issues@geode.apache.org/msg71458.html">https://www.mail-archive.com/issues@geode.apache.org/msg71458.html</a></li><li><strong>Red Hat Customer Portal</strong> — the same exception surfacing through Spring as a generic I/O error. <a href="https://access.redhat.com/solutions/711093">https://access.redhat.com/solutions/711093</a></li></ul><h4>5. Path MTU black holes</h4><ul><li><strong>RFC 2923, TCP Problems with Path MTU Discovery</strong> — describes black holes caused by filtered ICMP “fragmentation needed” messages. <a href="https://www.rfc-editor.org/rfc/rfc2923">https://www.rfc-editor.org/rfc/rfc2923</a></li><li><strong>RFC 4821, Packetization Layer Path MTU Discovery</strong> — a mitigation that does not depend on ICMP. <a href="https://www.rfc-editor.org/rfc/rfc4821">https://www.rfc-editor.org/rfc/rfc4821</a></li></ul><h4>A quick note on precision</h4><p>“Read timed out” appears only when some read timeout is configured, for example by a framework default or the system property above. With a true zero timeout there is no error at all, only a hang. The observations about certificate rotation, JDK rollbacks and synthetic checks staying green reflect operational experience rather than documented behaviour.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a171ca42ea6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Logic of Leverage: Why Higher-Order Functions are a Business Necessity]]></title>
            <link>https://suchakjani.medium.com/the-logic-of-leverage-why-higher-order-functions-are-a-business-necessity-03cd9f15c590?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/03cd9f15c590</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[erlang]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Sun, 10 May 2026 10:10:12 GMT</pubDate>
            <atom:updated>2026-05-10T10:10:12.849Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Boilerplate Tax You’re Already Paying</h3><p>Every engineering organisation carries a hidden liability on its balance sheet. It doesn’t show up in your burndown charts or your sprint retrospectives, but it bleeds velocity all the same. I would call it the <strong>boilerplate tax</strong>: the cumulative cost of writing, reading, reviewing, debugging, and maintaining code whose only purpose is to describe <em>how</em> to iterate rather than <em>what</em> to compute.</p><p>Consider a team of eight engineers maintaining a mid-sized order-processing service. Scattered across the codebase are hundreds of hand-rolled loops that filter collections, transform data shapes, and aggregate results. Each loop is subtly different. Each loop is a potential off-by-one error waiting to surface at 2 a.m. on a Saturday. Each loop must be read in its entirety before a reviewer can determine its intent, because the mechanism and the meaning are tangled together in the same block of mutable state. The cognitive overhead is enormous, and it compounds with every new hire who has to reverse-engineer what “this loop does” before they can safely change it.</p><p>Higher-Order Functions (HOFs) are the antidote. They let you <strong>separate the policy from the mechanism</strong> — extract the <em>what</em> from the <em>how</em> — and in doing so, they eliminate entire categories of bugs, reduce code review time, and let your team express complex data transformations in a fraction of the lines. This isn’t an academic luxury. It’s an engineering economics argument. The organisations that internalise it ship faster, onboard engineers faster, and maintain their systems with less pain. The ones that don’t keep paying the tax.</p><p>For the Senior Engineer lead reading this: HOFs are about leverage. You write the traversal logic once, and then your entire team plugs in business rules like cartridges. For the Engineer: HOFs are about <strong>treating logic as data</strong> — passing behaviour around with the same ease you pass integers and strings — which unlocks composition patterns that rigid procedural code simply cannot express.</p><p>Let’s make this concrete.</p><h3>What a Higher-Order Function Actually Is</h3><p>Strip away the jargon and a Higher-Order Function is a function that does at least one of two things:</p><ol><li><strong>Takes another function as an argument.</strong> “Here’s a collection and here’s the rule for deciding what stays.”</li><li><strong>Returns a function as its result.</strong> “Give me a discount percentage and I’ll hand you back a function that applies it to any price.”</li></ol><p>That’s the whole definition. If you’ve ever passed a comparator to a sort routine, you’ve used a Higher-Order Function. If you’ve ever configured a logging framework with a filter predicate, same story.</p><p>What makes HOFs powerful is not any individual call. It’s the <strong>compositional algebra</strong> they enable. When behaviour is a value you can store, pass, return, and combine, you stop writing code that does things and start writing code that <em>describes</em> things. The runtime does the doing. Your tests get simpler because the units are smaller. Your code reviews get faster because the intent is declared, not buried inside a while loop with three mutation sites.</p><p>The rest of this article walks through the same real-world problem — filtering orders and computing average value per region — in three languages that represent three distinct points on the programming-paradigm spectrum. The goal is not to elect a winner. It’s to show that the <em>principle</em> of HOFs is universal, and to give you enough fluency in each idiom that you can apply the pattern wherever your stack demands it.</p><h3>Java: The Long Road to Elegance</h3><h4>Where We Came From</h4><p>Java engineers who started before version 8 remember the dark ages of anonymous inner classes. Passing behaviour as data was technically possible, but the syntax fought you every step of the way:</p><pre>// Create a mutable list to collect results by hand<br>List&lt;Order&gt; highValue = new ArrayList&lt;&gt;();<br><br>// Iterate every order in the collection manually<br>for (Order order : orders) {<br><br>    // The actual business rule, buried inside loop plumbing<br>    if (order.getTotal().compareTo(new BigDecimal(&quot;1000&quot;)) &gt; 0) {<br><br>        // Manually add each matching item to the output<br>        highValue.add(order);<br>    }<br>}</pre><p>Five lines of ceremony to express one line of intent. The noise-to-signal ratio is brutal, and in a codebase with hundreds of such filters, the visual clutter makes it genuinely hard to spot the business logic during review. This is the boilerplate tax at its most visible.</p><h4>Where We Are Now</h4><p>Java 8’s introduction of <strong>lambdas</strong> and the <strong>Streams API</strong> gave the language a composable pipeline model that fundamentally changed how Java teams think about data transformation. The java.util.function package — Function&lt;T,R&gt;, Predicate&lt;T&gt;, Consumer&lt;T&gt; — provides the standard vocabulary of Higher-Order Function contracts. The Streams API provides the plumbing.</p><p>Here’s a similar use case, modernised: filter orders by quarter and value, group by region, compute averages.</p><pre>// HOF factory: accepts thresholds, returns a reusable Predicate<br>static Predicate&lt;Order&gt; highValueIn(BigDecimal min, Quarter q) {<br>    // Return a lambda that closes over &#39;min&#39; and &#39;q&#39;<br>    return o -&gt; o.quarter().equals(q) &amp;&amp; o.total().compareTo(min) &gt; 0;<br>}<br><br>// Pipeline: filter → group → average, readable top to bottom<br>static Map&lt;String, Double&gt; averageByRegion(List&lt;Order&gt; orders,<br>                                           BigDecimal min, Quarter q) {<br>    // Open a sequential stream over the order list<br>    return orders.stream()<br>        // Apply our predicate factory to keep only matching orders<br>        .filter(highValueIn(min, q))<br>        // Group survivors into a map keyed by region, averaging their totals<br>        .collect(Collectors.groupingBy(Order::region,<br>                 Collectors.averagingDouble(o -&gt; o.total().doubleValue())));<br>}</pre><p>The highValueIn method is itself a Higher-Order Function: it <em>returns</em> a Predicate&lt;Order&gt;. This does mean the filtering logic is parameterised and testable in isolation — you can unit-test the predicate with a handful of stub orders and never instantiate the full pipeline. The pipeline itself reads top-to-bottom: filter, group, average. A reviewer can scan the method in seconds and understand the data flow without tracing the full mutable state.</p><p><strong>The Practical Payoff for Java Teams</strong></p><p>The Streams API is <strong>lazy</strong> by default. Intermediate operations like filter and map don&#39;t execute until a terminal operation like collect demands results. This means the JVM can fuse operations, short-circuit evaluation, and — with .parallelStream() — distribute work across cores with a one-word change. You&#39;re not just writing less code; you&#39;re writing code that the runtime can optimise in ways a hand-rolled for loop never could, because the declarative model gives the JVM <em>permission</em> to rearrange execution.</p><p>The evolution from anonymous classes to lambdas to method references (Order::region) is not mere cosmetic improvement. It&#39;s a shift in <strong>information density</strong>. Each line carries more meaning and less noise. That density compounds across a codebase of a hundred thousand lines, and it is the mechanism by which HOFs translate directly into faster code reviews, fewer merge conflicts, and shorter onboarding ramps.</p><h3>Kotlin: Conciseness as a Design Philosophy</h3><h4>Where Kotlin Picks Up the Thread</h4><p>If Java’s journey to HOFs was a deliberate, backwards-compatible retrofit, Kotlin was designed from the ground up with functions as first-class values. The language doesn’t just permit the HOF style — it actively rewards it through syntax that makes passing lambdas feel as natural as passing arguments.</p><pre>// Data class: one line gives us equals, hashCode, copy, destructuring<br>data class Order(val id: String, val region: String,<br>                 val total: BigDecimal, val quarter: Quarter)<br><br>// HOF factory: returns a lambda that filters by quarter and min value<br>fun highValueIn(min: BigDecimal, q: Quarter): (Order) -&gt; Boolean =<br>    // The returned lambda closes over &#39;min&#39; and &#39;q&#39;<br>    { it.quarter == q &amp;&amp; it.total &gt; min }<br><br>// Extension function: adds &#39;averageByRegion&#39; directly onto List&lt;Order&gt;<br>fun List&lt;Order&gt;.averageByRegion(min: BigDecimal, q: Quarter) =<br>    // Apply the predicate factory to filter the list<br>    filter(highValueIn(min, q))<br>        // Group survivors by their region field<br>        .groupBy { it.region }<br>        // Transform each group into a single average value<br>        .mapValues { (_, orders) -&gt;<br>            // Sum all totals and divide by count<br>            orders.sumOf { it.total }<br>                   .divide(orders.size.toBigDecimal(), 2, RoundingMode.HALF_UP)<br>        }</pre><p>The function type (Order) -&gt; Boolean is a first-class type in Kotlin&#39;s type system — no Predicate&lt;Order&gt; wrapper, no @FunctionalInterface annotation. This matters more than it appears. It means you can compose, alias, and store function types with the same fluency you handle String or Int. It collapses the distance between the concept and its representation in code.</p><h4>The “inline” Keyword: Performance Without Compromise</h4><p>One legitimate concern engineering managers raise about HOFs is runtime overhead. Every lambda in Java is an object allocation. In hot paths — processing millions of events per second — those allocations can pressure the garbage collector. Kotlin addresses this head-on with <strong>inline</strong>.</p><pre>// &#39;inline&#39; tells the compiler: paste the lambda body at the call site<br>inline fun &lt;T&gt; Iterable&lt;T&gt;.filterThen(<br>    predicate: (T) -&gt; Boolean, action: (List&lt;T&gt;) -&gt; Unit<br>) {<br>    // Filter first, then hand results to the action lambda<br>    action(this.filter(predicate))<br>}<br><br>// At this call site, zero lambda objects are allocated at runtime<br>orders.filterThen({ it.total &gt; threshold }) { filtered -&gt;<br>    // Process each matching order — this code is inlined, not wrapped<br>    filtered.forEach { println(&quot;Processing ${it.id}&quot;) }<br>}</pre><p>When the compiler sees inline, it doesn&#39;t generate a Function object and invoke it. It copies the lambda&#39;s bytecode directly into the caller. The result is the ergonomics of a Higher-Order Function with the runtime profile of a hand-inlined loop.</p><h4>DSLs: HOFs as Architecture</h4><p>Kotlin’s real superpower is that HOFs enable <strong>domain-specific languages</strong> that look like configuration but behave like code. A function takes a lambda with a receiver, and that receiver becomes the implicit this inside the block.</p><pre>// DSL builder: collects validation rules as a list of lambdas<br>class Validator&lt;T&gt; {<br>    // Internal list storing each rule as a function from T to error-or-null<br>    private val rules = mutableListOf&lt;(T) -&gt; String?&gt;()<br><br>    // &#39;rule&#39; is an HOF: takes a predicate lambda, wraps it as an error check<br>    fun rule(msg: String, check: (T) -&gt; Boolean) {<br>        rules += { if (!check(it)) msg else null }<br>    }<br><br>    // Run every rule, return only the non-null error messages<br>    fun validate(item: T) = rules.mapNotNull { it(item) }<br>}<br><br>// Factory: the trailing lambda receives Validator as &#39;this&#39;<br>fun &lt;T&gt; validator(init: Validator&lt;T&gt;.() -&gt; Unit) = Validator&lt;T&gt;().apply(init)<br><br>// Usage — reads like a spec, compiles like code<br>val orderRules = validator&lt;Order&gt; {<br>    // Each call passes a lambda — an HOF at work<br>    rule(&quot;Total must be positive&quot;) { it.total &gt; BigDecimal.ZERO }<br>    rule(&quot;Region required&quot;)        { it.region.isNotBlank() }<br>    rule(&quot;ID must match format&quot;)   { it.id.matches(Regex(&quot;ORD-\\d{6}&quot;)) }<br>}</pre><p>Each rule call is passing a lambda, but the syntax reads like a declarative specification. New rules require zero changes to the framework. Business analysts can read the rule block and confirm correctness without understanding the underlying machinery. And that&#39;s leverage.</p><h3>Erlang: Functions in a World Built on Messages</h3><h4>A Different Set of Assumptions</h4><p>Java and Kotlin operate in a shared-memory, object-oriented ecosystem where HOFs were grafted onto existing paradigms (successfully, but grafted nonetheless). Erlang comes from a fundamentally different lineage. It was built at Ericsson in the late 1980s to run telephone switches — systems that must handle millions of concurrent connections, tolerate hardware failures without downtime, and be upgraded while running. In that world, immutability isn’t a style preference. It’s a survival requirement.</p><p>Every Erlang process is a lightweight, isolated actor with its own heap. Processes communicate exclusively through <strong>message passing</strong> via <strong>mailboxes</strong> — a queue of incoming messages that the process selectively matches against patterns using receive blocks. There is no shared state. There are no locks. If a process dies, its supervisor restarts it. This is the famous <strong>&quot;let it crash&quot;</strong> philosophy, and Higher-Order Functions are woven into its fabric.</p><h4>The Same Problem, Different World</h4><pre>-module(order_analytics).<br>-export([average_by_region/3]).<br><br>%% HOF factory: takes thresholds, returns a fun that tests a single order<br>high_value_in(MinTotal, Quarter) -&gt;<br>    %% Return an anonymous function closing over MinTotal and Quarter<br>    fun(#{quarter := Q, total := T}) -&gt;<br>        Q =:= Quarter andalso T &gt; MinTotal<br>    end.<br><br>%% Main pipeline: filter → fold → average<br>average_by_region(Orders, MinTotal, Quarter) -&gt;<br>    %% Build the predicate by calling our HOF factory<br>    Pred = high_value_in(MinTotal, Quarter),<br><br>    %% Keep only orders that satisfy the predicate<br>    Filtered = lists:filter(Pred, Orders),<br><br>    %% Fold into a map of {Region =&gt; {Sum, Count}}<br>    Grouped = lists:foldl(<br>        %% Accumulator: update running sum and count per region<br>        fun(#{region := R, total := T}, Acc) -&gt;<br>            maps:update_with(R,<br>                fun({S, C}) -&gt; {S + T, C + 1} end,<br>                {T, 1}, Acc)<br>        end, #{}, Filtered),<br><br>    %% Transform each {Sum, Count} pair into a single average<br>    maps:map(fun(_R, {S, C}) -&gt; S / C end, Grouped).</pre><p>The structure is recognisable: a predicate factory that returns a function, a filter pass, a fold to group and accumulate, and a map to compute the averages. The data never mutates. Each step produces a new value from the previous one. There are no side effects to reason about, which is precisely why Erlang code is safe to run across dozens of nodes in a telecom cluster.</p><h4>Message Mailboxes and Streams: A Useful Analogy</h4><p>For engineers coming from the JVM world, the closest mental model for Erlang’s message mailbox is a <strong>single-consumer stream with pattern-based selective consumption</strong>. See <a href="https://www.erlang.org/doc/system/expressions.html#receive">Expressions — Erlang System Documentation v28.5</a></p><p>A Java Stream&lt;T&gt; processes elements sequentially through a pipeline of HOFs — filter, map, reduce. An Erlang mailbox similarly holds a sequence of incoming messages, and the receive block acts as a selective filter:</p><pre>%% An order-processing actor: loops forever, handling messages by pattern<br>order_processor(State) -&gt;<br>    receive<br>        %% Match a new-order message, process it, recurse with updated state<br>        {new_order, Order} -&gt;<br>            NewState = handle_order(Order, State),<br>            order_processor(NewState);<br><br>        %% Match a query — RegionFilter is a fun passed as data between processes<br>        {query, From, RegionFilter} -&gt;<br>            %% Apply the HOF argument to filter our local order list<br>            Results = lists:filter(RegionFilter, State#state.orders),<br>            %% Send results back to the caller process<br>            From ! {results, Results},<br>            order_processor(State);<br><br>        %% Match the shutdown atom and exit gracefully<br>        shutdown -&gt; ok<br>    end.</pre><p>The RegionFilter in the {query, From, RegionFilter} message is a function — sent as data from one process to another. The receiving process applies it to its local state without ever exposing that state to the sender. This is HOFs enabling <strong>information hiding at the process level</strong>, a pattern that has no clean equivalent in shared-memory languages.</p><p>Where Java Streams are a pipeline you construct and execute once, an Erlang mailbox is a <em>persistent, selective pipeline</em> that runs for the lifetime of the process. Messages that don’t match the current receive pattern stay in the mailbox, unconsumed, until a future receive matches them. This selective consumption is what allows a single Erlang process to interleave handling of multiple protocols and priorities without threads, locks, or complex state machines.</p><p>The deeper similarity is philosophical: both Streams and mailboxes embody the principle that <strong>data flows through functions</strong>. The difference is scope. A Stream transforms a bounded dataset. A mailbox transforms an unbounded, real-time stream of events over the lifetime of an Erlang process. HOFs are the common grammar.</p><h3>Senior Engineer Aspects to understand</h3><p>Higher-Order Functions are not a language feature. They’re a <strong>design principle</strong> with measurable business impact. When your team adopts them consistently, three things happen.</p><p>First, <strong>code should shrink.</strong> Smaller codebases have fewer bugs per feature, lower maintenance costs, and shorter review cycles.</p><p>Second, <strong>intent becomes visible</strong>. A chain of filter, map, groupBy, and reduce communicates the <em>what</em> at a glance. A hand-rolled loop communicates the <em>how</em> and forces the reader to reconstruct the <em>what</em> through mental simulation. In a codebase touched by fifty engineers over five years,<strong> visibility of intent</strong> is the difference between a system that can be safely evolved and one that becomes a minefield.</p><p>Third, <strong>composition replaces inheritance</strong> as the primary mechanism of code reuse. Instead of maybe building deep class hierarchies to share behaviour — a pattern that may have caused more architectural grief than perhaps any other in the history of software — you could maybe build small, focused functions and combine them. The resulting code is flatter, more modular, and far easier to test.</p><p>Whether your stack is Java, Kotlin, Erlang, or something else entirely, the underlying leverage is the same. Functions that accept functions. Functions that return functions. Logic as data, data as logic, and the freedom to compose without ceremony.</p><p><strong>The boilerplate tax is optional. Maybe it is time we stop paying it.</strong></p><h3>Comparison Sheet</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1MuIJffjUyiHOKwF-9JFRAj6m_OryWX3quHhY6nY4LNk%2Fpreview%3Fembedded%3Dtrue&amp;display_name=Google+Docs&amp;url=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1MuIJffjUyiHOKwF-9JFRAj6m_OryWX3quHhY6nY4LNk%2Fedit%3Fusp%3Dsharing&amp;image=https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocs%2FAHkbwyKS06KBj32zutlNla-dctR14XhRyPDilHXK9viswCe_2Ian5YIob__FiZISJjC0WyUUfmfGQURjuMZZjxZCH9RPHlJqQ1BF6NHzGJwhutD5yquENp0%3Dw1200-h630-p&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=google" width="700" height="530" frameborder="0" scrolling="no"><a href="https://medium.com/media/2097c16d7fa5aa7868e2ec3d780722ef/href">https://medium.com/media/2097c16d7fa5aa7868e2ec3d780722ef/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=03cd9f15c590" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Great Reconvergence: Why Java 25 Just Vindicated the Blocking JDBC Pattern]]></title>
            <link>https://suchakjani.medium.com/the-great-reconvergence-why-java-25-just-vindicated-the-blocking-jdbc-pattern-d27843be7f5b?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d27843be7f5b</guid>
            <category><![CDATA[jdbc]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 15:51:21 GMT</pubDate>
            <atom:updated>2026-03-29T16:03:50.832Z</atom:updated>
            <content:encoded><![CDATA[<p>Part Four of the Non-Blocking JDBC Series</p><h3>Background</h3><p>This is a Four part series</p><ol><li><a href="https://medium.com/@suchakjani/a-case-for-non-blocking-jdbc-part-one-caeadc80fb7c">Part One</a> — A Case for Asynchronous Non Blocking JDBC — One</li><li><a href="https://suchakjani.medium.com/a-case-for-non-blocking-jdbc-part-two-a8d803f6ed69">Part Two</a> — A Case for Asynchronous Non Blocking JDBC — Two</li><li><a href="https://suchakjani.medium.com/non-blocking-jdbc-early-2021-update-b8b2a24a3b83">Part Three</a> — Non blocking JDBC — Early 2021 update</li><li>Part Four — This page</li></ol><p>In Part one we went through the details of non blocking calls and event based systems.</p><p>The Part two we went through Java NIO, Java JDBC, and the need for non blocking JDBC.</p><p>In Part three we understand the status of non blocking JDBC as of early 2021.</p><p>In this part we look at how Java 25 has changed the game with respect to Java Virtual Threads.</p><h4>History</h4><p>I started this series in 2018 with a hard truth: <strong>threads were too expensive to waste on I/O wait.</strong> Back then, if you wanted to scale to hundreds of thousands of concurrent connections, you paid the cognitive tax of Mono, Flux, and the R2DBC ecosystem. That was the deal.</p><p>In 2021, I updated the series when Project Loom appeared on the horizon. The promise — <em>write synchronous code, get asynchronous performance</em> — was compelling. But there was a catch. A large one.</p><p>It’s now 2026. Java 25 LTS has landed, that catch is gone, and I owe the “Old Guard” an apology.</p><h3>The 2021 Problem: Pinned Threads</h3><p>For a few frustrating years, Virtual Threads were theoretically powerful but practically limited. The culprit was synchronized. JDBC drivers performing I/O inside possiblesynchronized blocks would &quot;pin&quot; the underlying carrier thread to the OS — meaning your supposedly infinite Virtual Threads were being throttled by a finite OS thread pool. We were back to square one.</p><p>This wasn’t theoretical. The pgjdbc team <a href="https://github.com/pgjdbc/pgjdbc/issues/1951">tracked it publicly from 2020</a>. MySQL had <a href="https://bugs.mysql.com/bug.php?id=109346">an open bug report on the same issue</a>. Postgres partially addressed it in <a href="https://jdbc.postgresql.org/changelogs/2023-03-17-42.6.0-release/">42.6.0 (2023)</a>, but pinning was <a href="https://github.com/quarkusio/quarkus/issues/50345">still surfacing in production Quarkus stacks as late as 2025</a>.</p><p>To work around it, teams stayed on R2DBC or wrapped everything in ReentrantLock. Again we were over-engineering to compensate for the platform&#39;s own limitations.</p><h3>JEP 491: The Missing Piece</h3><p>Rather than waiting for every driver, every library, and every transitive dependency to audit and patch their synchronized usage — <strong>Java 25 fixed the JVM itself.</strong></p><p><a href="https://openjdk.org/jeps/491">JEP 491 — Synchronize Virtual Threads without Pinning</a> allows the JVM to unmount a Virtual Thread even when it’s inside a synchronized block. You don&#39;t fix the drivers. You fix the JVM.</p><h3>Before vs. After: What Actually Changes</h3><p>Here’s what was happening to your carrier thread before Java 25, and what happens now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*i2GxwzeuZVUvEwXf4kQneg.png" /><figcaption>JEP 491 the JVM unmounts instead</figcaption></figure><p>The key insight: the Virtual Thread is <em>parked</em> (suspended in heap memory), not blocking the carrier. The carrier is free to pick up and run any other Virtual Thread in the meantime. When the database responds, the original Virtual Thread is remounted and continues from exactly where it left off — as if nothing happened.</p><p>What this means practically: <strong>the Postgres JDBC driver you’ve trusted for a decade is now natively Loom-friendly</strong>, regardless of its internal locking model. No driver updates required for <em>your</em> code to benefit. No dependency audits. No ReentrantLock wrappers. You just need a blocking driver on a Virtual Thread, and the JVM handles the rest.</p><h3>The Reactive Tax: What We Actually Paid</h3><p>Let me be possibly be a little bit direct here, because I’ve watched teams struggle with this for years.</p><p>Reactive programming was a legitimate architectural response to a real constraint. But it carried costs that were consistently undersold:</p><ul><li><strong>Stack traces that tell you nothing.</strong> A hanging R2DBC stream at 3am produces 200 lines of Reactor internals. Finding the actual problem requires deep framework knowledge most engineers don’t have.</li><li><strong>Onboarding bottlenecks.</strong> “Learn WebFlux before you can contribute” is a real barrier. It creates a two-tier team dynamic — reactive specialists and everyone else.</li><li><strong>Optimistic Aspirational-Engineering.</strong> I’ve watched this play out more times than I’d like to admit — and honestly, I’ve probably been guilty of it myself at some point. A team picks WebFlux not because the problem demands it, but because it <em>feels</em> like the serious, production-grade choice. It earns its place in the architecture diagram. It shows up in job postings. And six months later, some poor new joiner spends their first three weeks just decoding operator chains before they’ve written a single line of business logic. That’s not sophistication. That’s friction wearing a suit. The engineers who shipped your system in plain JDBC back in 2015 weren’t naive. They were under very real pressure, serving real users, and they made it work. They just didn’t have the <em>luxury</em> of over-engineering it — and maybe that was the point…</li></ul><h3>The 2026 Way: Structured Concurrency</h3><p>Here’s the same logic — fetch a user, fetch their last 10 orders in parallel, merge them — written both ways.</p><p><strong>The R2DBC version:</strong></p><pre>public Mono&lt;UserDashboard&gt; getDashboard(Long userId) {<br>    return Mono.zip(<br>        userRepository.findById(userId)<br>            .switchIfEmpty(Mono.error(new UserNotFoundException(userId))),<br>        orderRepository.findTop10ByUserIdOrderByCreatedAtDesc(userId)<br>            .collectList()<br>    ).map(tuple -&gt; new UserDashboard(tuple.getT1(), tuple.getT2()))<br>     .doOnError(e -&gt; log.error(&quot;Dashboard failure for user {}&quot;, userId, e))<br>     .checkpoint(&quot;Dashboard Pipeline&quot;);<br>}</pre><p><strong>The Java 25 version (</strong><a href="https://openjdk.org/jeps/505"><strong>JEP 505 — Structured Concurrency</strong></a><strong>):</strong></p><pre>public UserDashboard getDashboard(Long userId) {<br>    try (var scope = new StructuredTaskScope.ShutdownOnFailure()) {<br>        var userTask   = scope.fork(() -&gt; userRepository.findById(userId));<br>        var ordersTask = scope.fork(() -&gt; orderRepository.findRecent(userId));<br><br>        // If userTask throws (e.g. user not found), ShutdownOnFailure cancels<br>        // ordersTask immediately — no wasted cycles waiting on a doomed request.<br>        scope.join().throwIfFailed();<br><br>        return new UserDashboard(userTask.get(), ordersTask.get());<br>    } catch (ExecutionException | InterruptedException e) {<br>        throw new ServiceException(&quot;Failed to fetch dashboard&quot;, e);<br>    }<br>}</pre><p>Notice the ShutdownOnFailure scope does more than just run things in parallel — it short-circuits. If the user lookup fails (user not found, DB timeout, anything), the orders query is cancelled immediately. You don&#39;t pay for work that can&#39;t succeed. That&#39;s the kind of behaviour that used to require careful operator chaining in Reactor; here it&#39;s the default.</p><p>The second version is readable by any Java engineer on your team. No operator knowledge required. Linear control flow. Debuggable with standard tools.</p><h3>What This Means for us as Engineering Leaders</h3><p>If you’re running an engineering org, here’s the ROI argument in plain terms:</p><p><strong>Lower onboarding cost.</strong> Mid-level engineers can now write high-throughput microservices without learning a reactive programming model first. That’s weeks of ramp-up time back per engineer.</p><p><strong>Faster incident resolution.</strong> Virtual Thread stack traces are linear. You see exactly where a thread is blocked — getConnection() on line 47, waiting 340ms. Compare that to untangling a reactive chain at 3am.</p><p><strong>Simpler code reviews.</strong> Less abstraction means faster PR cycles and more engineers who can meaningfully review a change.</p><p>The trade-off between performance and simplicity has genuinely shifted. In 2021, reactive was the pragmatic choice. In 2026, using java 25, now it’s often the overcomplicated one.</p><h3>R2DBC Is Now a Niche Tool</h3><p>Maybe That’s a possible bold claim, and I stand by it until I see evidence to the contrary.</p><p>Unless you’re doing true low level event-streaming, require back-pressure propagation across a complex service mesh, or are integrating with async-native infrastructure — R2DBC is almost certainly over-engineering for your use case.</p><blockquote>Eight years ago I argued that blocking JDBC needed to change. I was right about the problem. The solution didn’t come from a new database API. It came from a reinvention of the<em> Java thread</em> itself.</blockquote><p><strong>Rip out the reactive boilerplate. It’s time to get back to work.</strong></p><h3>Further Reading</h3><p><strong>The JEPs — read these first</strong></p><ul><li><a href="https://openjdk.org/jeps/491">JEP 491 — Synchronize Virtual Threads without Pinning</a> — the core of everything discussed in this article</li><li><a href="https://openjdk.org/jeps/505">JEP 505 — Structured Concurrency (Fifth Preview)</a></li><li><a href="https://openjdk.org/jeps/506">JEP 506 — Scoped Values (Fourth Preview)</a></li></ul><p><strong>The driver pinning history — primary sources</strong></p><ul><li><a href="https://github.com/pgjdbc/pgjdbc/issues/1951">pgjdbc GitHub Issue #1951</a> — the original 2020 thread tracking synchronized pinning in the Postgres driver</li><li><a href="https://jdbc.postgresql.org/changelogs/2023-03-17-42.6.0-release/">PostgreSQL JDBC 42.6.0 Release Notes</a> — the driver-side fix</li><li><a href="https://bugs.mysql.com/bug.php?id=109346">MySQL Bug #109346</a> — the equivalent issue logged against MySQL Connector/J</li><li><a href="https://github.com/quarkusio/quarkus/issues/50345">Quarkus Issue #50345 (2025)</a> — evidence that pinning possibly persisted even after driver patches, validating the JVM-level fix</li></ul><p><strong>Broader context</strong></p><ul><li><a href="https://quarkus.io/guides/virtual-threads">Quarkus Virtual Threads Guide</a> — practical treatment of pinning, ThreadLocal hazards, and real-world Virtual Thread adoption</li><li><a href="https://wiki.openjdk.org/display/loom/Main">Project Loom — OpenJDK Wiki</a></li><li><a href="https://dev.java/learn/new-features/virtual-threads/">Virtual Threads — Oracle Dev Guide</a></li><li><a href="https://blog.ydb.tech/how-we-switched-to-java-21-virtual-threads-and-got-deadlock-in-tpc-c-for-postgresql-cca2fe08d70b">YDB: How we switched to Java 21 Virtual Threads and got a deadlock</a> — a war story worth reading before you migrate</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d27843be7f5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s more, Is Agile Dead in the Age of AI Coding?]]></title>
            <link>https://suchakjani.medium.com/whats-more-is-agile-dead-in-the-age-of-ai-coding-6e7f75a19d3b?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e7f75a19d3b</guid>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Fri, 13 Feb 2026 22:23:36 GMT</pubDate>
            <atom:updated>2026-02-13T22:23:36.972Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s 9 AM on a Monday. Your development team gathers for sprint planning — a ritual you’ve refined over years of iterative improvements. But something feels different now. Last week, two junior engineers used Claude and Cursor to complete what you’d estimated as a two-sprint feature in under two hours. The API integration, error handling, test coverage — all done. Your carefully calibrated velocity metrics suddenly feel like measuring horse speed at a Formula 1 race.</p><p>You’re not alone in this disorientation. According to <a href="https://www.secondtalent.com/resources/ai-coding-assistant-statistics/">recent data</a>, 21% of Google’s code is now AI-assisted, and engineers using AI coding assistants report completing 126% more projects per week. When <a href="https://itrevolution.com/articles/new-research-reveals-ai-coding-assistants-boost-developer-productivity-by-26-what-it-leaders-need-to-know/">MIT researchers studied nearly 5,000 engineers</a> across Microsoft, Accenture, and other Fortune 100 companies, they found a 26% increase in completed tasks and a 38% rise in code compilation frequency.</p><p>The central question facing engineering leaders isn’t whether AI is transforming development — it’s whether our cherished Agile practices can survive the transformation. If AI can generate entire features in hours, what happens to our two-week sprints, our story points, our carefully orchestrated ceremonies?</p><h3>My Journey: From Smalltalk to the AI Era</h3><p>At the very start of my career, I worked in Smalltalk as a programming language. Reading up on Extreme Programming by Kent Beck felt natural to me — Beck himself was a prominent Smalltalk practitioner who developed XP[extreme programming] during his work on the Chrysler Comprehensive Compensation System. I remember being genuinely excited when the Agile Manifesto emerged around 2001. It helped our teams with measurable aspects for productivity, especially in focused small squads of about 10 people. The principles resonated deeply with what we were experiencing on the ground.</p><p>Fast forward to today, and I was recently speaking to a close friend from a partner company. What we agreed on is that this is a brave new world with AI, and we need to fully grasp it to gain clarity and thus take part in its advantages. The transformation we’re witnessing isn’t just incremental — it’s fundamental.</p><h3>The Agile-AI Collision: When Assumptions Break Down</h3><p>Agile emerged around 2001 to solve a specific problem: the glacial pace and rigidity of waterfall development. The Manifesto’s authors recognized that software requirements change, that customer collaboration beats contract negotiation, and that working software matters more than comprehensive documentation. These insights revolutionized how we build software.</p><p>But AI coding assistants are challenging Agile’s core operational assumptions in ways that feel seismic:</p><p><strong>Iterative development when iteration cycles compress from weeks to hours.</strong> Your sprint planning assumes development takes time — time to write code, debug, test, refactor. When an engineer can generate five implementation variants of a feature in an afternoon, what does “iteration” even mean? The <a href="https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/">METR study of experienced open-source engineers</a> found that while AI tools excel at greenfield tasks, they’re transforming the temporal dynamics of development in unpredictable ways. Some tasks that took hours now take minutes; others become more complex as engineers orchestrate AI across multiple contexts.</p><p><strong>User stories and acceptance criteria when AI can prototype instantly.</strong> We write detailed user stories to align the team on the “what” we’re building. But when stakeholders can see working prototypes within an hour of a requirements discussion, the traditional story-pointing ceremony starts feeling like a bit of a theatre. Why spend 90 minutes estimating when you could spend maybe 30 minutes building?</p><p><strong>Sprint planning and velocity metrics when estimation models break down.</strong> I’ve spent twenty years in distributed payment systems, and one thing I’ve learned: accurate estimation requires understanding implementation complexity. But <a href="https://www.technologyreview.com/2025/12/15/1128352/rise-of-ai-coding-developers-2026/">research from Coinbase reveals</a> the paradox: for simple refactoring and test generation, AI delivers up to 90% speedups. For complex integration work? The gains are modest or even negative. Your velocity becomes bimodal — sprint capacity is no longer a meaningful predictor.</p><p><strong>“Working software over documentation” when AI needs precise specifications.</strong> Here’s the uncomfortable truth: AI coding assistants are more literal than junior engineers. They need clarity. <a href="https://devops.com/ai-in-software-development-productivity-at-the-cost-of-code-quality-2/">GitClear’s analysis</a> found that “code churn” — code discarded within two weeks — is projected to double in 2024. As GitClear founder Bill Harding notes, AI creates “AI-induced tech debt” where hastily added code becomes caustic to teams expected to maintain it. Suddenly, that “comprehensive documentation” we were supposed to avoid? It’s starting to look necessary again, just in a different form: precise prompts, architectural constraints, quality gates.</p><h3>What Still Matters (Maybe More Than Ever)</h3><p>But here’s what I’ve observed engineering real-time payment systems across many countries: when the bottleneck shifts, different constraints become critical.</p><p>In my view, Agile isn’t dying — it’s revealing its true essence.</p><p><strong>Human judgment in defining “what to build” has never been more valuable.</strong> AI can generate a thousand implementations, but it can’t tell you which customer problem is worth solving. When I’ve used AI assistants on side projects, I’ve found exactly what the <a href="https://www.cerbos.dev/blog/productivity-paradox-of-ai-coding-assistants">research confirms</a>: they’re brilliant for MVPs and experiments — that first 80% happens at lightning speed. But deciding whether that experiment deserves production investment? That’s still humans at a whiteboard.</p><p><strong>Code review becomes more critical, not less.</strong> <a href="https://www.cerbos.dev/blog/productivity-paradox-of-ai-coding-assistants">Apiiro’s 2024 research</a> is alarming: AI-generated code showed 322% more privilege escalation paths and 153% more design flaws compared to human-written code. Moreover, AI-assisted commits merged 4x faster than regular commits, often bypassing normal review cycles. Your code review process isn’t obsolete — it’s the last line of defence against architectural entropy. The ritual of pull request reviews, once focused on syntax and style, now requires thinking like a security researcher and systems architect.</p><p><strong>Retrospectives for learning how to collaborate with AI are crucial.</strong> The principle is “you can’t improve what you don’t examine”. How are your engineers prompting AI? Are junior engineers over-relying on AI and missing opportunities to learn some of the foundational patterns? <a href="https://mitsloan.mit.edu/ideas-made-to-matter/how-generative-ai-affects-highly-skilled-workers">Research shows</a> junior engineers see 27–39% productivity gains while seniors only see 8–13% — but at what cost to long-term skill development and also personal confidence as an engineer?</p><p><strong>Customer collaboration when prototyping becomes instantaneous.</strong> This is Agile’s hidden superpower in the AI era. When you can show stakeholders three working prototypes in the time it used to take to draw wireframes, customer feedback loops compress dramatically. But — and this is critical — only if you have processes to rapidly incorporate that feedback. Your advantage isn’t just building fast; it’s learning and then adapting fast.</p><p><strong>Cross-functional communication as the bottleneck shifts from implementation to alignment.</strong> <a href="https://www.index.dev/blog/ai-coding-assistants-roi-productivity">Faros’s research</a> analyzing 10,000+ engineers found that individual PR output increased by 47%, but PR review time ballooned by 91%. The human approval loop became the chokepoint. When engineers spend less time coding and more time orchestrating AI across contexts, communication and alignment aren’t nice-to-haves — they’re the constraint.</p><h3>What Needs to Evolve: Practical Adaptations</h3><p>Let me share what evolution looks like in practice:</p><p><strong>Reimagined sprint ceremonies.</strong> Your daily standup can’t be “I’m waiting for the AI to finish generating test cases.” But it can be: “I’ve generated three approaches to the rate-limiting logic; I need architectural input on trade-offs before proceeding.” The ceremony shifts from status updates to decision-making. Sprint planning becomes less about estimating effort and more about sequencing dependencies and identifying integration risks.</p><p><strong>New estimation frameworks that account for AI acceleration.</strong> Consider a two-tier estimation: “implementation time” and “validation time.” A feature might be 2 hours to generate but 2 days to review, test, integrate, and validate against your architectural principles. <a href="https://addyo.substack.com/p/the-reality-of-ai-assisted-software">Google’s internal RCT</a> found even in enterprise settings, AI provided ~20% productivity improvement — meaningful but not 10x. Your planning should reflect this reality: AI is an accelerant, not a panacea.</p><p><strong>Modified Definition of Done that includes AI code validation.</strong> Done isn’t “code runs.” Done is: code runs, passes security review, meets architectural standards, includes no hard-coded credentials (AI loves to generate those at times), follows your error-handling patterns, is incremental with proper production migration thought through, and can be maintained by someone other than the AI that wrote it. The <a href="https://arxiv.org/pdf/2211.03622">Stanford research from 2023</a> found engineers shipped more vulnerabilities because they trusted AI output too much. Your DoD is your guardrail.</p><p><strong>Role evolution: engineers as architects/reviewers rather than pure implementers.</strong> I’ve seen this in my work with migrations in distributed infrastructure: the senior engineer’s value isn’t typing speed — it’s knowing which consensus algorithm to choose for theuse case, understanding the CAP theorem trade-offs, recognizing when “it works” isn’t good enough. For example, AI could help implement Raft consensus; but it can’t tell you whether you need it vs a multi-master approach with consensus. This is where senior engineers shine with domain and technical experience and also with years of production proven experience.</p><p><strong>Technical debt considerations unique to AI-generated code.</strong> AI generates code that works but may not align with your system’s evolution. It doesn’t know you’re planning to migrate from REST to gRPC next quarter. It doesn’t know your team’s convention for error handling. <a href="https://arxiv.org/html/2506.20159v1">As research on AI in Agile development</a> from XP 2025 workshop participants identified, teams face challenges with data quality, governance, and skill gaps when integrating AI into Agile practices. Your technical debt management needs to explicitly address AI-generated code as a category.nileshcall me when free</p><h3>The Real Question: What Problem Are We Solving?</h3><p>Here’s what makes me optimistic about Agile’s future: the methodology has always been about first principles, not rigid prescriptions.</p><p>The Agile Manifesto didn’t say “thou must do two-week sprints.” It said “responding to change over following a plan.” It didn’t mandate story points. It championed “working software over comprehensive documentation.”</p><p>When junior engineers generate features in hours, we’re not breaking Agile — we’re creating new opportunities for the rapid feedback loops Agile always promised. The question isn’t “does AI kill Agile,” it’s “what problems are we actually trying to solve, and how does AI change the solution space?”</p><p>Think about it: What was the original problem Agile addressed? Slow feedback, rigid planning, inability to respond to change, disconnect between engineers and customers, documentation that didn’t reflect reality.</p><p>AI doesn’t eliminate these problems. If anything, it makes some of them more urgent. You need faster feedback loops when you can generate five versions of a feature in an afternoon. You need tighter customer collaboration when you can show working prototypes in hours. You need better documentation when AI-generated code needs human context to be maintainable.</p><p>The teams struggling with AI aren’t the ones practicing Agile principles — they’re the ones who turned Agile ceremonies into cargo cult rituals. The standup became a status report rather than a coordination mechanism. The retrospective became a complaint session rather than a learning opportunity. The sprint became a deadline rather than a rhythm.</p><h3>A Case Study: Payment Processing Under AI Transformation</h3><p>Let me ground this in a hypothetical case study. Imagine a team building a new payment reconciliation system — matching transactions across multiple payment rails (cards, bulk ACH, real-time payments, wallets, digital currency, etc.). This is a part of the domain I’ve lived in for two decades.</p><p><strong>Pre Requisites:</strong> Clear specifications[with expected Input &amp; Output] have been collaborated upon by experienced Engineers including Product Engineers, Engineers in Test and Live Support Engineers.</p><p><strong>Traditional Agile approach:</strong> Sprint 1–2: Design data models and integration patterns. Sprint 3–4: Implement core matching logic. Sprint 5–6: Add exception handling and reporting. Timeline: 6–8 weeks.</p><p><strong>AI-assisted approach:</strong> Day 1: Use Claude to generate five data model variations, each optimized for different matching strategies. Engineer perform a quick review, selects a hybrid approach. Day 2–3: AI generates matching algorithms for exact matches, fuzzy matches, amount-based reconciliation. Engineers add domain-specific rules AI can’t know (your own company’s tolerance thresholds, your regulatory requirements etc). Day 4–5: Extensive review cycle — checking for race conditions, validating error handling, stress testing against historical data. Week 2–3: Test Integration with existing systems, performance tuning, security hardening.</p><p>Timeline: 2–3 weeks. But — and this is critical — the work didn’t fully disappear. It shifted. Less time coding, vastly more time validating, reviewing, ensuring the generated code meets unstated requirements that live in senior engineers’ wisdom portion of consciousness.</p><p>According to <a href="https://enterpriseaiexecutive.ai/p/20-must-read-ai-case-studies-for-enterprise-leaders">BCG’s analysis</a> of 42 AI enterprise examples, a European bank used AI to transform credit processing with measurable outcomes. But success required careful orchestration of cross-functional agile squads, not just unleashing AI on the problem.</p><h3>Conclusion: Evolution, Not Extinction</h3><p>Agile isn’t dead. But if you’re running 2001-era Agile practices unchanged in 2025, you’re possibly doing it wrong.</p><p>The Agile Manifesto’s values remain sound:</p><ul><li>Individuals and interactions over processes and tools (even more critical when the tools are AI)</li><li>Working software over comprehensive documentation (but with new definitions of “working”)</li><li>Customer collaboration over contract negotiation (accelerated by rapid prototyping)</li><li>Responding to change over following a plan (AI makes change cheaper, so this becomes easier)</li></ul><p>What’s changing are the mechanics — the ceremonies, the metrics, the cadences. Teams still working in two-week sprints when their work now follows a different rhythm will struggle. Teams that dogmatically refuse to adapt estimation approaches will find their planning sessions increasingly divorced from reality.</p><p>The teams that will thrive are those who remember what Agile was always about: “delivering value to customers through rapid feedback loops and continuous adaptation”.</p><p>In my humble opinion I think — AI hasn’t killed that goal — it’s just changed the path.</p><p>Your sprint planning might become less about “how long will this take” and more about “what do we learn next and how should we adapt.” Your standups might shift from status updates to architecture &amp; design reviews. Your retrospectives might focus on improving your team’s AI collaboration rather than improving your code.</p><p>And that’s not Agile dying. That’s Agile doing exactly what it was designed to do: “ Quickly adapting to change”.</p><p>Agile is alive precisely because it can transform and adapt. The question isn’t whether Agile survives the AI revolution — it’s whether your particular implementation version of Agile will.</p><p>— — — — — — — -</p><p><strong>How is your team adapting Agile practices with AI coding tools? What’s working, and what’s not?</strong> In all humility, I’d love to hear your personal experiences — the successes, the failures, and especially the surprising discoveries.</p><p>The conversation is just beginning, and we’re all figuring this out together.</p><p>— — — — — — -</p><h3>References and Data Sources</h3><ul><li><a href="https://www.secondtalent.com/resources/ai-coding-assistant-statistics/">AI Coding Assistant Statistics &amp; Trends</a></li><li><a href="https://mitsloan.mit.edu/ideas-made-to-matter/how-generative-ai-affects-highly-skilled-workers">MIT Sloan: How Generative AI Affects Highly Skilled Workers</a></li><li><a href="https://itrevolution.com/articles/new-research-reveals-ai-coding-assistants-boost-developer-productivity-by-26-what-it-leaders-need-to-know/">IT Revolution: New Research on AI Coding Productivity</a></li><li><a href="https://www.cerbos.dev/blog/productivity-paradox-of-ai-coding-assistants">Cerbos: The Productivity Paradox of AI Coding Assistants</a></li><li><a href="https://devops.com/ai-in-software-development-productivity-at-the-cost-of-code-quality-2/">DevOps.com: AI in Software Development — Productivity vs Quality</a></li><li><a href="https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/">METR: Measuring the Impact of AI on Developer Productivity</a></li><li><a href="https://www.technologyreview.com/2025/12/15/1128352/rise-of-ai-coding-developers-2026/">MIT Technology Review: AI Coding Is Everywhere (Coinbase Research)</a></li><li><a href="https://www.index.dev/blog/ai-coding-assistants-roi-productivity">Index.dev: AI Coding Assistant ROI Study 2025</a></li><li><a href="https://arxiv.org/html/2506.20159v1">XP 2025: AI and Agile Software Development Workshop</a></li><li><a href="https://enterpriseaiexecutive.ai/p/20-must-read-ai-case-studies-for-enterprise-leaders">BCG: 20 Must-Read AI Case Studies for Enterprise Leaders</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e7f75a19d3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Work out details of Assembly files with AI]]></title>
            <link>https://suchakjani.medium.com/work-out-details-of-assembly-files-with-ai-163810f7fee9?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/163810f7fee9</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ide]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[assembly]]></category>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Mon, 19 Feb 2024 20:07:25 GMT</pubDate>
            <atom:updated>2024-02-19T20:07:25.780Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Assembly Language</h3><p>A low level language to work with devices. Most Programmers of devices use this language to work with devices and each device has a set of low level instructions that it accepts.</p><p>See</p><p><a href="https://en.wikipedia.org/wiki/Assembly_language">Assembly language - Wikipedia</a></p><h3>How does it look ?</h3><p>Here is an example</p><pre>INCLUDE &quot;emu8086.inc&quot;<br><br>JMP START<br><br>DATA SEGMENT<br>    PACKET  DW    0      ;NUMBER OF PACKETS TO BE TRANSMITTED<br>    N       DW    0         ;NUMBER OF TRANSMITTED PACKETS AND DETECT 128 CYCLE<br>    N2      DW    0         ;NUMBER OF TRANSMISSION  <br>    MSG1    DW   &quot;Enter number of packets: &quot;,0<br>    MSG2    DW    &quot;Number of Transmissions: &quot;,0<br>   <br>DATA ENDS  <br><br>CODE SEGMENT<br><br>ASSUME DS:DATA CS:CODE <br><br>START:<br>       MOV CX, DATA         ;DECLARATION OF DATA SEGEMENT<br>    MOV DS, CX   <br>    DEFINE_SCAN_NUM<br>       DEFINE_PRINT_STRING<br>       DEFINE_PRINT_NUM<br>       DEFINE_PRINT_NUM_UNS <br>       DEFINE_CLEAR_SCREEN  <br>       <br>    LEA SI,MSG1<br>    CAll PRINT_STRING<br>    CALL SCAN_NUM<br>    MOV PACKET,CX<br><br>LOOP1: INC N2               ;INCREASING NUMBER OF TRANSMISSOIN MADE<br>       INC N                ;INCREASING NUMBER OF PACKETS TRANSMITTED<br>       DEC PACKET           ;DECREASING NUMBER OF PACKETS TO BE TRANSMITTED<br>       JMP DONE<br><br>LOOP2: CMP N,64<br>       JB  FUNC1             ;IF NUMBER OF PACKETS TRANSMITTED IS LESS THAN 64     <br><br>loop_start:<br>       cmp N,128            ; compare loop counter with 10<br>       JGE loop_end         ; jump out of loop if counter &gt;= 10<br>       JMP LOOP1<br>       JMP loop_start       ; jump back to the start of the loop<br>loop_end:<br>       MOV N,0<br>       JMP LOOP1            <br><br>FUNC1: MOV CX,N <br>       CMP CX,PACKET        ;CHECK IF NUMBER OF LEFT TO BE TRANSMITTED IS SMALLER THAN TRANSFERRED PACKETS AT THAT TIME<br>       JAE  BREAK  <br>       SHL N,1   <br>       SUB PACKET,CX<br>       INC N2<br><br>DONE:  CMP  PACKET,0<br>       JBE  BREAK<br>       CMP  N,64<br>       JB   FUNC1             ;IF NUMBER OF PACKETS TRANSMITTED IS LESS THAN 64<br>       JMP  loop_start<br><br>BREAK:<br>       PRINT 0AH<br>       PRINT 0DH<br>       LEA  SI,MSG2<br>       CALL PRINT_STRING<br>       MOV  AX,N2   <br>       CALL PRINT_NUM_UNS       <br>         <br>        <br>CODE ENDS<br><br>END START<br><br>ret</pre><h3>Is there a way to document Assembly Language ?</h3><p>A friend at work asked this question. I have been looking at AI recently. I have been using an AI within Intellij IDEA called Codeium.</p><p>See</p><p><a href="https://codeium.com/">Reply Logo</a></p><p>It is good at so many aspects like Explaining Code snippets, Documenting Code, Auto Completing Code etc.</p><p>Lets get some Assembly Code from Github</p><p>See</p><p><a href="https://github.com/yousefkotp/8086-Assembly-Projects">GitHub - yousefkotp/8086-Assembly-Projects: A list of 8086 assembly projects solutions for Microprocessors course (CC421N) at Faculty of Engineering, Alexandria University.</a></p><pre>git clone https://github.com/yousefkotp/8086-Assembly-Projects</pre><p>Download and install CLIon Intellij IDE</p><p><a href="https://www.jetbrains.com/clion/">CLion: A Cross-Platform IDE for C and C++ by JetBrains</a></p><p>Install the Codeium Idea plugin in CLion[It is free] [Make sure you do log in to Codeium]</p><p><a href="https://plugins.jetbrains.com/plugin/20540-codeium-ai-autocomplete-and-chat-for-python-js-java-go--">Codeium: AI Autocomplete and Chat for Python, JS, Java, Go... - IntelliJ IDEs Plugin | Marketplace</a></p><p>Open “8086-Assembly-Projects” in CLion [the one you git cloned above]</p><p>Ask a few questions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*BAR6P2ajcU0pVd8uQjeqGg.png" /><figcaption>File Questions</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*IA_YQCnm-0PCrw8Vk-F0Fw.png" /><figcaption>Function Questions — Part 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*19s--QatOQHA44q48Pvfyg.png" /><figcaption>Function Questions — Part 2</figcaption></figure><h3>Conclusion</h3><p>Try an AI tool like Codeium to see if you can help document aspects of code that others will benefit from.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=163810f7fee9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Home Brew on Windows 10]]></title>
            <link>https://suchakjani.medium.com/home-brew-on-windows-10-aa09902f5116?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa09902f5116</guid>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[os-x]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Fri, 28 May 2021 15:20:07 GMT</pubDate>
            <atom:updated>2021-05-29T08:25:46.871Z</atom:updated>
            <content:encoded><![CDATA[<p>Having worked for years on a personal Apple Macbook pro, I recently had to give it away to someone.</p><p>I do have a powerful windows machine, just that it did not have brew, among other things.</p><p>Note: This page assumes you have already turned on Windows Sub system for Linux(WSL), if you have not done so, please see the page below</p><p><a href="https://www.windowscentral.com/install-windows-subsystem-linux-windows-10">Do you want to run Linux on Windows 10? Use WSL, here&#39;s how.</a></p><p><strong>Installing Ubuntu 20</strong></p><p>Go to Microsoft store and install Ubuntu, as simple as that.</p><p><a href="https://ubuntu.com/tutorials/ubuntu-on-windows#1-overview">https://ubuntu.com/tutorials/ubuntu-on-windows#1-overview</a></p><p><strong>Un-Installing older versions of Bash for windows</strong></p><p>I had installed bash on windows 10 many years ago.</p><p>CMD</p><pre>C:\Users\suchak&gt;wsl --list<br>Windows Subsystem for Linux Distributions:<br>Ubuntu-20.04 <br>Legacy (Default)</pre><p><strong>Uninstalling older version</strong></p><p>CMD</p><pre>C:\Users\suchak&gt;wsl --unregister Legacy</pre><p><strong>Check the default installation again</strong></p><p>CMD</p><pre>C:\Users\suchak&gt;wsl --list<br>Windows Subsystem for Linux Distributions:<br>Ubuntu-20.04 (Default)</pre><p><strong>Install and Open a terminal with Terminus</strong></p><p>I used Iterm on my Mac. Wanted something like that on windows. After looking at various versions, I decided to give Terminus a try.</p><p>Have a look at the link below and install terminus.</p><p><a href="https://eugeny.github.io/terminus/">Terminus</a></p><p><strong>Install gcc</strong></p><p>Brew needs gcc</p><p>Using a Terminal in terminus</p><pre>sudo apt install gcc</pre><p><strong>Install Brew using “Homebrew-on-Linux”</strong></p><p>Using a Terminal in terminus</p><p><a href="https://docs.brew.sh/Homebrew-on-Linux">Homebrew on Linux</a></p><p><strong>Initialize Brew</strong></p><p>Using a Terminal in terminus</p><pre>brew install hello</pre><p>All done!</p><p>You have Brew on windows now with a shell</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa09902f5116" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ISO20022 — XSD to JSON Schema [PART 5]]]></title>
            <link>https://suchakjani.medium.com/iso20022-xsd-to-json-schema-part-5-b474d0876c94?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/b474d0876c94</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[iso20022]]></category>
            <category><![CDATA[xml]]></category>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Sun, 21 Feb 2021 19:38:46 GMT</pubDate>
            <atom:updated>2021-02-21T19:38:46.665Z</atom:updated>
            <content:encoded><![CDATA[<h3>ISO20022 — XSD to JSON Schema [PART 5]</h3><h3>Background</h3><p>In this article we will discuss generating a ISO20022 JSON Schema from a XSD Schema.</p><p>There have been other tools that help with this task. However i wanted to test the waters by coding this myself.</p><p>This is the fifth article in a five part series</p><p><a href="https://medium.com/@suchakjani/iso20022-xml-json-basics-4ab18e4c712f">Part One</a></p><p><a href="https://medium.com/@suchakjani/iso20022-xml-json-a-bit-more-detail-ed9250a7c40d">Part Two</a></p><p><a href="https://medium.com/@suchakjani/iso20022-easy-json-8a05ba948946">Part Three</a></p><p><a href="https://suchakjani.medium.com/iso20022-json-schema-part-4-f91ef8f5128a">Part Four</a></p><p>Part Five — This Article</p><h3>Code</h3><p>The code i have written is Kotlin code for JSON Schema Creation from XSD Schema and is available <a href="https://gitlab.com/suchakjani/xsdtojsonschema">here</a> .</p><h3>XSD Schemas used</h3><p>Two XSD Schemas have been taken from the website <a href="https://www.iso20022.org/iso-20022-message-definitions?business-domain=1">https://www.iso20022.org/iso-20022-message-definitions?business-domain=1</a></p><p>You can see the files here: One is<a href="https://gitlab.com/suchakjani/xsdtojsonschema/-/blob/master/src/test/resources/xsd/pacs.008.001.09.xsd"> pacs.008.001.09.xsd</a> and the other is <a href="https://gitlab.com/suchakjani/xsdtojsonschema/-/blob/master/src/test/resources/xsd/camt.050.001.05.xsd">camt.050.001.05</a></p><h3>JSON Schemas Created</h3><p>The Created JSON Schemas are visible here : One is <a href="https://gitlab.com/suchakjani/xsdtojsonschema/-/blob/master/src/test/resources/json-schema/pacs.008.001.09.schema.json">pacs.008.001.09.schema.json</a> and the other is <a href="https://gitlab.com/suchakjani/xsdtojsonschema/-/blob/master/src/test/resources/json-schema/camt.050.001.05.schema.json">camt.050.001.05.schema.json</a></p><h3><strong>Comparison</strong></h3><h4>Lines of Schema— XSD has less lines</h4><p>There seems to be almost double the lines of code in the JSON Schemas as compared to the XSD Schemas</p><h4>Name Spaces — JSON has less (Possible Loss of context ?)</h4><p>JSON has just the id and schema attributes. One of them “Schema” is used for the version of JSON schema, so only one id attribute out of the box for namespaces.</p><p>When converting from an XSD schema there could be loss of context as ISO20022 Schema does have many namespaces as a normal aspect of an XSD schema.</p><p>XSD has many names-spaces for example</p><pre>&lt;xs:schema xmlns=&quot;urn:iso:std:iso:20022:tech:xsd:pacs.008.001.09&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;urn:iso:std:iso:20022:tech:xsd:pacs.008.001.09&quot;&gt;</pre><p>JSON has only two attribute for namespaces</p><pre>&quot;$schema&quot;: &quot;http://json-schema.org/draft-04/schema#&quot;,<br>&quot;id&quot;: &quot;urn:iso:std:iso:20022:tech:xsd:pacs.008.001.09&quot;</pre><h4>Unbounded elements — XSD has unbounded JSON Schema does not have this</h4><p>XSD can have unbounded types</p><pre>&lt;xs:element maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot; name=&quot;ChrgsInf&quot; type=&quot;Charges7&quot;/&gt;</pre><p>JSON cannot have unbounded types</p><pre>&quot;ChrgsInf&quot;: {<br>  &quot;minItems&quot;: 0,<br>  &quot;maxItems&quot;: 999,<br>  &quot;type&quot;: &quot;array&quot;,<br>  &quot;items&quot;: {<br>    &quot;$ref&quot;: &quot;#/definitions/Charges7&quot;<br>  }<br>},</pre><p>Code to change unbounded to 999</p><pre><em>MAXOCCURS </em>-&gt;<br>    when {value.<em>equals</em>(<em>UNBOUNDED</em>, ignoreCase = true) -&gt; complexElement.maximum = 999<br>        else -&gt; complexElement.maximum = Integer.valueOf(value)}</pre><h4>XSD Composition vs JSON Composition</h4><ol><li>XSD has clear composition with simple and complex types with clear choices and sequences</li><li>in JSON Schema, we could build similar structures though they look forced and may not build up quite as well</li></ol><p>XSD — Composition with sequence and complex types</p><pre>&lt;xs:complexType name=&quot;Charges7&quot;&gt;<br>    &lt;xs:sequence&gt;<br>        &lt;xs:element name=&quot;Amt&quot; type=&quot;ActiveOrHistoricCurrencyAndAmount&quot;/&gt;<br>        &lt;xs:element name=&quot;Agt&quot; type=&quot;BranchAndFinancialInstitutionIdentification6&quot;/&gt;<br>    &lt;/xs:sequence&gt;<br>&lt;/xs:complexType&gt;</pre><p>JSON — Supports composition with objects and references but no sequence</p><pre>&quot;Charges7&quot;: {<br>  &quot;type&quot;: &quot;object&quot;,<br>  &quot;properties&quot;: {<br>    &quot;Amt&quot;: {<br>      &quot;$ref&quot;: &quot;#/definitions/ActiveOrHistoricCurrencyAndAmount&quot;<br>    },<br>    &quot;Agt&quot;: {<br>      &quot;$ref&quot;: &quot;#/definitions/BranchAndFinancialInstitutionIdentification6&quot;<br>    }<br>  },</pre><h3>Conclusion</h3><p>Please do have a look at the Gitlab code <a href="https://gitlab.com/suchakjani/xsdtojsonschema">here</a>. By all means feel free to contribute if you would like to do so. Leave me a comment here so i know.</p><p>XSD and JSON are built at different times and maybe for different purposes.</p><p>Fitting an ISO20022 Schema in to a JSON Schema may not convey the same aspects and in some cases we may even loose some information e.g. namespaces, unbounded elements and the like.</p><p>Careful considerations may be needed to make sure that the same business context is conveyed when moving from a XSD Schema to a JSON Schema.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b474d0876c94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Non blocking JDBC — Early 2021 update]]></title>
            <link>https://suchakjani.medium.com/non-blocking-jdbc-early-2021-update-b8b2a24a3b83?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8b2a24a3b83</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[jdbc]]></category>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Sun, 07 Feb 2021 18:50:22 GMT</pubDate>
            <atom:updated>2026-03-29T15:53:03.064Z</atom:updated>
            <content:encoded><![CDATA[<h3>Non blocking JDBC — Early 2021 update</h3><h3>Background</h3><p>This is a Four part series</p><ol><li><a href="https://medium.com/@suchakjani/a-case-for-non-blocking-jdbc-part-one-caeadc80fb7c">Part One</a> — A Case for Asynchronous Non Blocking JDBC — One</li><li><a href="https://suchakjani.medium.com/a-case-for-non-blocking-jdbc-part-two-a8d803f6ed69">Part Two</a> — A Case for Asynchronous Non Blocking JDBC — Two</li><li>Part Three — This page</li><li><a href="https://medium.com/@suchakjani/the-great-reconvergence-why-java-25-just-vindicated-the-blocking-jdbc-pattern-d27843be7f5b">Part Four</a> — Java 25 The Great Reconvergence</li></ol><p>In Part one we went through the details of non blocking calls and event based systems.</p><p>The Part two we went through Java NIO, Java JDBC, and the need for non blocking JDBC.</p><p>This this part we will understand the status of non blocking JDBC as of early 2021.</p><h3>Sections on this page</h3><ol><li>We will have a look at the R2DBC Project</li><li>We will then have a look at Oracle’s stance on non blocking JDBC</li></ol><h3>R2DBC.IO</h3><h3>Key aspects</h3><ol><li>Quoting from the website “The Reactive Relational Database Connectivity (R2DBC) project brings reactive programming APIs to relational databases”</li><li>Supports various databases Google Cloud Spanner, MySQL, PostgreSQL, H2 , MariaDB, Microsoft SQL Server, r MySQL, PostgreSQL</li><li>Has certain “Kotlin” based drivers. Love <a href="https://medium.com/datadriveninvestor/java-futures-and-kotlin-co-routines-a-comparison-4c8fa1e55407">Kotlin</a>.</li><li>Does not have anything for Oracle.</li></ol><h3>Conclusion</h3><p>JDBC has been a API standard for many many years.</p><p>There needs to be an Async Non Blocking Standard for JDBC.</p><p>R2DBC seems to fill this space.</p><h3>Further Reading</h3><p>See <a href="#35d5"><strong>Appendix-1</strong></a> for details on R2DBC</p><h3>R2DBC plus Spring framework</h3><p>Spring framework seems to have taken up the mantle of making it easy to work with reactive streams with its Flux, Mono, WebFlux projects.</p><p>Additionally now it works with R2DBC making it simple to work with reactive JDBC</p><p>Performance tests have consistently shown that WebFlux plus R2DBC is a great combination for all parameters like latency, throughput, CPU usage etc. Please see Appendix-2 for details.</p><h3>Conclusion</h3><p>R2DBC is a new API for reactive, non blocking Database access, across various databases.</p><p>This is not an Oracle supported project, more like a community effort.</p><p>However since it works well with Spring, it is worth considering</p><h3>Further Reading</h3><p>See <a href="#0efb"><strong>Appendix-2</strong></a> for details on Reactive Spring plus R2DBC</p><h3>Oracle ADBA and R2DBC</h3><p>Oracle had started a project sometime in 2018 to bring “Asynchronous Database Access API” to Oracle.</p><p>As of now this project has been discontinued.</p><h3>Conclusion</h3><p>Oracle does not seem to have a non blocking database access API , across many databases, like JDBC anymore.</p><h3>Further Reading</h3><p>See <a href="#a143"><strong>Appendix-3</strong></a> for details on Oracle ADBA start and stop</p><h3>Oracle JDBC Reactive Extensions</h3><p>After Stopping ADBA, Oracle has come up with JDBC Reactive Extensions as a way to address Non Blocking Access to Oracle Database. As of now this is not a community wide Java Standard(Not a Non Blocking Java API for RDBMS access).</p><p>Oracle is convinced that this is the way forward. I have no idea as to why other database vendors are not included in this project.</p><h3>Conclusion</h3><p>Oracle has a released a way to perform non blocking access to the Oracle database as an extension in its JDBC drivers. As of now there is no Oracle Java effort to standardise non blocking API access to RDBMS like JDBC API.</p><h3>Further Reading</h3><p>See <a href="#85c8"><strong>Appendix-4</strong></a> for details on Oracle JDBC Extensions</p><h3>Appendices</h3><h4>Appendix-1 — R2DBC</h4><p><strong><em>R2DBC</em></strong></p><p><a href="https://r2dbc.io/">R2DBC</a></p><p><strong><em>Supported databases by R2DBC</em></strong></p><p><a href="https://r2dbc.io/drivers/">R2DBC</a></p><p><strong><em>Maria R2DBC</em></strong></p><p><a href="https://thenewstack.io/maria-db-gets-reactive-with-a-non-blocking-connector-for-java/">Maria DB Gets Reactive with a Non-Blocking Connector for Java - The New Stack</a></p><p><strong><em>PostgreSQL</em></strong> <strong><em>R2DBC</em></strong></p><p><a href="https://github.com/pgjdbc/r2dbc-postgresql">pgjdbc/r2dbc-postgresql</a></p><h4>Appendix-2 —Reactive Spring plus R2DBC</h4><p><strong><em>Spring support for R2DBC</em></strong></p><p><a href="https://spring.io/projects/spring-data-r2dbc">Spring Data R2DBC</a></p><p><strong><em>Spring webflux with R2DBC performance test</em></strong></p><p><a href="https://technology.amis.nl/software-development/performance-and-tuning/spring-blocking-vs-non-blocking-r2dbc-vs-jdbc-and-webflux-vs-web-mvc/">Spring: Blocking vs non-blocking: R2DBC vs JDBC and WebFlux vs Web MVC</a></p><h4>Appendix-3— <strong><em>ADBA START/STOP</em></strong></h4><p><strong><em>Oracle ADBA Announcement — START</em></strong></p><p><a href="https://blogs.oracle.com/java/jdbc-next:-a-new-asynchronous-api-for-connecting-to-a-database">Asynchronous Database Access API (ADBA)</a></p><p><strong><em>Oracle ADBA Announcement — STOP</em></strong></p><ul><li><a href="https://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/2019-September/000529.html">Oracle stops work on ADBA</a></li><li><a href="https://github.com/r2dbc/r2dbc-over-adba">r2dbc/r2dbc-over-adba</a></li></ul><h4>Appendix-4— Oracle Reactive Extensions</h4><p><strong><em>Oracle Reactive Extensions presentations</em></strong></p><p><a href="https://www.oracle.com/a/tech/docs/dev6323-reactivestreams-fiber.pdf">Streams Fiber PDF-1</a></p><p><a href="https://cdn.ymaws.com/ukoug.org/resource/collection/904331A4-A794-4730-AC6B-6AB8B1DD1E36/JDBC-Reactive-Extensions.pdf">Streams Fiber PDF-2</a></p><p><strong><em>Oracle Reactive Extensions documentation</em></strong></p><ul><li><a href="https://medium.com/oracledevs/oracle-jdbc-drivers-on-maven-central-64fcf724d8b">Oracle JDBC drivers on Maven Central</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/21/jjdbc/jdbc-reactive-extensions.html#GUID-1C40C43B-3823-4848-8B5A-D2F97A82F79B">JDBC Developer&#39;s Guide</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8b2a24a3b83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ISO20022 — JSON Schema [PART 4]]]></title>
            <link>https://suchakjani.medium.com/iso20022-json-schema-part-4-f91ef8f5128a?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f91ef8f5128a</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[iso20022]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[xml]]></category>
            <category><![CDATA[dx]]></category>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Sun, 24 Jan 2021 18:43:38 GMT</pubDate>
            <atom:updated>2021-02-21T19:41:08.413Z</atom:updated>
            <content:encoded><![CDATA[<h3>ISO20022 — JSON Schema [PART 4]</h3><h3>Background</h3><p>In this article we will discuss aspects of the differences in JSON and XML Schema related to validation and security.</p><p>Please know i am not making a judgement on what is the right way. Just pointing out the obvious differences.</p><p>Blame and Guilt are different sides of the the same coin Judgement. I guess it does not help a healthy and open discussion.</p><p>This is the fourth article in a five part series</p><p><a href="https://medium.com/@suchakjani/iso20022-xml-json-basics-4ab18e4c712f">Part One</a></p><p><a href="https://medium.com/@suchakjani/iso20022-xml-json-a-bit-more-detail-ed9250a7c40d">Part Two</a></p><p><a href="https://medium.com/@suchakjani/iso20022-easy-json-8a05ba948946">Part Three</a></p><p>Part Four— This Article</p><p><a href="https://suchakjani.medium.com/iso20022-xsd-to-json-schema-part-5-b474d0876c94">Part Five</a></p><h3>Schema</h3><p><strong>XML Schema</strong></p><p>XML Schema is a well known and understood standard. There are tons of tutorials and tools like the one below:</p><p>See <a href="https://www.w3schools.com/xml/schema_intro.asp"><strong>Link-1</strong></a><strong> </strong>below in references</p><p>There is an organisation which works on maintaining the XML and XML Schema standards, see link below:</p><p>See <a href="https://www.w3.org/XML/Schema"><strong>Link-2</strong></a><strong> </strong>below in references</p><p><strong>Context of XML ISO20022</strong></p><p>ISO20022 also has Message definitions on its website below:</p><p>See <a href="https://www.iso20022.org/iso-20022-message-definitions"><strong>Link-3</strong></a><strong> </strong>below in references</p><p><strong>JSON Schema [Experimental ?]</strong></p><p>JSON Schema seems to not be a well defined Standard as of now.</p><p>Quoting From the “json-schema.org” website as of January 2021 :</p><p>“This book describes JSON Schema draft 7. Earlier versions of JSON Schema are not completely compatible with the format described here, but for the most part, those differences are noted in the text.”</p><p>See<strong> </strong><a href="https://json-schema.org/understanding-json-schema/#"><strong>Link-4</strong></a><strong> </strong>below in references</p><p>On the W3C website we have something but again it looks experimental as of looking at it in January 2021 :</p><p>See<strong> </strong><a href="https://www.w3.org/ns/json-schema"><strong>Link-5</strong></a><strong> </strong>below in references</p><h3><strong>Canonical</strong></h3><p><strong>XML Canonical</strong></p><p>Canonicalisation is a way to make sure two XML that mean to have the same data are considered as same.</p><p>See below :</p><p>See<strong> </strong><a href="https://www.w3.org/TR/xmldsig-core/#sec-XML-Canonicalization"><strong>Link-6</strong></a><strong> </strong>below in references</p><p><strong>XML Canonical Example</strong></p><p>Let’s look at the two addresses below</p><blockquote>Person one</blockquote><pre>&lt;Person&gt;<br>&lt;Name&gt;Suchak Jani&lt;/Name&gt;<br>&lt;Address&gt;108 Thouchstone Road, LightWorld, LovePlanet&lt;/Address&gt;<br>&lt;/Person&gt;</pre><blockquote>Person Two</blockquote><pre>&lt;Person&gt;<br>&lt;Name&gt;Suchak jani<strong>&lt;/Name &gt;</strong><br>&lt;Address&gt;108 Thouchstone Road, LightWorld, LovePlanet<strong>&lt;/Address &gt;</strong><br>&lt;/Person&gt;</pre><p>Are they the same XML ?</p><blockquote>The &lt;/Name&gt; tag has a space at the end in the second one &lt;/Name<strong> &gt; a</strong>nd also the &lt;/Address&gt; tag has a space at the end in the second one &lt;/Address &gt;</blockquote><p>But are they the same XML ?</p><blockquote>For all practical purposes the machine reading them must consider the two as the same XML. This is important for XML Digesting and Signing. Both those XML’s will have the same digest as they would be cannonicalized first.</blockquote><p><strong>Context of ISO20022</strong></p><p>There is a chance that there are unimportant spaces in the tags or end of lines, in ISO20022 XML files.</p><p>It is important to consider the business sense of the messages i.e. if they have the same relevant data - they are the same document regardless of unimportant spaces.</p><p><strong>JSON Canonical</strong></p><p>JSON does not have a definition of canonical</p><p><strong>JSON Canonical Example</strong></p><p>Let’s look at the two addresses below</p><blockquote>Person one</blockquote><pre>{&quot;Person&quot; :<br>&quot;Name&quot; : &quot;Suchak Jani&quot;<br>&quot;Address&quot; : &quot;108 Thouchstone Road, LightWorld, LovePlanet&quot;<br>}</pre><blockquote>Person Two</blockquote><pre>{&quot;Person&quot; :<br>&quot;Name&quot;    : &quot;Suchak Jani&quot;<br>&quot;Address&quot; : &quot;108 Thouchstone Road, LightWorld, LovePlanet&quot;<br>}</pre><p>Are they the same JSON ?</p><blockquote>The “Name” key has extra spaces at the end in the second one.</blockquote><p>But are they the same JSON ?</p><blockquote>For all practical purposes the machine reading them, should consider the two as the same JSON. However if the JSON does not have a Canonicalization processing standard.</blockquote><h3>Signatures</h3><p><strong>XML Security details</strong></p><p>For those interested in details of generating xml security please see these links :</p><p>See <a href="https://www.w3.org/TR/xmldsig-core/"><strong>Link-7</strong></a><strong> </strong>and <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/xmldsig/overview.html"><strong>Link-8</strong></a><strong> </strong>below in references</p><p><strong>XML Security Quick Overview</strong></p><p>Here is the high level logical process for signing</p><p>XML document → Canonicalise the document → Generate HASH(SHA 512 for example) digest → Add “signed info” tag along with the hash digest → Sign the HASH with the “Sender” private key(RSA4096) → Add the generated “Signature” to the “signed info” tag → Add the “signed info” tag to the original xml</p><p>Here is the high level logical process for verification</p><p>Read the “signed info” tag from the incoming xml → Verify the “Signature” with the “Sender” public key and Hash (RSA4096)→Verify the XML HASH (SHA 512 for example) digest against the Canonicalised XML</p><p><strong>JSON Security details</strong></p><p>For those interested in details of generating JSON security please see these links :</p><p><a href="https://tools.ietf.org/html/rfc7515"><strong>Link-9</strong></a><strong> </strong>and <a href="https://medium.facilelogin.com/jwt-jws-and-jwe-for-not-so-dummies-b63310d201a3"><strong>Link-10</strong></a><strong> </strong>below in references</p><p><strong>Two JSON Security Processes</strong></p><p>There are two processes, Yay Choice !</p><p><strong>Process 1: JSON “<em>Compact Serialisation</em>” Security Quick Overview</strong></p><p><strong><em>Format</em></strong></p><p>The format looks like this:</p><pre><strong><em>[JOSE Header].[JWS Payload].[JWS Signature]</em></strong></pre><p><em>NOTE: </em>All of the above is also Base64 encoded.</p><p><strong><em>Serialisation</em></strong></p><p>The process is as below:</p><p>Build a JSON Object with the three sections → In the header specify the correct algorithm and the public key used for signing → Base64 encode the header → Create the payload [can be JSON or NOT JSON !] → Base64 encode the payload → Compute the “signature” over the previous section → Base64 encode the “signature” → Join the three Base64 encoded sections by dots and you get the JWT</p><p><strong>Process 1: <em>JSON “JWS Serialisation”</em> Security Quick Overview</strong></p><p><strong><em>Format</em></strong></p><p>The format looks like this :</p><pre><strong><em>{<br> &quot;payload&quot;: &quot;abcdef1&quot;,<br> &quot;signatures&quot;: [{<br>   &quot;protected&quot;: &quot;abcdef2&quot;,<br>   &quot;header&quot;: {<br>    &quot;kid&quot;: &quot;abcdef3&quot;<br>   },<br>   &quot;signature&quot;: &quot;abcdef4&quot;<br>  },<br>  {<br>   &quot;protected&quot;: &quot;abcdef5&quot;,<br>   &quot;header&quot;: {<br>    &quot;kid&quot;: &quot;abcdef6&quot;<br>   },<br>   &quot;signature&quot;: &quot;abcdef7&quot;<br>  },<br> ]<br>}</em></strong></pre><p><em>NOTE:</em></p><ol><li>All of the above is also Base64 encoded.</li><li>There can be many “signatures”</li></ol><p><strong><em>Serialisation</em></strong></p><p>The process is as below:</p><p>Build a JSON Object with the all sections → Fill in the “payload” [can be JSON or NOT JSON !] → Build the JSON structure based on the number of intended signature → Base64 encode the “payload” → Fill in the “protected” for the first signature[This specifies the first algorithm] → Base64 encode the “protected” → Fill in the “kid” for the first signature[This specifies the first public key] → Base64 encode the “kid” → Sign the payload with the first key and fill in the “signature” → Continue like this with each of the signatures</p><p><strong><em>Variations</em></strong></p><p>There are some variations in the above process which are listed in the links above. But this page is just to get the general idea.</p><h3>Conclusion [ISO20022 XML Schema vs JSON Schema]</h3><p>Both XML and JSON themselves are mature technologies.</p><p>However as seen above here are the differences with respect to representing ISO20022 data represented in XML or JSON.</p><ol><li>XML Schema is a well defined standard. JSON Schema is in the process</li><li>ISO20022 Message XML Schemas have been through a rigorous process of discussion and are well document and specified on the ISO20022 web site. JSON ISO2002 2Message Schemas have not been rigorous process of discussion and are not documented on the ISO20022 web site.</li><li>XML Security and JSON Security are both well defined standards. However as seen above, both are very different in how they approach Security.</li><li>XML Security includes removing spaces(Canonicalisation), to make two messages with the same business data, to be treated the the same way. JSON Security does away with this.</li></ol><h3>References</h3><p><strong>Link-1</strong></p><p><a href="https://www.w3schools.com/xml/schema_intro.asp">XML Schema Tutorial</a></p><p><strong>Link-2</strong></p><p><a href="https://www.w3.org/XML/Schema">XML Schema</a></p><p><strong>Link-3</strong></p><p><a href="https://www.iso20022.org/iso-20022-message-definitions">ISO 20022 Message Definitions | ISO20022</a></p><p><strong>Link-4</strong></p><p><a href="https://json-schema.org/understanding-json-schema/#">Understanding JSON Schema - Understanding JSON Schema 7.0 documentation</a></p><p><strong>Link-5</strong></p><p><a href="https://www.w3.org/ns/json-schema">JSON Schema Version 0.0 Namespace</a></p><p><strong>Link-6</strong></p><p><a href="https://www.w3.org/TR/xmldsig-core/#sec-XML-Canonicalization">XML Signature Syntax and Processing Version 1.1</a></p><p><strong>Link-7</strong></p><p><a href="https://www.w3.org/TR/xmldsig-core/">XML Signature Syntax and Processing Version 1.1</a></p><p><strong>Link-8</strong></p><p><a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/xmldsig/overview.html">XML Digital Signature API Specification (JSR 105)</a></p><p><strong>Link-9</strong></p><p><a href="https://tools.ietf.org/html/rfc7515">RFC 7515 - JSON Web Signature (JWS)</a></p><p><strong>Link-10</strong></p><p><a href="https://medium.facilelogin.com/jwt-jws-and-jwe-for-not-so-dummies-b63310d201a3">JWT, JWS and JWE for Not So Dummies! (Part I)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f91ef8f5128a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka Asynchronous consumers]]></title>
            <link>https://suchakjani.medium.com/kafka-asynchronous-consumers-69a774d18536?source=rss-40dab14536f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/69a774d18536</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[Suchak Jani]]></dc:creator>
            <pubDate>Mon, 20 Jul 2020 18:33:37 GMT</pubDate>
            <atom:updated>2020-07-22T12:01:54.185Z</atom:updated>
            <content:encoded><![CDATA[<h3>Background</h3><p>Kafka use in various projects is increasing by the day. Look at a google trends report : <a href="https://trends.google.com/trends/explore?date=today%205-y&amp;q=%2Fm%2F0zmynvd">https://trends.google.com/trends/explore?date=today%205-y&amp;q=%2Fm%2F0zmynvd</a></p><p>In parallel, the use of Asynchronous Non-Blocking code is also increasing by the day.</p><p>Please read these stories to know more:</p><ul><li><a href="https://medium.com/datadriveninvestor/java-futures-and-kotlin-co-routines-a-comparison-4c8fa1e55407">Java Futures and Kotlin Co-Routines — a comparison</a></li><li><a href="https://medium.com/@suchakjani/a-case-for-non-blocking-jdbc-part-two-a8d803f6ed69">A Case for Non Blocking JDBC — Part Two</a></li><li><a href="https://medium.com/@suchakjani/a-case-for-non-blocking-jdbc-part-one-caeadc80fb7c">A Case for Non Blocking JDBC — Part One</a></li></ul><h3>Messaging Middleware</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*OOwxxKBIN2V33qSv9-0YeQ.jpeg" /><figcaption>Messaging</figcaption></figure><p>As seen above messaging helps decouple two parts of a service based system. The Write Service writes to the messaging middleware and continues its work and the read service reads from the messaging middleware at it’s own pace and does it’s work which in this case happens to be write to a database.</p><p>Examples of messaging middleware are RabbitMQ(AMQP in general), ActiveMQ, Kafka, etc..</p><h3>Kafka Middleware</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*jNYQpiasOhOxci4cySph6A.jpeg" /><figcaption>Kafka</figcaption></figure><p>As seen above Kafka helps decouple two parts of a service based system. The Write Service writes to the Kafka and continues its work and the read service reads from the Kafka at it’s own pace and does it’s work which in this case happens to be write to a database.</p><p>So far so good.</p><h3>Kafka Details</h3><h4>Partitions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*vdISRQXitX2SSoqtpnBtLQ.jpeg" /><figcaption>Kafka Producer consumer</figcaption></figure><p>For simplicity, assume we have a Kafka Producer writing messages to a topic, which has n partitions. Each Partition is read by a consumer. Each consumer writes messages to a database.</p><p>Messages are guaranteed to be ordered within a partition.</p><h4>Synchronous consumer (Messages 1 to 8 in one partition)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*32TOw4dDuFc9Se1ZCPxZsQ.jpeg" /><figcaption>Partition synchronous read</figcaption></figure><p>As seen above the consumer reads each message and stores it into the database. It is a synchronous process and thus each read offset can be committed only after the message is written to the database.</p><h4>Asynchronous consumer (Messages 1 to 8 in one partition, six asyncronous read processes in technologies like kotlin or akka)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*SZ89GQKOz-Qr6KHGyUywMA.jpeg" /><figcaption>Partition asynchronous read</figcaption></figure><p>As seen above the consumer reads each message and stores it into the database.</p><p>It is an asynchronous process.</p><p>Each read offset can still be committed only after the message is written to the database, just like the previous case.</p><p>However because of the asynchronous nature of the process, process 6 could complete before process 1.</p><p>If process 6 commits offset 8, Kafka assumes that the consumer has read all the messages 1 to 8.</p><p>If all the other messages succeed writing to the database, we have no issue.</p><p>However, even if any message(1 to 7) fails writing to the database, still as far as Kafka is concerned those messages(1 to 7) were successfully consumed.</p><h3>Verdict</h3><p>Do we really need asynchronous consumer processing when reading from each Kafka Partition ?</p><p>If the answer is yes, then, the default Auto-Commit may work for happy paths, but we do need to work out as design that will deal with failures.</p><p>Look at each of the use cases for the project in detail.</p><p>For example consider these two use cases</p><ol><li>A text event service where we need to make sure all data is saved</li><li>A price tick event service where the event contains all data, and if a tick is missed then there is no problem.</li></ol><p>In the first use case we do not want to consume a single kafka partition in an asyncronous way.</p><p>In the second use case we do could consume a single kafka partition in an asyncronous way, with a retry in the process itself, when the write to database fails, so as to not loose data. And in this case if the consumer vm crashes, data could be lost but we are om with data loss as per our use case.</p><p>In both use cases muliple consumers on multiple partitions will work fine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69a774d18536" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>