Spring conventions: how this starter compares
This page compares the starter with the conventions Spring users already know from Spring Boot, Spring for Apache Kafka, Spring Data, Spring Cloud Stream, Micrometer, Resilience4j and Temporal. Each row says what we keep and what we change. Changes are proposed and tracked in GitHub Issues.
Snapshot
"This starter today" describes the 0.10.0 release (the last 0.x main), before the 1.0 refactor. The 1.0 changes are in the changelog. The core configuration is
ActorConfiguration,
which is imported by
@EnableActorSupport.
core-boot3 is generated from core sources by the syncAllBoot3Sources Gradle task,
so anything said about core also holds for core-boot3.
How to read a row
Every row has four parts:
- Reference libraries: how the named libraries do it.
- This starter today: what the code does now.
- Verdict: one of
- Keep: we already follow the convention, or we depart from it on purpose (the reason is given).
- Change: we should follow the convention.
- Tracked: the gap is already tracked by an open issue. The row links the issue.
- Source: a link to the official documentation of the reference.
Rows 1 to 17 cover the eight topics of issue #105. Rows 18 to 24 are other conventions found in the same libraries that apply to this starter; each names the library it comes from.
Summary
Issue links are in each row below.
| Row | Convention | Verdict |
|---|---|---|
| 1 | Auto-configuration registration (Boot 2 and 3) | Change, done (#184) |
| 2 | @Enable* annotations |
Change, done (#184) |
| 3 | @ConditionalOn* back-off |
Change |
| 4 | *Customizer beans |
Change |
| 5 | @ConfigurationProperties and metadata |
Tracked (#97) |
| 6 | Property namespace | Keep |
| 7 | SmartLifecycle phases and graceful shutdown |
Tracked (#99) |
| 8 | Micrometer meters | Keep |
| 9 | Micrometer Observation | Change |
| 10 | Actuator health indicator | Tracked (#100) |
| 11 | Actuator endpoint | Change |
| 12 | Test artifact | Change |
| 13 | Test slice | Change |
| 14 | BOM | Change |
| 15 | Native image hints | Change |
| 16 | Starter and auto-configure module split | Keep |
| 17 | Optional dependencies | Keep |
| 18 | Global on/off switch (Spring Boot, Spring Cloud, Spring for Apache Kafka) | Change |
| 19 | Registries scoped to the application context (Spring for Apache Kafka) | Change |
| 20 | Starter artifact naming (Spring Boot) | Change |
| 21 | FailureAnalyzer for startup errors (Spring Boot) |
Change |
| 22 | Components discovered as beans (Spring for Apache Kafka, Spring Cloud Stream, Temporal) | Keep |
| 23 | Framework events as ApplicationEvent (Spring for Apache Kafka) |
Keep |
| 24 | Configuration ordering with @AutoConfiguration(after = ...) (Spring Boot) |
Keep |
1. Registration and activation
Row 1: Auto-configuration registration (Boot 2 and 3)
- Reference libraries: A Spring Boot starter registers its configuration classes so that adding the
dependency is enough. Boot 2.0 to 2.6 read
org.springframework.boot.autoconfigure.EnableAutoConfigurationkeys inMETA-INF/spring.factories. Boot 2.7 addedMETA-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.importsand the@AutoConfigurationannotation (which also setsproxyBeanMethods = false). Boot 3.0 reads only the.importsfile. Spring for Apache Kafka, Spring Data, Resilience4j and Temporal all ship their Boot integration this way: the Kafka and Spring Data auto-configurations live in Spring Boot itself,resilience4j-spring-boot2/-3andtemporal-spring-boot-autoconfigurelist theirs in these files. - This starter today:
corehas nosrc/main/resourcesat all, so it has neither file. Nothing starts until the app adds@EnableActorSupport.ActorConfigurationandPekkoManagementAutoConfigurationare plain@Configurationclasses. Themetricsmodule has aspring.factoriesentry only, so Boot 3 never loadsActorMetricsAutoConfigurationon its own. The core tests pass without@EnableActorSupportonly because the test application sits in theio.github.seonwkim.actorpackage, and component scanning picksActorConfigurationup. - Verdict: Change. Done in #184:
every actor configuration is an
@AutoConfigurationlisted inactor-autoconfigure'sAutoConfiguration.imports, ordered with@AutoConfiguration(after = ...). - Source: Spring Boot: Creating your own auto-configuration, Spring Boot 2.7 release notes, Spring Boot 3.0 migration guide.
Row 2: @Enable* annotations
- Reference libraries: In a Boot app the
@Enable*annotation is optional, because the auto-configuration applies it for you. Boot's Kafka auto-configuration adds@EnableKafkawhen the app has not, so@KafkaListenerworks with the dependency alone. Boot enables Spring Data repositories for you;@EnableJpaRepositoriesis needed only to change the scanned packages or the defaults. Outside Boot (plain Spring Framework), the annotation remains the switch. - This starter today:
@EnableActorSupportis required. It is the only way to importActorConfigurationandPekkoManagementAutoConfiguration. - Verdict: Change. The annotation stays and is
not deprecated; it becomes optional in a Boot app. Done in
#184: it is an
@ImportAutoConfigurationof the same list, so it adds nothing next to@EnableAutoConfigurationand still starts the actor system where auto-configuration is off. - Source: Spring for Apache Kafka:
@KafkaListenerannotation, Spring Boot: Apache Kafka support, Spring Data JPA: Creating repository instances.
2. Back-off and customization
Row 3: @ConditionalOn* back-off
- Reference libraries: Every bean an auto-configuration defines backs off when the user defines one
(
@ConditionalOnMissingBean). Each class that touches an optional library is guarded with@ConditionalOnClass, so it never loads when the library is absent. Boot's Kafka auto-configuration backs off onKafkaTemplate,ProducerFactory,ConsumerFactoryand the listener container factory. Boot also asks thatBeanPostProcessor@Beanmethods bestatic, so the configuration class is not created early. - This starter today:
actorProperties,rootGuardianSupplierWrapper,actorSystemBuilder,actorSystemandtopicManagerback off.actorRegistrationBeanPostProcessorandclusterShardingInitializerdo not, and the post-processor method is notstatic.PekkoManagementAutoConfigurationis the only class with@ConditionalOnClass. - Verdict: Change.
- Source: Spring Boot: Condition annotations,
Spring Framework:
BeanPostProcessor@Beanmethods.
Row 4: *Customizer beans
- Reference libraries: Boot lets an app tweak a bean it builds without replacing it: the app
declares one or more
*Customizerbeans, and the auto-configuration applies them in@Orderorder through anObjectProvider. Examples:RestTemplateCustomizerandJackson2ObjectMapperBuilderCustomizer(Spring Boot);DefaultKafkaProducerFactoryCustomizerandDefaultKafkaConsumerFactoryCustomizer(Boot's Kafka support);CircuitBreakerConfigCustomizer(Resilience4j);TemporalOptionsCustomizerandWorkerFactoryOptionsCustomizer(Temporal);MeterRegistryCustomizer(Micrometer in Boot). - This starter today: There is no customizer type. To change one thing (for example a Pekko setting
computed at startup, or an extra root guardian behaviour) the app replaces the whole
SpringActorSystemBuilderorRootGuardianSupplierWrapperbean. - Verdict: Change.
- Source: Spring Boot: Apache Kafka support, Resilience4j: Spring Boot 2 getting started, Temporal: Spring Boot integration, Spring Boot: Metrics customization.
3. Configuration properties
Row 5: @ConfigurationProperties and metadata
- Reference libraries: Properties bind to a typed
@ConfigurationPropertiesclass (KafkaProperties,DataSourceProperties,TemporalProperties, Resilience4j'sCircuitBreakerProperties). Thespring-boot-configuration-processorgeneratesMETA-INF/spring-configuration-metadata.json, so IDEs complete and document the keys, and deprecated keys are marked. - This starter today:
ActorPropertiesis a plain class that bindsspring.actor.*into aMap<String, Object>with theBinder. There is no metadata file. - Verdict: Tracked: #97. Not re-specified here.
- Source: Spring Boot: Type-safe configuration properties, Spring Boot: Configuration metadata.
Row 6: Property namespace
- Reference libraries: Spring Boot asks third-party starters to keep their keys in their own
namespace and not to use
spring,serverormanagement. Resilience4j usesresilience4j.*. Temporal's own starter usesspring.temporal.*, and Spring-team projects (Kafka, Cloud Stream) usespring.kafka.*andspring.cloud.stream.*. - This starter today: All keys live under
spring.actor.*, andspring.actor.pekko.*maps to the Pekko configuration. - Verdict: Keep. Moving every key breaks every user's configuration, and Temporal shows that a
spring.*prefix is accepted in practice. If the typed properties work in #97 wants to revisit the prefix, it should do so there, with deprecation metadata for the old keys. - Source: Spring Boot: Creating your own starter, configuration keys, Temporal: Spring Boot integration.
4. Lifecycle
Row 7: SmartLifecycle phases and graceful shutdown
- Reference libraries: Components that run work start and stop in a
SmartLifecyclephase, not in a constructor ordestroy(). Spring for Apache Kafka's listener containers areSmartLifecyclebeans withautoStartupand a phase, and stop before the beans they use are destroyed. Boot's web server graceful shutdown runs in its own phase with a bounded timeout (spring.lifecycle.timeout-per-shutdown-phase). - This starter today: The Pekko actor system starts when the
actorSystembean is built.SpringActorSystemimplementsDisposableBean, anddestroy()callsterminate()and then waits ongetWhenTerminated()with no timeout. - Verdict: Tracked: #99. Not re-specified here.
- Source: Spring Framework: Startup and shutdown callbacks, Spring for Apache Kafka: Message listener containers, Spring Boot: Graceful shutdown.
5. Observability
Row 8: Micrometer meters
- Reference libraries: Libraries register meters on the app's
MeterRegistrybean, backed off with@ConditionalOnClass(MeterRegistry.class)and@ConditionalOnBean(MeterRegistry.class). Spring for Apache Kafka binds client meters throughMicrometerConsumerListener; Resilience4j shipsresilience4j-micrometer. - This starter today: The separate
metricsmodule (an instrumentation agent) registers actor meters on theMeterRegistrythroughActorMetricsAutoConfiguration, guarded with@ConditionalOnClass,@ConditionalOnBean,@ConditionalOnMissingBeanandspring.actor.metrics.enabled. - Verdict: Keep. Its missing Boot 3 registration file is part of row 1; this change does not touch the metrics module.
- Source: Spring Boot: Metrics, Spring for Apache Kafka: Monitoring.
Row 9: Micrometer Observation
- Reference libraries: Since Micrometer 1.10 and Boot 3, libraries instrument a unit of work once
with the Observation API, and Boot turns it into a timer and a trace span. Spring for Apache Kafka
enables it with
observationEnabledon the template and the container (Boot propertiesspring.kafka.template.observation-enabled,spring.kafka.listener.observation-enabled) and lets the app plug in its ownObservationConvention. - This starter today:
tellandaskcreateactor.sendandactor.receiveObservations when anObservationRegistrybean exists, and the trace crosses nodes. Actor spawn is not observed. - Verdict: Change.
- Source: Micrometer: Observation API, Spring for Apache Kafka: Monitoring.
Row 10: Actuator health indicator
- Reference libraries: A library with a remote dependency contributes a
HealthIndicator(Spring Data's Redis, Mongo and Cassandra indicators; the Spring Cloud Stream binders indicator), enabled bymanagement.health.<name>.enabled. - This starter today: No health indicator. Cluster membership is visible only through Pekko Management HTTP when it is on the classpath.
- Verdict: Tracked: #100. Not re-specified here.
- Source: Spring Boot: Actuator endpoints, health.
Row 11: Actuator endpoint
- Reference libraries: Libraries with runtime state expose a read-only Actuator
@Endpoint: Spring Cloud Stream'sbindingsandchannelsendpoints; Spring Integration'sintegrationgraph; Resilience4j'scircuitbreakersandcircuitbreakerevents. - This starter today: No endpoint. Actor and shard state is available only through Pekko APIs.
- Verdict: Change.
- Source: Spring Boot: Implementing custom endpoints, Spring Cloud Stream: Binding visualization and control, Resilience4j: Spring Boot 2 getting started.
6. Testing
Row 12: Test artifact
- Reference libraries: Libraries publish a test artifact with a ready-made fixture:
spring-kafka-testwith@EmbeddedKafkaandEmbeddedKafkaBroker;spring-cloud-stream-test-binderwithInputDestinationandOutputDestination;temporal-testingwithTestWorkflowEnvironment, which Temporal's starter wires in whenspring.temporal.test-server.enabled=true. - This starter today: No test artifact. Users wire Pekko's
pekko-actor-testkit-typedby hand, and the core tests useActorTypeRegistry.clear()to reset static state between contexts. - Verdict: Change.
- Source: Spring for Apache Kafka: Testing applications, Spring Cloud Stream: Testing, Temporal: Spring Boot integration, Apache Pekko: Testing.
Row 13: Test slice
- Reference libraries: Boot test slices load one layer of the app and only the auto-configuration
it needs:
@DataJpaTest(Spring Data),@JsonTest,@WebMvcTest. A library can ship its own slice with@ImportAutoConfigurationand aMETA-INF/spring/<annotation>.importsfile. - This starter today: No slice. A test that needs actors uses
@SpringBootTestand loads the whole application. - Verdict: Change.
- Source: Spring Boot: Testing Spring Boot applications, auto-configured tests.
7. Distribution
Row 14: BOM
- Reference libraries: A project with more than one artifact publishes a bill of materials so
users pick one version:
spring-cloud-dependencies(Spring Cloud Stream),micrometer-bom,resilience4j-bom,temporal-bom,spring-boot-dependencies; Pekko itself shipspekko-bom_<scala>. - This starter today: Three published artifacts (
spring-boot-starter-actor,spring-boot-starter-actor_3,spring-boot-starter-actor-metrics) and no BOM. Users repeat the version on each. - Verdict: Change.
- Source: Spring Boot: Dependency management, Micrometer: Installing.
Row 15: Native image hints
- Reference libraries: Boot 3 libraries that use reflection, resources or proxies register a
RuntimeHintsRegistrarinMETA-INF/spring/aot.factories, so GraalVM native images work. Spring for Apache Kafka shipsKafkaRuntimeHints. - This starter today: No hints. Pekko loads
reference.confresources and creates extensions, serializers and actor classes by reflection, so a native image cannot start the actor system. - Verdict: Change.
- Source: Spring Framework: Ahead of time optimizations, runtime hints, Spring Boot: GraalVM native images.
Row 16: Starter and auto-configure module split
- Reference libraries: Spring Boot describes a starter as two modules, an
-autoconfiguremodule with the code and an empty-startermodule with the dependencies, and allows one combined module when there is no need to separate them. Temporal ships both (temporal-spring-boot-autoconfigureandtemporal-spring-boot-starter). - This starter today: One combined module per Boot line (
core,core-boot3). - Verdict: Keep. Boot allows a combined module, and the starter has no optional feature large enough to need a separate auto-configure jar.
- Source: Spring Boot: Creating your own starter.
Row 17: Optional dependencies
- Reference libraries: Spring Boot asks auto-configure modules to declare the libraries they
configure as optional, so the app chooses them, and to guard the code that uses them with
@ConditionalOnClass. - This starter today: Pekko Management and Cluster Bootstrap are
compileOnly, andPekkoManagementAutoConfigurationis guarded by@ConditionalOnClasson their class names. The metrics module declares Spring BootcompileOnly. - Verdict: Keep. The remaining guard gaps are in row 3.
- Source: Spring Boot: Creating your own starter.
8. Other conventions found
Row 18: Global on/off switch
Source libraries: Spring Boot, Spring Cloud, Spring for Apache Kafka.
- Reference libraries: A starter that starts something can be turned off with one property, without
removing the dependency:
spring.cloud.discovery.enabledandspring.cloud.config.enabled(Spring Cloud),spring.jmx.enabled(Spring Boot),spring.kafka.listener.auto-startup(Boot's Kafka support). - This starter today:
spring.actor.pekko.management.enabledturns off Pekko Management andspring.actor.metrics.enabledturns off metrics, but there is no switch for the actor system itself. - Verdict: Change.
- Source: Spring Boot: Condition annotations, property conditions, Spring Cloud Commons.
Row 19: Registries scoped to the application context
Source library: Spring for Apache Kafka.
- Reference libraries: Spring for Apache Kafka keeps its listener endpoints in a
KafkaListenerEndpointRegistrybean, one per application context. The Spring TestContext framework caches and reuses contexts, so several contexts can live in one JVM at once, and state kept instaticfields leaks between them. - This starter today:
ActorTypeRegistryandShardedActorRegistrykeep actor factories instaticmaps. Tests callActorTypeRegistry.clear()to isolate contexts. - Verdict: Change.
- Source: Spring for Apache Kafka:
@KafkaListenerlifecycle management, Spring Framework: Context caching.
Row 20: Starter artifact naming
Source library: Spring Boot.
- Reference libraries: Spring Boot reserves the
spring-bootprefix for its own modules and asks third-party starters to put the project name first:acme-spring-boot-starter. Temporal follows it (temporal-spring-boot-starter), as does Resilience4j (resilience4j-spring-boot3). - This starter today: The artifacts are
spring-boot-starter-actor,spring-boot-starter-actor_3andspring-boot-starter-actor-metrics, under theio.github.seonwkimgroup. - Verdict: Change. The 1.0 release renamed them to
actor-spring-boot-starterand friends. - Source: Spring Boot: Creating your own starter, naming.
Row 21: FailureAnalyzer for startup errors
Source library: Spring Boot.
- Reference libraries: Boot turns well-known startup failures into a short "Description / Action"
report with a
FailureAnalyzerregistered inspring.factories(for example "Port 8080 was already in use", or a missing bean). - This starter today: A Pekko startup failure (remoting port already bound, a bad
spring.actor.pekko.*value, a missing seed node) reaches the user as a nested stack trace from theactorSystembean. - Verdict: Change.
- Source: Spring Boot: Create your own FailureAnalyzer.
Row 22: Components discovered as beans
Source libraries: Spring for Apache Kafka, Spring Cloud Stream, Temporal.
- Reference libraries: The user's handlers are ordinary beans the library finds in the context:
@KafkaListenermethods,Function/Consumerbeans in Spring Cloud Stream, and workflow and activity beans found by Temporal'sspring.temporal.workers-auto-discovery.packages. - This starter today: Actors are
@Componentbeans implementingSpringActororSpringShardedActor, found by aBeanPostProcessor. They get dependency injection like any bean. - Verdict: Keep.
- Source: Spring for Apache Kafka:
@KafkaListenerannotation, Spring Cloud Stream: Functional binding names, Temporal: Spring Boot integration.
Row 23: Framework events as ApplicationEvent
Source library: Spring for Apache Kafka.
- Reference libraries: Spring for Apache Kafka publishes container state changes as Spring
application events (
ListenerContainerIdleEvent,ConsumerStartedEvent,ConsumerStoppedEvent), so the app reacts with@EventListener. - This starter today: In cluster mode,
SpringActorSystempublishes Pekko cluster events through theApplicationEventPublisher. - Verdict: Keep.
- Source: Spring for Apache Kafka: Application events.
Row 24: Configuration ordering
Source library: Spring Boot.
- Reference libraries: An auto-configuration that depends on another declares it with
@AutoConfiguration(after = ...)or@AutoConfigureAfter, never by relying on class names or scan order. - This starter today:
ActorMetricsAutoConfigurationdeclares@AutoConfigureAfter(CompositeMeterRegistryAutoConfiguration.class). The core classes have no ordering yet because they are not auto-configurations; row 1 adds the ordering they need. - Verdict: Keep. The core ordering is part of row 1.
- Source: Spring Boot: Locating auto-configuration candidates.