Spring Boot Exposed Workshop
Latest stable Based on AWS release 0.4.0
A runnable workshop grounded in the 0.4.0 release source.
Learning goal
Section titled “Learning goal”Connect Spring Boot 4 MVC to an AWS-configurable Hikari/Exposed JDBC database while keeping HTTP status, transaction ownership, schema setup, and query code in separate components.
When to use this workshop
Section titled “When to use this workshop”Use it when a Spring application needs Exposed JDBC and wants database settings to be replaceable by Secrets Manager, Parameter Store, environment values, or RDS IAM.
Project coordinates
Section titled “Project coordinates”This example is not published. Run ./gradlew :aws-spring-boot-exposed-examples:test. Applications use the central BOM with bluetape4k-aws-spring-boot, bluetape4k-aws-exposed, Exposed JDBC, HikariCP, and a driver.
Concepts to learn
Section titled “Concepts to learn”OrderController owns HTTP semantics, OrderService owns transaction(database), OrderRepository owns Exposed queries, and OrderSchemaInitializer creates the table after the auto-configured Database is available.
Staged walkthrough
Section titled “Staged walkthrough”- Read the table and repository mapping.
- Follow controller calls into service-owned transactions.
- Inspect auto-configured registry, data source, and
Databasebeans. - Run the PostgreSQL Testcontainers test.
- Replace direct test settings with an application configuration source without moving secret reads into repositories.
Entry points and expected behavior
Section titled “Entry points and expected behavior”SpringBootExposedExampleApplication starts the service. POST /orders returns 201; GET /orders/{id} returns one order or 404; list accepts an optional customerId filter.
Recommended exercise order
Section titled “Recommended exercise order”Keep one transaction per business operation and keep repositories unaware of Spring and AWS clients. Apply schema migrations before readiness rather than scattering DDL across request paths.
Integration boundary
Section titled “Integration boundary”AwsExposedAutoConfiguration creates a closeable registry and exposes default DataSource and Database beans. Spring owns those resources; Exposed repositories use an already active transaction.
Configuration checkpoints
Section titled “Configuration checkpoints”Set JDBC URL, driver, username, password, and Hikari pool limits under bluetape4k.aws.exposed.default-database. Production sources may resolve these values before bean creation.
Failure modes
Section titled “Failure modes”Driver mismatch, bad credentials, unavailable configuration source, pool exhaustion, migration failure, and repository calls outside a transaction are the main failures.
Operations
Section titled “Operations”Monitor pool acquisition, active/idle connections, transaction errors, and query latency. Refresh expiring credentials through a deliberate pool replacement and let Spring close the registry once.
Testing the boundary
Section titled “Testing the boundary”SpringBootExposedExampleApplicationTest starts PostgreSQL, verifies registry/data source/database beans, and covers HTTP create, read, list, filtering, and not-found behavior on a random port.
Next learning path
Section titled “Next learning path”Compare the Ktor Exposed workshop for plugin-managed transactions, then continue with the bluetape4k-exposed manual for repository and transaction patterns.
Limitations
Section titled “Limitations”The test does not call AWS configuration services or RDS IAM and does not prove TLS, migration tooling, credential rotation, or production pool sizing.
Release diagrams
Section titled “Release diagrams”These diagrams are loaded directly from README assets published with the 0.4.0 release and pinned to its immutable commit. They describe this manual’s released structure and runtime flows, not later Snapshot changes. Select a preview to open the SVG at the same release commit.
aws spring boot exposed examples Architecture diagram
Section titled “aws spring boot exposed examples Architecture diagram”Release README: examples/aws-spring-boot-exposed-examples/README.md
