| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Opinionated Spring Boot starter for core/infrastructure-tier microservices — auto-configures a resilient reactive WebClient, Actuator/observability defaults, service discovery, cloud config, and orchestration wiring out of the box.
fireflyframework-starter-core is the opinionated Spring Boot starter for building core/infrastructure-tier microservices on the Firefly Framework. It is not the framework kernel itself — it is a convenience starter that pulls in the foundational Firefly libraries (kernel, CQRS, EDA, observability, and — optionally — the orchestration engine) and layers a set of Spring Boot auto-configurations on top so that a new service boots with sensible, production-ready defaults and zero hand-wired plumbing.
Add the single dependency and your service automatically gets a reactive, resilience-wrapped WebClient (circuit breaker, retry, timeout, bulkhead, metrics) with transaction-ID propagation, a curated Actuator surface (health, info, metrics, Prometheus, tracing), extended Micrometer meter binders (JVM, thread pools, HTTP client, database, cache, application), structured Logstash-compatible JSON logging, a Firefly-branded startup banner, and a TransactionFilter that stamps and propagates an X-Transaction-Id across the reactive context. Optional, classpath-gated modules add Spring Cloud Config client wiring, service registry registration (Eureka / Consul), and saga/TCC/workflow support.
Every auto-configuration is registered through META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports and is individually toggleable through firefly.* properties, so you can opt out of any layer without removing the starter. This makes the module ideal for the platform-level services that sit underneath domain logic: API gateways, config servers, messaging bridges, registries, and other infrastructure components.
Where it sits in the framework:
<dependency>
<groupId>org.fireflyframework</groupId>
<artifactId>fireflyframework-starter-core</artifactId>
<!-- Version is managed by the Firefly BOM / parent; omit when inheriting fireflyframework-parent -->
</dependency>If your project inherits the Firefly parent, the version is supplied for you:
<parent>
<groupId>org.fireflyframework</groupId>
<artifactId>fireflyframework-parent</artifactId>
<version>26.05.08</version>
<relativePath/>
</parent>The starter brings in fireflyframework-kernel, fireflyframework-cqrs, fireflyframework-eda, and fireflyframework-observability transitively; fireflyframework-orchestration is included as an optional dependency — add it explicitly to activate saga/TCC/workflow support.
Add the dependency and the auto-configurations do the rest — no extra annotations are required. A resilient, transaction-aware WebClient (and WebClientTemplate) are available for injection:
import org.fireflyframework.core.web.client.WebClientTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
@Service
public class CustomerGateway {
private final WebClientTemplate webClient;
public CustomerGateway(WebClientTemplate webClient) {
this.webClient = webClient;
}
// Inbound headers (minus the configured skip-list) are forwarded downstream,
// and X-Transaction-Id is propagated automatically.
public Mono<Customer> fetch(String baseUrl, String id, ServerWebExchange exchange) {
return webClient.get(baseUrl, "/customers/" + id, Customer.class, exchange);
}
}Prefer the raw WebClient? The auto-configured bean is already resilience-wrapped (circuit breaker, retry, timeout, bulkhead, metrics):
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
@Service
public class InventoryClient {
private final WebClient webClient; // resilient + transaction-aware by default
public InventoryClient(WebClient webClient) {
this.webClient = webClient;
}
public Mono<Stock> stock(String sku) {
return webClient.get()
.uri("https://inventory.internal/stock/{sku}", sku)
.retrieve()
.bodyToMono(Stock.class);
}
}Enable optional infrastructure features through configuration (all opt-in by default):
firefly:
cloud:
config:
enabled: true
uri: http://config-server:8888
service:
registry:
enabled: true
type: eurekaAll properties live under the firefly.* namespace and map to validated @ConfigurationProperties classes. The values below are the real defaults from the source.
firefly:
# Reactive WebClient (WebClientProperties) -------------------------------
webclient:
enabled: true
skip-headers: [] # inbound headers NOT forwarded downstream
connect-timeout-ms: 5000
read-timeout-ms: 10000
write-timeout-ms: 10000
max-in-memory-size: 16777216 # 16 MB
connection-pool:
enabled: true
max-connections: 500
max-pending-acquires: 1000
max-idle-time-ms: 30000
max-life-time-ms: 60000
metrics-enabled: true
http2:
enabled: true
max-concurrent-streams: 100
ssl:
enabled: false
verify-hostname: true
proxy:
enabled: false
# WebClient resilience (WebClientResilienceProperties) -----------------
resilience:
enabled: true
circuit-breaker:
failure-rate-threshold: 50 # percent
wait-duration-in-open-state-ms: 10000
permitted-number-of-calls-in-half-open-state: 5
sliding-window-size: 10
retry:
max-attempts: 3
initial-backoff-ms: 500
max-backoff-ms: 5000
backoff-multiplier: 2.0
timeout:
timeout-ms: 5000
bulkhead:
max-concurrent-calls: 25
max-wait-duration-ms: 0
# Actuator & observability (ActuatorProperties) -------------------------
actuator:
endpoints:
enabled: true
web:
exposure: "*"
base-path: /actuator
metrics:
enabled: true
prometheus:
enabled: true
path: /actuator/prometheus
tracing:
enabled: true
sampling:
probability: 0.1
propagation:
type: [B3, W3C]
zipkin:
enabled: false
base-url: http://localhost:9411
health:
show-details: always
show-components: true
# Structured logging (LoggingProperties) --------------------------------
logging:
json:
recursive-parsing-enabled: true
max-recursion-depth: 10
max-json-size-bytes: 1048576 # 1 MB
strict-validation: false
performance:
metrics-enabled: true
cache:
enabled: true
max-validation-cache-size: 1000
eviction-strategy: CLEAR_ALL # or LRU
# Spring Cloud Config client (CloudConfigProperties) — opt-in -----------
cloud:
config:
enabled: false
uri: http://localhost:8888
label: main
fail-fast: false
retry: true
max-retries: 6
refresh-enabled: true
# Service registry (ServiceRegistryProperties) — opt-in -----------------
service:
registry:
enabled: false
type: eureka # eureka | consul
eureka:
service-url: http://localhost:8761/eureka/
prefer-ip-address: true
consul:
host: localhost
port: 8500
# Orchestration integration (auto-activates if module present) ----------
orchestration:
enabled: trueKey prefixes at a glance:
| Prefix | Class | Purpose | Default state |
|---|---|---|---|
| firefly.webclient | WebClientProperties | Reactive WebClient: timeouts, pool, SSL, proxy, HTTP/2, codecs | enabled |
| firefly.webclient.resilience | WebClientResilienceProperties | Circuit breaker, retry, timeout, bulkhead | enabled |
| firefly.actuator | ActuatorProperties | Endpoints, metrics, Prometheus, tracing, health, extended meters | enabled |
| firefly.logging | LoggingProperties | JSON parsing, cache, and performance for structured logging | enabled |
| firefly.cloud.config | CloudConfigProperties | Spring Cloud Config client | disabled (opt-in) |
| firefly.service.registry | ServiceRegistryProperties | Eureka / Consul discovery | disabled (opt-in) |
| firefly.orchestration | (gate) | Saga/TCC/Workflow integration | enabled when module present |
Registered in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
| Auto-configuration | Responsibility |
|---|---|
| FireflyBannerAutoConfiguration | Firefly-branded startup banner |
| WebFluxAutoConfiguration | Jackson JSON codecs (JSR-310, ISO-8601) for WebFlux |
| WebClientAutoConfiguration | Resilient WebClient, WebClient.Builder, and WebClientTemplate beans |
| WebClientBuilderCustomizer | Applies timeouts, pooling, SSL, proxy, HTTP/2, codec config |
| WebFilterAutoConfiguration | Registers the TransactionFilter |
| WebClientResilienceAutoConfiguration | Resilience4j registries (circuit breaker, retry, time limiter, bulkhead) |
| ActuatorDefaultPropertiesAutoConfiguration / ActuatorAutoConfiguration | Actuator endpoint, metrics, and health defaults |
| DefaultHealthAutoConfiguration | Default health indicators |
| DefaultInfoContributorAutoConfiguration | Enhanced /actuator/info contributor |
| TracingAutoConfiguration | Distributed tracing (sampling, propagation, Zipkin) |
| CloudConfigAutoConfiguration | Spring Cloud Config client (opt-in) |
| ServiceRegistryAutoConfiguration | Eureka / Consul registration (opt-in) |
| OrchestrationAutoConfiguration | Saga/TCC/Workflow support (classpath-gated) |
Contributions are welcome. Please read the CONTRIBUTING.md guide for details on our code of conduct, development process, and how to submit pull requests.
Copyright 2024-2026 Firefly Software Foundation.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
| Back | FazBrowse Home | New Git URL |