LibraryActive

Spring Cloud Consul

Consul integrations for Spring Boot apps via autoconfiguration and Spring Environment binding.

Open source page

Field note

What it does

Provides Consul integrations for Spring Boot apps through autoconfiguration and binding to the Spring Environment and other Spring programming model idioms.

Capabilities

Available capabilities

Tags

Tags

Ways to use it

Ways to use it

sdk

java / org.springframework.cloud:spring-cloud-starter-consul

sdk

java / https://docs.spring.io/spring-boot/

other

Not filed / https://www.consul.io/

other

Not filed / Not filed

rest

Not filed / Not filed

other

Not filed / Not filed

other

java / spring-retry

other

java / spring-boot-starter-aspectj

sdk

Java / https://docs.spring.io/spring-cloud-consul/reference/4.2/index.html

sdk

java / spring-cloud-starter-consul-bus

other

Not filed / Not filed

sdk

java / Not filed

sdk

Java / https://docs.spring.io/spring-cloud-consul/reference/

Product features

Product features

Annotation-Based Enablement

Enable and configure common patterns with a few simple annotations.

Annotation-based Enablement

With a few simple annotations you can quickly enable and configure common patterns.

Autoconfiguration

Provides Consul integrations for Spring Boot apps through autoconfiguration.

Catalog watch

Watches the Consul catalog with configurable delay and blocking timeout.

Config Watch

Blocking Consul HTTP API call detects changes and publishes a Refresh Event.

Configuration

Consul-based configuration pattern.

Consul Agent Connection

Applications require a Consul Agent client, expected at localhost:8500 by default.

Spring Cloud Bus with Consul

Use the Consul Bus starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-bus.

Consul Catalog Watch

Watches the Consul catalog for service changes.

Config watch

Watches Consul KV for configuration changes with configurable delay and wait time.

Consul Retry

Retries Consul agent operations on startup failure; default 6 attempts, 1000ms initial backoff, 1.1 multiplier.

consulRetryInterceptor bean

Add a RetryOperationsInterceptor bean with id consulRetryInterceptor to take full control of retry.

Control Bus

Consul-based control bus pattern.

Customizing Consul Config

Customize via enabled, prefix, defaultContext, and profileSeparator properties.

Discovery Client Usage

Use DiscoveryClient, @LoadBalanced RestTemplate, or @LoadBalanced WebClient.Builder to retrieve services and instances data from Consul.

Distributed Configuration Usage

Retrieve configuration data from Consul; set spring.config.import to bind to Consul.

Spring Environment Binding

Binds to the Spring Environment and other Spring programming model idioms.

Health Check Headers

Applies custom headers to health check requests.

Heartbeat TTL

Consul TTL health check with optional Actuator health integration.

HTTP Health Check

Creates an HTTP check hitting /actuator/health by default every 10 seconds.

Management as a Separate Service

Registers management as a separate service when management.server.port differs.

Service Discovery

Consul-based service discovery pattern for Spring Boot applications.

Service registration

Registers services with Consul including metadata, tags, and instance identifiers.

Spring Boot Config Data Import

Import Consul config via spring.config.import=optional:consul: instead of bootstrap.

Spring Environment Binding

Binds to the Spring Environment and other Spring programming model idioms.

Spring Framework Documentation

TTL Health Check

Supports TTL health checks for registered instances.

YAML or Properties with Config

Store a properties blob in YAML or Properties format via spring.cloud.consul.config.format.