<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Szymon Kaczorowski</title>
    <description>The latest articles on DEV Community by Szymon Kaczorowski (@szymon_kaczorowski).</description>
    <link>https://dev.to/szymon_kaczorowski</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4267465%2F16e1ddd2-b50a-4db5-a385-a26856319da7.png</url>
      <title>DEV Community: Szymon Kaczorowski</title>
      <link>https://dev.to/szymon_kaczorowski</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/szymon_kaczorowski"/>
    <language>en</language>
    <item>
      <title>The Trail That Went Cold: Debugging Silent Spring Boot RSocket Fragmentation Failures</title>
      <dc:creator>Szymon Kaczorowski</dc:creator>
      <pubDate>Sat, 28 Nov 2026 20:37:00 +0000</pubDate>
      <link>https://dev.to/szymon_kaczorowski/the-trail-that-went-cold-debugging-silent-spring-boot-rsocket-fragmentation-failures-2mn3</link>
      <guid>https://dev.to/szymon_kaczorowski/the-trail-that-went-cold-debugging-silent-spring-boot-rsocket-fragmentation-failures-2mn3</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://grupavii.eu/blog/the-trail-that-went-cold/" rel="noopener noreferrer"&gt;The Trail by Grupa VII&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The message came late Wednesday afternoon: "No data is arriving."&lt;/p&gt;

&lt;p&gt;Production. Customers paying hundreds per month for real-time data, data they use to make business decisions, were staring at stale dashboards. Our peer-to-peer RSocket mesh had gone silent.&lt;/p&gt;

&lt;p&gt;Our customer success lead was already fielding calls. The CEO had pinged Slack twice. A Wednesday evening about to disappear into the void.&lt;/p&gt;

&lt;h2&gt;
  
  
  Green Health Checks While Customer Data Stopped
&lt;/h2&gt;

&lt;p&gt;Monitoring dashboards showed healthy connections with services up, heartbeats flowing, and every metric green. But customers weren't getting their data.&lt;/p&gt;

&lt;p&gt;Logs showed nothing: no errors, no warnings. Just successful health checks and the absence of actual payload messages. The connection was alive. The channel was open. Data was being sent. It vanished somewhere in between.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hitting RSocket's 16MB Frame Limit in Debug Logs
&lt;/h2&gt;

&lt;p&gt;I checked the RSocket protocol specification. Our implementation matched the examples. Request streams, bidirectional communication, peer-to-peer topology. All correct.&lt;/p&gt;

&lt;p&gt;Hours of documentation, cross-referencing, staring at code that looked exactly like the examples. With &lt;code&gt;INFO&lt;/code&gt; logs staying completely blank, I finally dropped logging to &lt;code&gt;DEBUG&lt;/code&gt; and found it, hidden among thousands of routine lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CanceledException (0x203): The payload is too big to be send as a single frame
with a max frame length 16777215. Consider enabling fragmentation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;16,777,215 bytes (about 16 megabytes): the RSocket protocol's hard single-frame limit.&lt;/p&gt;

&lt;p&gt;Our batch aggregation normally ran around 2MB, but after a busy day it had grown past the limit. Finally, a clue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why spring.rsocket.server.fragment-size Did Nothing
&lt;/h2&gt;

&lt;p&gt;RSocket uses a 24-bit field for frame length, a hard protocol limit. For payloads over 16MB, you need fragmentation.&lt;/p&gt;

&lt;p&gt;The Spring Boot docs showed the fix:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spring&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;rsocket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;fragment-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1MB&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I deployed the fix and went home thinking the problem was solved.&lt;/p&gt;

&lt;p&gt;The next morning it was still broken, with the same error and the same silent failure. The only new clue:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;io.rsocket.exceptions.ConnectionErrorException: Connection closed unexpectedly
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The config was in place, the documentation followed to the letter, but it was still failing. The YAML looked correct, the IDE autocompleted it, and the docs said it should work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tracing @ConditionalOnProperty in RSocketServerAutoConfiguration
&lt;/h2&gt;

&lt;p&gt;There's a moment in debugging when you realize the documentation isn't going to save you. When the official answer doesn't work and you have to dig deeper. I opened Spring Boot's &lt;code&gt;RSocketServerAutoConfiguration&lt;/code&gt; source.&lt;/p&gt;

&lt;p&gt;The entire server configuration class, the one that would read my &lt;code&gt;fragment-size&lt;/code&gt; property, was wrapped in a conditional (excerpted):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Excerpted from Spring Boot's RSocketServerAutoConfiguration&lt;/span&gt;
&lt;span class="nd"&gt;@ConditionalOnProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"spring.rsocket.server.port"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@Configuration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;proxyBeanMethods&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EmbeddedServerConfiguration&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
    &lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getFragmentSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;factory&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;setFragmentSize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And there it was.&lt;/p&gt;

&lt;p&gt;We were running RSocket over WebSocket, sharing the HTTP port. &lt;code&gt;spring.rsocket.server.port&lt;/code&gt; was never set. The entire configuration class was never loaded. My YAML property was being parsed, validated, and bound to &lt;code&gt;RSocketProperties&lt;/code&gt;, yet never applied to the running server.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What to check:&lt;/strong&gt; A Spring Boot property that parses cleanly and autocompletes in your IDE can still be dead at runtime. Inspect Spring Boot Actuator's &lt;code&gt;/actuator/conditions&lt;/code&gt; report or write an integration test against the actual WebSocket transport to verify that the expected auto-configuration class is active.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Configuring Fragmentation Programmatically on Server and Client
&lt;/h2&gt;

&lt;p&gt;The fix required bypassing the autoconfiguration entirely and configuring fragmentation programmatically on both peers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Configuration&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RSocketConfig&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Bean&lt;/span&gt;
    &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;rSocketServerCustomizer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;RSocketServerCustomizer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
        &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fragment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// 1MB server-side fragments&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nd"&gt;@Bean&lt;/span&gt;
    &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;rSocketConnectorConfigurer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;RSocketConnectorConfigurer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;connector&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
        &lt;span class="n"&gt;connector&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fragment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// 1MB client-side fragments&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I deployed, and data flowed. The batch that had been failing for days went through cleanly. A handful of lines of code, after two days of hunting. The customer success lead could finally stop apologizing.&lt;/p&gt;

&lt;p&gt;Wiring both &lt;code&gt;RSocketServerCustomizer&lt;/code&gt; and &lt;code&gt;RSocketConnectorConfigurer&lt;/code&gt; (or calling &lt;code&gt;.rsocketConnector { it.fragment(1024 * 1024) }&lt;/code&gt; on &lt;code&gt;RSocketRequester.Builder&lt;/code&gt;) ensures both peers fragment large payloads symmetrically without relying on conditional YAML paths that never activate over shared HTTP WebSocket ports.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;WebSocket MTU caveat:&lt;/strong&gt; Reactor Netty defaults to a 64 KB WebSocket &lt;code&gt;maxFramePayloadLength&lt;/code&gt;, so when running RSocket over WebSocket either keep the RSocket fragment MTU at or below &lt;code&gt;65536&lt;/code&gt; bytes or raise Netty's WebSocket frame limit (&lt;code&gt;spring.rsocket.server.spec.max-frame-payload-length&lt;/code&gt; in Boot 3.2+ or a custom &lt;code&gt;WebsocketServerSpec&lt;/code&gt;) to match.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can reproduce this yourself: the &lt;a href="https://github.com/grupavii/trail-that-went-cold" rel="noopener noreferrer"&gt;companion repository&lt;/a&gt; includes tests that prove each stage (large batches failing without config, still failing with YAML config, and succeeding only with the programmatic fix).&lt;/p&gt;

&lt;h2&gt;
  
  
  Trade-Offs and What to Check on Monday
&lt;/h2&gt;

&lt;p&gt;This bug illustrates a systemic risk in modern frameworks: &lt;strong&gt;validated configuration that silently doesn't apply&lt;/strong&gt;, the same class of test-vs-production mismatch that slips through mocked PRs (&lt;a href="https://grupavii.eu/blog/teaching-the-trail/" rel="noopener noreferrer"&gt;Teaching the Trail&lt;/a&gt;). When a &lt;code&gt;@ConditionalOnProperty&lt;/code&gt; gate quietly skips an auto-configuration class for your deployment topology, Spring Boot raises zero warnings at startup.&lt;/p&gt;

&lt;p&gt;Enabling RSocket fragmentation is also a tactical fix with its own trade-off: reassembling 20MB+ fragmented frames buffers memory on both peers and introduces head-of-line pressure on multiplexed streams. If payloads regularly grow into tens of megabytes, treat fragmentation as a safety rail while moving the producer to bounded application-level chunking or streaming smaller records.&lt;/p&gt;

&lt;p&gt;Before the next quiet Wednesday afternoon outage, check three things on Monday:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Monitor customer-visible delivery, not only transport heartbeats.&lt;/strong&gt; Pair liveness metrics with an alert on "zero business payloads delivered within N minutes" for active streams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audit active conditions in staging.&lt;/strong&gt; Pull &lt;code&gt;/actuator/conditions&lt;/code&gt; (or equivalent DI/wiring diagnostics) after changing critical transport, pool, or timeout properties to confirm the target bean actually bound the setting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test ceiling payloads against the real transport in CI.&lt;/strong&gt; Run at least one integration test that pushes a &amp;gt;16MB batch across the actual WebSocket server port rather than an in-memory mock.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In &lt;a href="https://grupavii.eu/blog/reading-the-ground-architecture-review/" rel="noopener noreferrer"&gt;2-week architecture reviews&lt;/a&gt; and &lt;a href="https://grupavii.eu/system-architecture/" rel="noopener noreferrer"&gt;system architecture work&lt;/a&gt;, those deployment assumptions deserve the same scrutiny as service boundaries. Follow the trail from configuration to runtime behavior, and verify that a healthy connection is actually delivering the data customers depend on.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Dealing with silent production failures or framework surprises? Explore our fixed-scope &lt;a href="https://grupavii.eu/architecture-review/" rel="noopener noreferrer"&gt;2-Week Architecture Review&lt;/a&gt; and &lt;a href="https://grupavii.eu/system-architecture/" rel="noopener noreferrer"&gt;System Architecture&lt;/a&gt; services, or &lt;a href="https://grupavii.eu/#contact" rel="noopener noreferrer"&gt;share one bottleneck via the contact form&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>springboot</category>
      <category>debugging</category>
      <category>rsocket</category>
    </item>
  </channel>
</rss>
