Posts Tagged ‘SpringIO2022’
[SpringIO2022] How to foster a Culture of Resilience
Benjamin Wilms, founder of Steadybit, delivered a compelling session at Spring I/O 2022, exploring how to build a culture of resilience through chaos engineering. Drawing from his experience and the evolution of chaos engineering since his 2019 Spring I/O talk, Benjamin emphasized proactive strategies to enhance system reliability. His presentation combined practical demonstrations with a framework for integrating resilience into development workflows, advocating for collaboration and automation.
Understanding Resilience and Chaos Engineering
Benjamin began by defining resilience as the outcome of well-architected, automated, and thoroughly tested systems capable of recovering from faults while delivering customer value. Unlike traditional stability, resilience involves handling partial outages with fallbacks or alternatives, ensuring service continuity. He introduced chaos engineering as a method to test this resilience by intentionally injecting faults—latency, exceptions, or service outages—to build confidence in system capabilities.
Chaos engineering involves defining a steady state (e.g., successful Netflix play button clicks), forming hypotheses (e.g., surviving a payment service outage), and running experiments to verify outcomes. Benjamin highlighted its evolution from a niche practice at Netflix to a growing community discipline, but noted its time-intensive nature often deters teams. He stressed that resilience extends beyond systems to organizational responsiveness, such as detecting incidents in seconds rather than minutes.
Pitfalls of Ad-Hoc Chaos Engineering
To illustrate common mistakes, Benjamin demonstrated a flawed approach using a Kubernetes-based microservice system with a gateway and three backend services. Running a random “delete pod” attack on the hotel service caused errors in the gateway’s product list aggregation, visible in a demo UI. However, the experiment yielded little insight, as it only confirmed the attack’s impact without actionable learnings. He critiqued such ad-hoc attacks—using tools like Pumbaa—for disrupting workflows and requiring expertise in CI/CD integration, diverting focus from core development.
This approach fails to generate knowledge or improve systems, often becoming a “rabbit hole” of additional work. Benjamin argued that starting with tools or attacks, rather than clear objectives, undermines the value of chaos engineering, leaving teams with vague results and no clear path to enhancement.
Building a Culture of Resilience
Benjamin proposed a structured approach to foster resilience, starting with the “why”: understanding motivations like surviving AWS zone outages or ensuring checkout services handle payment downtimes. The “what” involves defining specific capabilities, such as maintaining 95% request success during pod failures or implementing retry patterns. He advocated encoding these capabilities as policies—code-based checks integrated into the development pipeline.
In a demo, Benjamin showed how to define a policy for the gateway service, specifying pod redundancy and steady-state checks via a product list endpoint. The policy, stored in the codebase, runs in a CI/CD pipeline (e.g., GitHub Actions) on a staging environment, verifying resilience after each commit. This automation ensures continuous validation without manual intervention, embedding resilience into daily workflows. Policies include pre-built experiments from communities (e.g., Zalando) or static weak spot checks, like missing Kubernetes readiness probes, making resilience accessible to all developers.
Organizational Strategies and Community Impact
Benjamin addressed organizational adoption, suggesting a central component to schedule experiments and avoid overlapping tests in shared environments. For consulting scenarios, he recommended analyzing past incidents to demonstrate resilience gaps, such as running experiments to recreate outages. He shared a case where a client’s system collapsed during a rolling update under load, underscoring the need for combined testing scenarios.
He encouraged starting with static linters to identify configuration risks and replaying past incidents to prevent recurrence. By integrating resilience checks into pipelines, teams can focus on feature delivery while maintaining reliability. Benjamin’s vision of a resilience culture—where proactive testing is instinctive—resonates with developers seeking to balance velocity and stability.
Links:
[SpringIO2022] Ahead Of Time and Native in Spring Boot 3.0
At Spring I/O 2022 in Barcelona, Brian Clozel and Stéphane Nicoll, both engineers at VMware, delivered a comprehensive session on Ahead Of Time (AOT) processing and native compilation in Spring Boot 3.0 and Spring Framework 6.0. Their talk explored the integration of GraalVM native capabilities, detailing the AOT engine’s design, its use by libraries, and practical steps for developers. Through a live demo, they showcased how to transform a Spring application into a native binary, highlighting performance gains and configuration challenges.
GraalVM Native Compilation: Core Concepts
Brian opened by introducing GraalVM, a versatile JVM supporting multiple languages and optimized Just-In-Time (JIT) compilation. The talk focused on its native compilation feature, which transforms Java applications into standalone binaries for specific CPU architectures. This process involves static analysis at build time, processing all classes on a fixed classpath, and determining reachable code. Benefits include memory efficiency (megabytes instead of gigabytes), millisecond startup times, and suitability for CLI tools, serverless functions, and high-density container deployments.
However, challenges exist. Static analysis may require additional reachability metadata for reflection or resources, as GraalVM cannot always infer runtime behavior. Brian demonstrated a case where reflection-based method invocation fails without metadata, as the native image excludes unreachable code. Debugging is less straightforward than with traditional JVMs, and Java agents, like OpenTelemetry, are unsupported. The speakers emphasized that AOT aims to bridge these gaps, making native compilation accessible for Spring applications.
Spring’s AOT Engine: Design and Integration
Stéphane detailed the AOT engine, a core component of Spring Framework 6.0-M4 and Spring Boot 3.0-M3, designed to preprocess application configurations at build time. Unlike annotation processors, it operates post-compilation, analyzing the bean factory and generating Java code to replace dynamic configuration parsing. This code, viewable in modern IDEs like IntelliJ, mimics hand-written configurations but is automatically generated, preserving package visibility and including Javadoc for clarity.
The engine supports two approaches: contributing reachability metadata for reflection or resources, or generating code to simplify static analysis. For example, a demo CLI application used Spring’s RuntimeHints API to register reflection for a SimpleHelloService class and include a classpath resource. The native build tools Gradle plugin, provided by the GraalVM team, integrates with Spring Boot’s plugin to trigger AOT processing and native compilation. Stéphane showed how the generated binary achieved rapid startup and low memory usage, with configuration classes handled automatically by the AOT engine.
Developer Cookbook: Making Applications Native-Ready
The speakers introduced a developer cookbook to guide Spring users toward native compatibility. The first step is running the application in AOT mode on the JVM, validating the engine’s understanding of the configuration without native compilation. This mode pre-processes the bean factory, reducing startup time and exposing issues early. Next, developers should reuse existing test suites, adapting them for AOT using generated sources and JUnit support. This identifies missing metadata, such as reflection or resource hints.
For third-party libraries or custom code, developers can contribute hints via the RuntimeHints API or validate them using a forthcoming Java agent. The GraalVM team is developing a reachability metadata repository, where the Spring team is contributing hints for popular libraries, reducing manual configuration. For advanced cases, developers can hook into the AOT engine to generate custom code, supported by a test compiler API to verify outcomes. Brian emphasized balancing hints and code generation, favoring simplicity unless performance demands otherwise.
Future Directions and Community Collaboration
The talk concluded with a roadmap for Spring Boot 3.0 and Spring Framework 6.0, targeting general availability by late 2022. The current milestones provide robust AOT infrastructure, with future releases expanding support for Spring libraries. The speakers highlighted collaboration with the GraalVM team to simplify native adoption and plans to align with Project Leyden for JVM optimizations. They encouraged feedback via the Spring I/O app and invited developers to explore the demo repository, which includes Maven and Gradle configurations.
This session equipped developers with tools to leverage AOT and native compilation, unlocking new use cases like serverless and high-density deployments while maintaining Spring’s developer-friendly ethos.
Links:
[SpringIO2022] Major Migrations Made Easy with OpenRewrite
Tim te Beek’s Spring I/O 2022 session introduced OpenRewrite, a powerful tool for automating large-scale Java migrations. As a Java consultant at JDriven, Tim shared his passion for updating outdated technology stacks, using OpenRewrite to streamline upgrades across frameworks, libraries, and languages. His talk, delivered on his birthday, combined a compelling narrative with a live demo, showcasing how OpenRewrite transforms tedious migrations into quick, safe operations.
The Migration Challenge: Keeping Up with Open Source
Tim opened with a decade-long perspective on Java and Spring evolution, from Spring Framework 2.5 in 2009 to Java 17 and Spring Boot 2 in 2022. Each release—Java 8’s lambdas, Spring Boot’s reduced boilerplate, JUnit 5, or Java 11’s JAX-B dependencies—introduced valuable features but required manual upgrades across multiple services. Vulnerabilities like Log4Shell further necessitate rapid migrations, often under pressure. For large organizations with thousands of services, manual updates are impractical, making automation essential.
OpenRewrite addresses this by leveraging an abstract syntax tree (AST) to perform precise, safe refactorings. Unlike simple search-and-replace, it understands code context, preserving formatting and ensuring functional integrity. Tim emphasized its ability to handle migrations like JUnit 4 to 5, Log4j to SLF4J, or Spring Boot 1 to 2, reducing technical debt in minutes.
How OpenRewrite Works: Recipes and AST Magic
OpenRewrite’s core strength lies in its recipe-based approach. Recipes are modular, reusable transformations—implemented as Java visitors—that modify the AST. Tim explained how recipes range from simple (changing imports) to complex (converting JUnit 4’s expected exceptions to JUnit 5’s assertThrows). These can be combined into modules for tasks like framework upgrades or style enforcement. The tool supports Java, Groovy, YAML, and XML, enabling changes to Maven/Gradle builds and Spring configurations.
A key differentiator is OpenRewrite’s type attribution and format preservation, ensuring changes blend seamlessly with existing code. Tim’s demo illustrated this by migrating a Spring Pet Clinic project from Spring Boot 1.5 (Java 8) to Spring Boot 2.5 (Java 17). Using Maven’s OpenRewrite plugin, he applied recipes to update dependencies, imports, annotations, and properties, completing the migration in under 15 seconds per step, with only two minor test failures requiring manual fixes.
Spring Boot Migrator: Enhancing OpenRewrite
Tim introduced Spring Boot Migrator, an experimental Spring project built on OpenRewrite, designed to simplify migrations to Spring Boot. Initiated by VMware Labs in 2020 and led by Fabian Krüger, it offers an opinionated API for Spring-specific migrations, such as Java EE to Spring or NetWeaver to Spring Integration. Unlike OpenRewrite’s fully automated recipes, Spring Boot Migrator provides an interactive workflow, generating HTML reports to guide developers through component identification and transformation steps.
Looking ahead, Spring Boot Migrator aims to support Spring Framework 6 and Spring Boot 3, expected in November 2022, and facilitate cloud migrations to GraalVM. Tim encouraged community contributions, noting its role in easing enterprise migrations for VMware customers.
Impact and Community: Scaling Automation
OpenRewrite’s open-source model, backed by Moderne, ensures all recipes are Apache-licensed, fostering community-driven development. Tim highlighted its use in fixing static analysis issues (e.g., Checkstyle, Sonar), enforcing code style, and contributing to open-source projects like WireMock and Apache Maven. He shared his experience migrating thousands of unit tests, urging attendees to explore OpenRewrite’s web interface (app.moderne.io) and contribute recipes.
Tim’s talk inspired developers to embrace automation, reducing migration pain and enabling focus on innovation. His enthusiasm for OpenRewrite’s potential to transform development workflows resonated strongly with the audience.
Links:
[SpringIO2022] Distributed Systems Patterns with Spring Cloud, Service Meshes, and eBPF
At Spring I/O 2022 in Barcelona, Matthias Haeussler delivered an insightful session exploring distributed systems patterns, comparing Spring Cloud, Kubernetes, service meshes, and the emerging eBPF technology. As a consultant at Novatec and a university lecturer, Matthias combined theoretical clarity with a live demo to illustrate how these technologies address challenges like service discovery, routing, and resilience in distributed architectures. His talk offered a practical guide for developers navigating modern microservice ecosystems.
Why Distributed Systems? Understanding the Motivation
Matthias began by addressing the rationale behind distributed systems, emphasizing their ability to enhance client experiences—whether for human users or other applications. By breaking systems into smaller components, developers can execute tasks in parallel, manage heterogeneous environments, and ensure scalability. For instance, running multiple Java versions (e.g., Java 11 and 17) in a single application server is impractical, but distributed systems allow such flexibility. Matthias also highlighted resilience benefits, such as load balancing, traffic throttling, and blue-green deployments, which minimize downtime and maintain system health under varying loads. Security, including authentication and authorization, further underscores the need for distributed architectures to protect and scale services effectively.
However, these benefits come with challenges. Distributed systems require robust mechanisms for service discovery, traffic management, and observability. Matthias framed his talk around comparing how Spring Cloud, Kubernetes, service meshes, and eBPF tackle these requirements, providing a roadmap for choosing the right tool for specific scenarios.
Spring Cloud and Kubernetes: Framework vs. Orchestration
Spring Cloud, dubbed the “classic” approach, integrates distributed system features directly into application code. Matthias outlined key components like Eureka (service registry), Spring Cloud Gateway (routing), and Resilience4j (circuit breaking), which rely on dependencies, annotations, and configuration properties. This in-process approach makes Spring Cloud independent of the runtime environment, allowing deployment on single machines, containers, or clouds without modification. However, changes to dependencies or code require rebuilding, which can slow iterations.
In contrast, Kubernetes offers native orchestration for distributed systems, with its own service registry (DNS), load balancing (via Kubernetes Services), and configuration (ConfigMaps/Secrets). Matthias explained how Spring Cloud Kubernetes bridges these worlds, enabling Spring applications to use Kubernetes’ registry without code changes. For example, annotating with @EnableDiscoveryClient queries Kubernetes’ DNS instead of Eureka. While Kubernetes excels at scaling and deployment, it lacks advanced traffic control (e.g., circuit breaking), where Spring Cloud shines. Matthias suggested combining both for a balanced approach, leveraging Kubernetes’ orchestration and Spring Cloud’s resilience patterns.
Service Meshes: Network-Level Control
Service meshes, such as Istio, introduce a new paradigm by injecting proxy sidecars into Kubernetes pods. Matthias described how these proxies handle network traffic—routing, encryption, and throttling—without altering application code. This separation of concerns allows developers to manage traffic policies (e.g., mutual TLS, percentage-based routing) via YAML configurations, offering granular control unavailable in base Kubernetes. A live demo showcased Istio’s traffic distribution for a Spring Pet Clinic application, visualizing load balancing between service versions.
However, service meshes add overhead. Each pod’s proxy increases latency and memory usage, and managing configurations across scaled deployments can become complex—hence the term “service mess.” Matthias cautioned against adopting service meshes unless their advanced features, like fault injection or network policies, are necessary, especially for simpler Spring Cloud Gateway setups.
eBPF: A Lightweight Future for Service Meshes
The talk’s final segment introduced eBPF (extended Berkeley Packet Filter), a Linux kernel technology enabling low-level network event processing. Unlike service meshes, eBPF injects proxies at the node level, reducing overhead compared to per-pod sidecars. Matthias likened eBPF to JavaScript for HTML, embedding sandboxed code in the kernel to monitor and manipulate traffic. Tools like Cilium leverage eBPF for Kubernetes, offering observability, encryption, and routing with minimal latency.
In his demo, Matthias contrasted Istio and Cilium, showing Cilium’s Hubble UI visualizing traffic for the Spring Pet Clinic. Though still nascent, eBPF promises a sidecar-less service mesh, simplifying deployment and reducing resource demands. Matthias noted its youth, with features like encryption still in beta, but predicted growing adoption as tools mature.
Conclusion: Choosing the Right Approach
Matthias concluded without a definitive recommendation, urging developers to assess their needs. Spring Cloud offers simplicity and runtime independence, ideal for smaller setups. Kubernetes and service meshes suit complex, containerized environments, while eBPF represents a lightweight, future-proof option. His talk underscored the importance of aligning technology choices with project requirements, leaving attendees equipped to evaluate these patterns in their own systems.
Links:
[SpringIO2022] Cloud-Native Healthcare Data Integration with Dapr
Jake Smolka’s Spring I/O 2022 talk offered a compelling case study on building a cloud-native healthcare data integration platform using Dapr, the Distributed Application Runtime. As a health information specialist, Jake shared his journey transforming a Spring Boot prototype into a Kubernetes-based microservice architecture, leveraging Dapr to simplify complexity. His session blended domain insights with technical depth, appealing to both microservice novices and seasoned developers.
Healthcare Data: The Complexity of Interoperability
Jake began with a primer on healthcare data, emphasizing its role in improving clinical outcomes. Clinical data, like blood pressure readings, supports primary care (e.g., diagnoses) and secondary use (e.g., research in university hospitals). However, interoperability remains a challenge due to legacy systems and incompatible standards. Hospitals often manage decades-old data alongside modernized systems, complicating data exchange between clinics. Jake highlighted two standards: OpenEHR, which focuses on semantic interoperability through clinical modeling, and FHIR, designed for lean data exchange. In Catalonia, where the conference was held, public healthcare is shifting to OpenEHR, underscoring its growing importance.
The complexity arises from mismatched standards and real-world data deviations, as illustrated by a colleague’s meme about idealized specifications versus chaotic reality. Jake’s project, FireConnect, aims to bridge OpenEHR and FHIR, enabling bidirectional data mapping for reusable clinical concepts like medication dosages or growth charts. This domain knowledge set the stage for the technical challenges of building a scalable, interoperable solution.
From Prototype to Microservices: The Spring Boot Journey
Jake recounted FireConnect’s evolution, starting as a monolithic Spring Boot application written in Kotlin with Apache Camel for integration. This prototype validated the concept of mapping clinical data but lacked scalability and future-proofing. Stakeholders soon demanded cloud-native features, agnostic deployment, and customer flexibility. Jake adopted Spring Cloud to introduce microservices, incorporating service discovery, load balancing, and distributed configuration. However, the resulting architecture grew unwieldy, with complex internal dependencies (illustrated by a “horror show” diagram). He found himself spending more time managing infrastructure—Kafka, resiliency, and configurations—than writing business logic.
Spring Cloud’s JVM-centric nature limited its agnosticism in mixed-language environments, and its binders (e.g., for Kafka or RabbitMQ) introduced dependencies. Jake realized that while Spring Cloud suited homogeneous Spring ecosystems, FireConnect needed a more flexible, infrastructure-agnostic solution to meet diverse customer needs and simplify development.
Dapr: Streamlining Distributed Systems
Enter Dapr, a Cloud Native Computing Foundation project that abstracts microservice complexities through a sidecar model. Jake introduced Dapr’s building blocks—state management, pub/sub, service invocation, and more—accessible via a simple HTTP/gRPC API. These pluggable components allow applications to switch backends (e.g., RabbitMQ to AWS SQS) without code changes, supporting any language or framework. Dapr’s sidecar offloads tasks like retries, timeouts, and distributed tracing, freeing developers to focus on logic. Observability is built-in, with OpenTelemetry for tracing and metrics, and resiliency features like circuit breakers are preconfigured.
In a demo, Jake showcased a pub/sub quickstart, where a Spring Boot application published orders to a queue, processed by another service via Dapr’s sidecar. The Java SDK’s @Topic annotation integrated seamlessly with Spring, requiring minimal configuration. This setup highlighted Dapr’s ability to simplify communication and ensure portability across clouds or on-premises environments, aligning with FireConnect’s agnostic deployment goals.
FireConnect’s Dapr-Powered Future
Applying Dapr to FireConnect, Jake rearchitected the application for simplicity and scalability. The core translation component now communicates via Dapr’s pub/sub and state management, with pluggable facades for FHIR or OpenEHR APIs. External triggers, like Azure Event Hubs, integrate effortlessly, enhancing flexibility. The leaner architecture reduces infrastructure overhead, allowing Jake to prioritize clinical data mapping over managing glue components. Deployable on Kubernetes or bare metal, FireConnect meets customer demands for platform choice.
Jake’s talk inspired attendees to explore Dapr for distributed systems and consider healthcare data challenges. As his first conference presentation, it was a passionate call to bridge technology and healthcare for better patient outcomes.
Links:
[SpringIO2022] JobRunr: Simplifying Distributed Job Scheduling with Spring
At Spring I/O 2022 in Barcelona, Ronald Dehuysser introduced JobRunr, an open-source Java library designed to streamline distributed background job processing. His engaging session, blending practical insights with live coding, showcased how JobRunr empowers developers to transform Java 8 lambdas into scalable, fault-tolerant jobs without complex infrastructure. Tailored for businesses handling moderate data volumes, Ronald’s talk highlighted JobRunr’s seamless integration with Spring and its potential to revolutionize job scheduling.
The Genesis of JobRunr: Solving Real-World Challenges
Ronald, a contractor from Belgium, kicked off by sharing the origins of JobRunr, born from a challenging “greenfield” fintech project. Tasked with building an invoicing platform on Google Cloud, he encountered a microservice architecture plagued by issues: no retry mechanisms, poor monitoring, and lost invoices due to untracked failures. The project’s eight microservices led to code duplication, prompting Ronald to question the microservice hype and advocate for simpler, modular monoliths. Frustrated by the lack of developer-friendly, open-source job scheduling tools, he created JobRunr to address these gaps, emphasizing ease of use, existing infrastructure, and automatic retries.
JobRunr’s philosophy is rooted in simplicity and practicality. Unlike solutions requiring heavy infrastructure like Apache Kafka or vendor-specific cloud services, JobRunr leverages SQL or NoSQL databases for persistence, making it embeddable with a single JAR. Ronald stressed that most businesses don’t need to process terabytes daily like tech giants. Instead, JobRunr targets complex business processes with gigabytes of data, offering a plug-and-play solution with built-in monitoring and fault tolerance.
Core Features: From Lambdas to Distributed Jobs
The heart of JobRunr lies in its ability to convert Java 8 lambdas into distributed background jobs. Ronald demonstrated this with a Spring service example, where a static BackgroundJob.enqueue method schedules jobs without altering existing code. Jobs are serialized as JSON, stored in a database, and processed by BackgroundJobServer instances across JVMs, enabling horizontal scaling in Kubernetes. A dashboard provides real-time insights into job status, with automatic retries (up to 10 by default) using an exponential backoff policy to handle failures gracefully.
For scheduling flexibility, JobRunr supports immediate, delayed, or recurring jobs. Ronald showcased the schedule API for jobs running after a delay (e.g., 24 hours) and the scheduleRecurrently method for daily tasks, using a readable Cron class to simplify cron expressions. The dashboard allows manual triggering of recurring jobs for testing, enhancing developer control. To prevent duplicate processing, JobRunr offers mutex support, though advanced features like this are part of the paid Pro version, balancing open-source accessibility with sustainability.
Under the Hood: Bytecode Magic and Spring Native
Delving into JobRunr’s internals, Ronald revealed its use of ASM for bytecode manipulation, translating lambdas into executable jobs. While some criticized this as “black magic,” he countered with assurances of binary compatibility, backed by Oracle’s Java Language Specification and his participation in Oracle’s Quality Outreach Program. JobRunr’s compatibility spans Java 8 to 17, tested across JVMs using Testcontainers, ensuring robustness. The introduction of JobRequest and JobRequestHandler in version 4 further simplifies job definition, aligning with the command handler pattern for explicit job processing.
A highlight was JobRunr’s integration with Spring Native, enabling compilation to GraalVM native images for millisecond startup times and low memory usage. Ronald collaborated with the Spring team to ensure reflection compatibility, making JobRunr a natural fit for cloud-native deployments. The live coding demo, despite minor hiccups, showcased JobRunr’s ease of use: Ronald built an uptime monitoring service, scheduling recurring website checks with a few lines of code, monitored via the dashboard. This practicality resonated with attendees, who appreciated JobRunr’s developer-friendly approach.
Impact and Future: Empowering Developers
JobRunr’s adoption spans medical image processing, web crawling, and document generation, with 30,000 monthly Maven downloads. Ronald shared a compelling anecdote: a company reported a 20% developer productivity boost by using the dashboard’s requeue feature for first-line support, reducing interruptions. Looking ahead, JobRunr aims to enhance GraalVM support, add OpenID Connect for dashboard authentication, and incorporate community-driven features. The Pro version funds development, with 5% of profits supporting environmental causes like tree planting.
Ronald’s session underscored JobRunr’s mission to simplify distributed job scheduling, making it an invaluable tool for Spring developers tackling real-world business challenges with minimal overhead.