Retrofit 2 Coroutine Extensions
Latest stable Based on Bluetape4k release 1.11.0
Problem
Section titled “Problem”bluetape4k-retrofit2 is a module that extends Retrofit2 with Kotlin DSL and Coroutines support. This manual connects that purpose to the current build, source entry points, tests, configuration resources, and lifecycle evidence instead of duplicating the README feature list.
When to use
Section titled “When to use”Use bluetape4k-retrofit2 when the application needs encoding boundaries, resource ownership, streaming, compatibility, and malformed input. Start with the source entry points below and confirm that their ownership and failure contracts match the calling component. Prefer a smaller standard-library or already-adopted module when it satisfies the same contract without another runtime boundary.
Coordinates
Section titled “Coordinates”dependencies { implementation(platform("io.github.bluetape4k:bluetape4k-dependencies:<version>")) implementation("io.github.bluetape4k:bluetape4k-retrofit2")}Gradle project path: :bluetape4k-retrofit2. Source directory: io/retrofit2.
Concepts
Section titled “Concepts”The first source-level concepts to inspect are ExceptionSupport, RetrofitCallSupport, RetrofitSupport, SuspendRetrofitCallSupport, Hc5CallFactory, Hc5OkHttp3Support, VertxCallFactory, and VertxOkHttp3Support. File names are navigation anchors; read each declaration and its tests before treating it as a public contract.
Quick start
Section titled “Quick start”Add the coordinate above, refresh Gradle, and start from the smallest entry point that owns the required task. Open ExceptionSupport first; it is a concrete source entry point for the module.
API by task
Section titled “API by task”| Entry point | What to verify |
|---|---|
ExceptionSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
RetrofitCallSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
RetrofitSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
SuspendRetrofitCallSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
Hc5CallFactory | Inspect this declaration’s constructors, functions, and ownership contract. |
Hc5OkHttp3Support | Inspect this declaration’s constructors, functions, and ownership contract. |
VertxCallFactory | Inspect this declaration’s constructors, functions, and ownership contract. |
VertxOkHttp3Support | Inspect this declaration’s constructors, functions, and ownership contract. |
ResultCall | Inspect this declaration’s constructors, functions, and ownership contract. |
ResultCallAdapterFactory | Inspect this declaration’s constructors, functions, and ownership contract. |
Patterns
Section titled “Patterns”The README evidence is organized around Overview, Architecture, Retrofit2 Module Architecture, Retrofit2 + Result Pattern Integration, Suspend Result HTTP Request Flow, Key Features, 1. Retrofit Builder DSL, 2. Result Pattern Support, 3. Coroutines Support, and 4. Multiple HTTP Backends (CallFactory). Use those topics as a navigation map, then confirm behavior in source and tests. Keep adoption narrow and connect owned resources to the caller lifecycle.
Integrations
Section titled “Integrations”The current build declares these integration edges:
implementation(platform(libs.spring.boot.dependencies))api(project(":bluetape4k-http"))api(project(":bluetape4k-okio"))api(project(":bluetape4k-netty"))api(project(":bluetape4k-coroutines"))compileOnly(libs.kotlinx.coroutines.core)compileOnly(libs.kotlinx.coroutines.reactive)compileOnly(libs.kotlinx.coroutines.reactor)api(libs.retrofit2)api(libs.retrofit2.converter.jackson)api(libs.retrofit2.converter.scalars)api(libs.retrofit2.adapter.java8)Treat compileOnly edges as caller-provided capabilities and verify runtime availability before using their APIs.
Configuration
Section titled “Configuration”No module-level configuration resource was found under src/main/resources. Configuration is supplied through constructors, builders, function arguments, or the integrating framework; confirm defaults in source.
Failures
Section titled “Failures”Failure semantics are defined by the linked entry points and tests, not inferred from the artifact name. Keep cancellation and timeout signals intact, close owned resources, and translate backend exceptions only at a boundary that can add a stable domain contract. Use the test anchors below to verify the exact behavior before adding retries or fallbacks.
Operations
Section titled “Operations”Track payload size, allocation, latency, malformed-input rate, resource closure, and protocol errors. Keep capacity, timeout, retry, and shutdown settings next to the component that owns the resource; avoid process-wide defaults that hide which caller accepted the trade-off.
Testing
Section titled “Testing”Run the module test task:
./gradlew :bluetape4k-retrofit2:test --no-configuration-cacheRepresentative test anchors:
AbstractRetrofitTestExceptionSupportTestRetrofitBuilderSupportTestRetrofitSupportTestRetryRetrofitCallSupportTestSuspendRetrofitCallSupportTestAbstractClientTestAbstractDetectTempEmailTest
Workshops
Section titled “Workshops”No dedicated workshop path is registered in the manual manifest. Use the module README and the representative tests above as runnable evidence.
Limitations
Section titled “Limitations”This page documents the repository state represented by the linked source and tests. It does not turn optional backends into application defaults or claim performance without a benchmark artifact. Re-check compatibility and lifecycle notes when the module version changes.
Release diagrams
Section titled “Release diagrams”These diagrams are loaded directly from README assets published with the 1.11.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.
Retrofit2 Module Architecture diagram
Section titled “Retrofit2 Module Architecture diagram”Release README: io/retrofit2/README.md
Retrofit2 + Result Pattern Integration diagram
Section titled “Retrofit2 + Result Pattern Integration diagram”Release README: io/retrofit2/README.md
Suspend Result HTTP Request Flow diagram
Section titled “Suspend Result HTTP Request Flow diagram”Release README: io/retrofit2/README.md


