Class IntegrationFlowAdapter
java.lang.Object
org.springframework.integration.dsl.IntegrationFlowAdapter
- All Implemented Interfaces:
Lifecycle,Phased,SmartLifecycle,IntegrationFlow,ManageableLifecycle,ManageableSmartLifecycle
public abstract class IntegrationFlowAdapter extends Object implements IntegrationFlow, ManageableSmartLifecycle
The base
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"));
}
}
- Since:
- 5.0
- Author:
- Artem Bilan
-
Field Summary
-
Constructor Summary
Constructors Constructor Description IntegrationFlowAdapter() -
Method Summary
Modifier and Type Method Description protected abstract IntegrationFlowDefinition<?>buildFlow()voidconfigure(IntegrationFlowDefinition<?> flow)The callback-based function to declare the chain of EIP-methods to configure an integration flow with the providedIntegrationFlowDefinition.protected IntegrationFlowBuilderfrom(Class<?> serviceInterface)protected IntegrationFlowBuilderfrom(Class<?> serviceInterface, Consumer<GatewayProxySpec> endpointConfigurer)Start a flow from a proxy for the service interface.protected IntegrationFlowDefinition<?>from(String messageChannelName)protected IntegrationFlowDefinition<?>from(String messageChannelName, boolean fixedSubscriber)protected IntegrationFlowBuilderfrom(org.reactivestreams.Publisher<? extends Message<?>> publisher)protected IntegrationFlowDefinition<?>from(MessageSource<?> messageSource)protected IntegrationFlowDefinition<?>from(MessageSource<?> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)protected IntegrationFlowDefinition<?>from(MessageChannelSpec<?,?> messageChannelSpec)protected IntegrationFlowDefinition<?>from(MessageProducerSpec<?,?> messageProducerSpec)protected IntegrationFlowDefinition<?>from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec)protected IntegrationFlowDefinition<?>from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)protected IntegrationFlowDefinition<?>from(MessagingGatewaySpec<?,?> inboundGatewaySpec)protected IntegrationFlowDefinition<?>from(MessageProducerSupport messageProducer)protected IntegrationFlowDefinition<?>from(MessagingGatewaySupport inboundGateway)protected IntegrationFlowDefinition<?>from(MessageChannel messageChannel)protected <T> IntegrationFlowBuilderfromSupplier(Supplier<T> messageSource)protected <T> IntegrationFlowBuilderfromSupplier(Supplier<T> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)MessageChannelgetInputChannel()Return the firstMessageChannelcomponent which is essential a flow input channel.intgetPhase()booleanisAutoStartup()booleanisRunning()voidstart()voidstop()voidstop(Runnable callback)
-
Constructor Details
-
IntegrationFlowAdapter
public IntegrationFlowAdapter()
-
-
Method Details
-
configure
Description copied from interface:IntegrationFlowThe callback-based function to declare the chain of EIP-methods to configure an integration flow with the providedIntegrationFlowDefinition.- Specified by:
configurein interfaceIntegrationFlow- Parameters:
flow- theIntegrationFlowDefinitionto configure
-
getInputChannel
Description copied from interface:IntegrationFlowReturn the firstMessageChannelcomponent which is essential a flow input channel.- Specified by:
getInputChannelin interfaceIntegrationFlow- Returns:
- the channel.
-
start
public void start()- Specified by:
startin interfaceLifecycle- Specified by:
startin interfaceManageableLifecycle
-
stop
- Specified by:
stopin interfaceSmartLifecycle
-
stop
public void stop()- Specified by:
stopin interfaceLifecycle- Specified by:
stopin interfaceManageableLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceLifecycle- Specified by:
isRunningin interfaceManageableLifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceSmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfacePhased- Specified by:
getPhasein interfaceSmartLifecycle
-
from
-
from
-
from
-
from
protected IntegrationFlowDefinition<?> from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) -
from
protected IntegrationFlowDefinition<?> from(MessageSource<?> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) -
from
-
from
-
from
-
from
-
from
-
from
protected IntegrationFlowDefinition<?> from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec) -
from
-
fromSupplier
-
fromSupplier
protected <T> IntegrationFlowBuilder fromSupplier(Supplier<T> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) -
from
-
from
protected IntegrationFlowBuilder from(Class<?> serviceInterface, @Nullable Consumer<GatewayProxySpec> endpointConfigurer)Start a flow from a proxy for the service interface.- Parameters:
serviceInterface- the service interface class.endpointConfigurer- theConsumerto configure proxy bean for gateway.- Returns:
- new
IntegrationFlowBuilder. - Since:
- 5.2
-
from
protected IntegrationFlowBuilder from(org.reactivestreams.Publisher<? extends Message<?>> publisher) -
buildFlow
-