Recent Posts
Archives

Posts Tagged ‘Polyglot’

PostHeaderIcon [SpringIO2026] Bootiful gRPC

Lecturer

Dr. Dave Syer is a founder of Spring Boot, Spring Cloud and Spring Batch, and the lead of the Spring gRPC project. He has long contributed to Spring Security OAuth, Spring Integration and many other portfolio projects. Josh Long is the Spring Developer Advocate at Broadcom (VMware Tanzu), a prolific speaker, author and live-coder known for demonstrating the full breadth of the Spring ecosystem. Together they present the new first-class Spring integration for gRPC.

Abstract

gRPC offers schema-driven, polyglot, high-performance remote procedure calls. After community implementations slowed, Google encouraged the Spring team to create an official project. Spring gRPC, now at version 1.x and moving its Boot auto-configuration into Spring Boot itself, supplies starters, code-generation plugins, Netty and servlet transports, observability, health checks and seamless OAuth 2 resource-server and client support. This article walks through the live demonstration given by Dave Syer and Josh Long, highlighting the developer experience from protocol-buffer definition to a secured, observable service and client pair.

Why gRPC and the Spring Integration

Remote procedure call has a chequered history, yet gRPC addresses many historical weaknesses. An Interface Definition Language (Protocol Buffers) forces an explicit contract; the same .proto file generates idiomatic stubs in dozens of languages, satisfying polyglot organisations; the binary encoding and a purpose-built Netty server deliver competitive throughput. Existing community Spring integrations had lost momentum, prompting Google to ask the Spring team to take ownership. The resulting Spring gRPC project began as an experimental zero-point release train aligned with Spring Boot 3 and reached 1.0 with Spring Boot 4, gaining the usual long-term support commitments. Auto-configuration is scheduled to move into Spring Boot proper in the 4.1 timeframe, further reducing boilerplate.

From Protocol Buffer to Running Service

A new project is created on start.spring.io by selecting the gRPC server starter (and optionally security and observability). The generated build already contains the Protocol Buffer Maven or Gradle plugin and the necessary dependency management. A simple greetings.proto declares a service with a unary RPC:

syntax = "proto3";
option java_package = "com.example.grpc";
service Greetings {
  rpc Hello (HelloRequest) returns (HelloResponse);
}
message HelloRequest { string name = 1; }
message HelloResponse { string message = 1; }

After code generation the developer extends the generated base class, annotates it as a Spring @Service (or lets component scanning discover it) and implements the method. The Netty-based gRPC server starts automatically on port 9090; if a servlet container is also present the same service can be exposed through the Google-supplied servlet bridge, sharing the HTTP port with ordinary Spring MVC endpoints.

A client project follows the same path. The generated stub is injected as a Spring bean; an HTTP controller can call it exactly as it would call any other collaborator. Because the contract is shared, the two sides remain type-safe even when they live in separate processes.

Observability, Health and Security

Selecting the OpenTelemetry starter on the Initializr causes metrics and traces to be exported automatically; Grafana dashboards immediately show gRPC-specific meters. The standard gRPC health-checking protocol is wired to Spring Boot Actuator’s health indicators, so a Kubernetes gRPC probe reports the same status that an HTTP actuator endpoint would.

Security integration re-uses Spring Security’s OAuth 2 resource-server and client support. On the server side a JWT or opaque-token resource-server configuration protects every RPC. On the client side an interceptor extracts the current OAuth2AuthenticationToken, obtains an access token via the OAuth2AuthorizedClientManager, and attaches it to the outgoing gRPC metadata. The demonstration completes the round-trip: an unauthenticated browser request is redirected to the authorization server, the resulting token is presented to the gRPC service, and the service replies with a greeting that includes the authenticated principal’s name.

The same patterns work with reactive gRPC stubs and with Kotlin, giving teams a uniform programming model across transport and language choices.

Conclusion and Roadmap

Spring gRPC removes the historical friction of adopting gRPC inside a Spring application: starters, automatic code generation, sensible server and client defaults, first-class observability and security. Future work includes deeper controller-style programming models for developers who prefer POJO annotations over generated stubs, and the final migration of auto-configuration into Spring Boot itself. The project already demonstrates that a binary, schema-first RPC technology can feel as natural in the Spring ecosystem as REST or messaging.

Links:

PostHeaderIcon [DevoxxBE2013] Introducing Vert.x 2.0: Taking Polyglot Application Development to the Next Level

Tim Fox, the visionary project lead for Vert.x at Red Hat, charts the course of this lightweight, high-performance application platform for the JVM. With a storied tenure at JBoss and VMware—where he spearheaded HornetQ messaging and RabbitMQ integrations—Tim unveils Vert.x 2.0’s maturation into an independent powerhouse. His session delves into the revamped module system, Maven/Bintray reusability, and enhanced build tool/IDE synergy, alongside previews of Scala, Clojure support, and Node.js compatibility.

Vert.x 2.0 empowers polyglot, reactive applications, blending asynchronous eventing with synchronous legacy APIs via worker verticles. Tim’s live demos illustrate deploying modules dynamically, underscoring Vert.x’s ecosystem for mobile, web, and enterprise scalability.

Core API Refinements and Asynchronous Foundations

Tim highlights Vert.x’s event-driven core, refined in 2.0 with intuitive APIs for non-JVM languages. He demonstrates verticles—lightweight actors—for handling requests asynchronously, avoiding blocking calls.

This reactive model, Tim explains, scales to thousands of connections, ideal for real-time web apps, contrasting traditional thread-per-request pitfalls.

Module System and Ecosystem Expansion

The new module system, Tim showcases, leverages Maven repositories for seamless dependency management. He deploys a web server via module names, pulling artifacts from Bintray—eliminating manual installations.

This reusability fosters a vibrant ecosystem, with core modules for HTTP, MySQL (via reversed-engineered async drivers), and more, enabling rapid composition.

Build Tool and IDE Integration

Vert.x 2.0’s Maven/Gradle plugins streamline development, as Tim demos: configure a pom.xml, run mvn vertx:run, and launch a cluster. IDE support, via plugins, offers hot-reloading and debugging.

These integrations, Tim notes, lower barriers, allowing developers to iterate swiftly without Vert.x-specific tooling.

Polyglot Horizons: Scala, Clojure, and Node.js

Tim previews Scala/Clojure bindings, enabling functional paradigms on Vert.x’s event bus. Node.js compatibility, via drop-in modules, bridges JavaScript ecosystems, allowing polyglot teams to collaborate seamlessly.

This inclusivity, Tim asserts, broadens Vert.x’s appeal, supporting diverse languages without sacrificing performance.

Worker Verticles for Legacy Compatibility

For synchronous APIs like JDBC, Tim introduces worker verticles—executing on thread pools to prevent blocking. He contrasts with pure async MySQL drivers, offering flexibility for hybrid applications.

This pragmatic bridge, Tim emphasizes, integrates existing Java libraries effortlessly.

Links: