Auto-Configuration
The following are beans that can be auto-configured. Some of these beans will always be auto-configured if no bean of the same type is provided, others are available when one or more properties are set, others if one or more other beans are available.
Although it is possible to auto-configure all of these beans, each of them can be replaced by an application-provided bean. This allows you to provide only those beans that you want, and have this Spring Boot starter auto-configure the rest.
Marshaller
Conditions: none.
Authenticator
Conditions:
- Properties
connect.api.authorization-id
andconnect.api.authorization-secret
are set.
This Authenticator
can be further auto-configured with the authorization type.
PooledConnection
Conditions: none.
This PooledConnection
can be further auto-configured with timeouts, the max connection count, HTTPS protocols and a proxy.
Connection management
If a PooledConnection
is auto-configured, this Spring Boot starter will also auto-configure connection management.
This will take care of closing idle (and expired) connections, and can be configured using properties connect.api.close-idle-connections.idle-time
and connect.api.close-idle-connections.interval
,
or disabled by setting property connect.api.close-idle-connections.enabled
to false
.
Obfuscation
If a PooledConnection
is auto-configured,
any unique bean of type BodyObfuscator
or HeaderObfuscator
will be automatically set on the connection.
MetadataProvider
Conditions:
- Property
connect.api.integrator
is set.
This MetadataProvider
can be further auto-configured with the shopping cart extension.
In addition, the MetadataProvider
can be further configured by providing beans of type MetadataProviderBuilderCustomizer.
This allows you to provide additional headers.
Communicator
Conditions:
- Property
connect.api.endpoint.host
is set. - Beans of type
Connection
,Authenticator
,MetadataProvider
andMarshaller
are available.
The Communicator
's endpoint can be further auto-configured with the scheme and port. These default to https
and -1
.
Client
Conditions:
- A bean of type
Communicator
is available.
V1Client
Conditions:
- A bean of type
Client
is available.
MerchantClient
Conditions:
- Property
connect.api.merchant-id
is set. - A bean of type
V1Client
is available.
CommunicatorLogger
Conditions:
- Logback is the configured logging system.
This CommunicatorLogger
can be further auto-configured with the logger name, log level and error log level.
Health indicator
Conditions:
- Your project includes the
org.springframework.boot:spring-boot-starter-actuator
dependency. - A bean of type
MerchantClient
is available.
This health indicator will use the test connection functionality to check your connectivity to the Worldline Connect Server API.
To prevent too many requests to the Worldline Connect Server API this is throttled to at most 1 request every minute. This can be changed by setting property connect.api.health.min-interval
to the desired number of seconds between calls.
If you want to have a bean of type MerchantClient
(auto-configured or not) but you don't want this auto-configured health indicator,
you can disable it by setting property management.health.connect-sdk.enabled
to false
.