AMPS Binder¶
The AmpsMessageChannelBinder is the core component that integrates AMPS with the Spring Cloud Stream binder SPI. It extends AbstractMessageChannelBinder and implements ExtendedPropertiesBinder to support AMPS-specific consumer and producer configuration.
How It Works¶
When a Spring Cloud Stream application starts with the AMPS binder on the classpath, the following occurs:
-
Auto-configuration —
AmpsBinderConfigurationis loaded viaMETA-INF/spring.binders. It creates theAmpsTopicProvisionerandAmpsMessageChannelBinderbeans. -
Connection factory resolution — On initialization, the binder resolves an
AmpsConnectionFactoryProviderbean from the application context. If none is found, a defaultAmpsConnectionFactoryProviderImplis created. AnAmpsConnectionFactoryis built from the binder configuration properties. -
Consumer binding — For each consumer binding, the binder creates an
AmpsMessageProducerthat opens one or more AMPS connections (based on concurrency), subscribes to the destination topic, and converts AMPS messages into SpringMessage<byte[]>. -
Producer binding — For each producer binding, the binder creates an
AmpsProducerMessageHandlerthat opens an AMPS connection and publishes Spring messages to the destination topic.
Binder Type¶
The binder type is amps. When using multiple binders, reference this type in your binder declaration:
spring:
cloud:
stream:
binders:
my-amps:
type: amps
environment:
spring.cloud.stream.amps.binder:
brokers:
- tcp://amps-server:50000/json
Extended Properties¶
The AMPS binder supports extended (AMPS-specific) properties for consumer and producer bindings. These properties are under the spring.cloud.stream.amps.bindings.<channelName> namespace.
See: