Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 2.5 KB

File metadata and controls

50 lines (41 loc) · 2.5 KB

Spring Integration

Spring Boot offers several conveniences for working with {spring-integration}[Spring Integration], including the spring-boot-starter-integration “Starter”. Spring Integration provides abstractions over messaging and also other transports such as HTTP, TCP, and others. If Spring Integration is available on your classpath, it is initialized through the @EnableIntegration annotation.

Spring Integration polling logic relies on the auto-configured TaskScheduler.

Spring Boot also configures some features that are triggered by the presence of additional Spring Integration modules. If spring-integration-jmx is also on the classpath, message processing statistics are published over JMX. If spring-integration-jdbc is available, the default database schema can be created on startup, as shown in the following line:

spring:
  integration:
    jdbc:
      initialize-schema: "always"

If spring-integration-rsocket is available, developers can configure an RSocket server using "spring.rsocket.server.*" properties and let it use IntegrationRSocketEndpoint or RSocketOutboundGateway components to handle incoming RSocket messages. This infrastructure can handle Spring Integration RSocket channel adapters and @MessageMapping handlers (given "spring.integration.rsocket.server.message-mapping-enabled" is configured).

Spring Boot can also auto-configure an ClientRSocketConnector using configuration properties:

# Connecting to a RSocket server over TCP
spring:
  integration:
    rsocket:
      client:
        host: "example.org"
        port: 9898
# Connecting to a RSocket Server over WebSocket
spring:
  integration:
    rsocket:
      client:
        uri: "ws://example.org"

See the {spring-boot-autoconfigure-module-code}/integration/IntegrationAutoConfiguration.java[IntegrationAutoConfiguration] and {spring-boot-autoconfigure-module-code}/integration/IntegrationProperties.java[IntegrationProperties] classes for more details.

By default, if a Micrometer meterRegistry bean is present, Spring Integration metrics will be managed by Micrometer. If you wish to use legacy Spring Integration metrics, add a DefaultMetricsFactory bean to the application context.