public abstract class IntegrationFlowAdapter extends Object implements IntegrationFlow, SmartLifecycle
Adapter
class for the IntegrationFlow
abstraction.
Requires the implementation for the buildFlow()
method to produce
IntegrationFlowDefinition
using one of from(java.lang.String)
support methods.
Typically is used for target service implementation:
@Component public class MyFlowAdapter extends IntegrationFlowAdapter { @Autowired private ConnectionFactory rabbitConnectionFactory; @Override protected IntegrationFlowDefinition<?> buildFlow() { return from(Amqp.inboundAdapter(this.rabbitConnectionFactory, "myQueue")) .<String, String>transform(String::toLowerCase) .channel(c -> c.queue("myFlowAdapterOutput")); } }
DEFAULT_PHASE
Constructor and Description |
---|
IntegrationFlowAdapter() |
Modifier and Type | Method and Description |
---|---|
protected abstract IntegrationFlowDefinition<?> |
buildFlow() |
void |
configure(IntegrationFlowDefinition<?> flow)
The callback-based function to declare the chain of EIP-methods to
configure an integration flow with the provided
IntegrationFlowDefinition . |
protected IntegrationFlowBuilder |
from(Class<?> serviceInterface) |
protected IntegrationFlowBuilder |
from(Class<?> serviceInterface,
java.util.function.Consumer<GatewayProxySpec> endpointConfigurer)
Start a flow from a proxy for the service interface.
|
protected IntegrationFlowBuilder |
from(Class<?> serviceInterface,
String beanName)
Deprecated.
since 5.2 in favor of
from(Class, Consumer) |
protected IntegrationFlowDefinition<?> |
from(MessageChannel messageChannel) |
protected IntegrationFlowDefinition<?> |
from(MessageChannelSpec<?,?> messageChannelSpec) |
protected IntegrationFlowDefinition<?> |
from(MessageProducerSpec<?,?> messageProducerSpec) |
protected IntegrationFlowDefinition<?> |
from(MessageProducerSupport messageProducer) |
protected IntegrationFlowDefinition<?> |
from(MessageSource<?> messageSource) |
protected IntegrationFlowDefinition<?> |
from(MessageSource<?> messageSource,
java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) |
protected IntegrationFlowDefinition<?> |
from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec) |
protected IntegrationFlowDefinition<?> |
from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec,
java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) |
protected IntegrationFlowDefinition<?> |
from(MessagingGatewaySpec<?,?> inboundGatewaySpec) |
protected IntegrationFlowDefinition<?> |
from(MessagingGatewaySupport inboundGateway) |
protected IntegrationFlowBuilder |
from(Object service,
String methodName)
Deprecated.
since 5.2 in favor of method reference via
from(Supplier) |
protected IntegrationFlowBuilder |
from(Object service,
String methodName,
java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
Deprecated.
since 5.2 in favor of method reference via
from(Supplier) |
protected IntegrationFlowBuilder |
from(org.reactivestreams.Publisher<? extends Message<?>> publisher) |
protected IntegrationFlowDefinition<?> |
from(String messageChannelName) |
protected IntegrationFlowDefinition<?> |
from(String messageChannelName,
boolean fixedSubscriber) |
protected <T> IntegrationFlowBuilder |
from(java.util.function.Supplier<T> messageSource) |
protected <T> IntegrationFlowBuilder |
from(java.util.function.Supplier<T> messageSource,
java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) |
MessageChannel |
getInputChannel()
Return the first
MessageChannel component
which is essential a flow input channel. |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
public final void configure(IntegrationFlowDefinition<?> flow)
IntegrationFlow
IntegrationFlowDefinition
.configure
in interface IntegrationFlow
flow
- the IntegrationFlowDefinition
to configurepublic MessageChannel getInputChannel()
IntegrationFlow
MessageChannel
component
which is essential a flow input channel.getInputChannel
in interface IntegrationFlow
public void stop(Runnable callback)
stop
in interface SmartLifecycle
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public int getPhase()
getPhase
in interface Phased
getPhase
in interface SmartLifecycle
protected IntegrationFlowDefinition<?> from(String messageChannelName)
protected IntegrationFlowDefinition<?> from(MessageChannel messageChannel)
protected IntegrationFlowDefinition<?> from(String messageChannelName, boolean fixedSubscriber)
protected IntegrationFlowDefinition<?> from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
protected IntegrationFlowDefinition<?> from(MessageSource<?> messageSource, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
protected IntegrationFlowDefinition<?> from(MessageProducerSupport messageProducer)
protected IntegrationFlowDefinition<?> from(MessageSource<?> messageSource)
protected IntegrationFlowDefinition<?> from(MessagingGatewaySupport inboundGateway)
protected IntegrationFlowDefinition<?> from(MessageChannelSpec<?,?> messageChannelSpec)
protected IntegrationFlowDefinition<?> from(MessageProducerSpec<?,?> messageProducerSpec)
protected IntegrationFlowDefinition<?> from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec)
protected IntegrationFlowDefinition<?> from(MessagingGatewaySpec<?,?> inboundGatewaySpec)
@Deprecated protected IntegrationFlowBuilder from(Object service, String methodName)
from(Supplier)
service
- service for polling methodmethodName
- method to poll@Deprecated protected IntegrationFlowBuilder from(Object service, String methodName, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
from(Supplier)
service
- service for polling methodmethodName
- method to pollendpointConfigurer
- configurer for SourcePollingChannelAdapterSpec
protected <T> IntegrationFlowBuilder from(java.util.function.Supplier<T> messageSource)
protected <T> IntegrationFlowBuilder from(java.util.function.Supplier<T> messageSource, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
protected IntegrationFlowBuilder from(Class<?> serviceInterface)
@Deprecated protected IntegrationFlowBuilder from(Class<?> serviceInterface, @Nullable String beanName)
from(Class, Consumer)
serviceInterface
- the service interface to proxy for the gateway.beanName
- the bean name for the gateway proxy.IntegrationFlowBuilder
instanceprotected IntegrationFlowBuilder from(Class<?> serviceInterface, @Nullable java.util.function.Consumer<GatewayProxySpec> endpointConfigurer)
serviceInterface
- the service interface class.endpointConfigurer
- the Consumer
to configure proxy bean for gateway.IntegrationFlowBuilder
.protected IntegrationFlowBuilder from(org.reactivestreams.Publisher<? extends Message<?>> publisher)
protected abstract IntegrationFlowDefinition<?> buildFlow()