Class KclMessageDrivenChannelAdapter
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.aws.inbound.kinesis.KclMessageDrivenChannelAdapter
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.beans.factory.SmartInitializingSingleton,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationEventPublisherAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,org.springframework.integration.context.ExpressionCapable,org.springframework.integration.core.MessageProducer,org.springframework.integration.IntegrationPattern,org.springframework.integration.support.context.NamedComponent,org.springframework.integration.support.management.IntegrationInboundManagement,org.springframework.integration.support.management.IntegrationManagement,org.springframework.integration.support.management.ManageableLifecycle,org.springframework.integration.support.management.ManageableSmartLifecycle,org.springframework.integration.support.management.TrackableComponent
@ManagedResource
@IntegrationManagedResource
public class KclMessageDrivenChannelAdapter
extends org.springframework.integration.endpoint.MessageProducerSupport
implements org.springframework.context.ApplicationEventPublisherAware
The
MessageProducerSupport implementation for receiving data from Amazon
Kinesis stream(s) using AWS KCL.- Since:
- 2.2.0
- Author:
- Hervé Fortin, Artem Bilan, Dirk Bonhomme, Siddharth Jain, Minkyu Moon
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLockFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionKclMessageDrivenChannelAdapter(String... streams) KclMessageDrivenChannelAdapter(software.amazon.awssdk.regions.Region region, String... streams) KclMessageDrivenChannelAdapter(software.amazon.awssdk.services.kinesis.KinesisAsyncClient kinesisClient, software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClient cloudWatchClient, software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient dynamoDBClient, String... streams) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()protected voiddoStart()protected voiddoStop()Takes no action by default.protected org.springframework.core.AttributeAccessorgetErrorMessageAttributes(org.springframework.messaging.Message<?> message) protected voidonInit()voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) voidsetBindSourceRecord(boolean bindSourceRecord) Set to true to bind the source consumer record in the header namedIntegrationMessageHeaderAccessor.SOURCE_DATA.voidsetCheckpointMode(CheckpointMode checkpointMode) voidsetCheckpointsInterval(long checkpointsInterval) Sets the interval between 2 checkpoints.voidsetConsumerBackoff(int consumerBackoff) voidsetConsumerGroup(String consumerGroup) voidsetConverter(org.springframework.core.convert.converter.Converter<byte[], Object> converter) Specify aConverterto deserialize thebyte[]from record's body.voidsetEmbeddedHeadersMapper(org.springframework.integration.mapping.InboundMessageMapper<byte[]> embeddedHeadersMapper) Specify anInboundMessageMapperto extract message headers embedded into the record data.voidsetExecutor(org.springframework.core.task.TaskExecutor executor) voidsetFanOut(boolean fanOut) Specify a retrieval strategy: fan-out (true; default) or polling (false).voidsetGlueSchemaRegistryDeserializer(com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializer glueSchemaRegistryDeserializer) voidsetListenerMode(ListenerMode listenerMode) voidsetMetricsLevel(software.amazon.kinesis.metrics.MetricsLevel metricsLevel) Specify a metrics level to emit.voidsetStreamInitialSequence(software.amazon.kinesis.common.InitialPositionInStreamExtended streamInitialSequence) voidsetWorkerId(String workerId) Sets the worker identifier used to distinguish different workers/processes of a Kinesis application.toString()Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, isObserved, registerObservationRegistry, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setObservationConvention, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisherMethods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskSchedulerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedTypeMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName, getComponentType
-
Constructor Details
-
KclMessageDrivenChannelAdapter
-
KclMessageDrivenChannelAdapter
public KclMessageDrivenChannelAdapter(software.amazon.awssdk.regions.Region region, String... streams) -
KclMessageDrivenChannelAdapter
public KclMessageDrivenChannelAdapter(software.amazon.awssdk.services.kinesis.KinesisAsyncClient kinesisClient, software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClient cloudWatchClient, software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient dynamoDBClient, String... streams)
-
-
Method Details
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) - Specified by:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
-
setExecutor
public void setExecutor(org.springframework.core.task.TaskExecutor executor) -
setConsumerGroup
-
getConsumerGroup
-
setEmbeddedHeadersMapper
public void setEmbeddedHeadersMapper(org.springframework.integration.mapping.InboundMessageMapper<byte[]> embeddedHeadersMapper) Specify anInboundMessageMapperto extract message headers embedded into the record data.- Parameters:
embeddedHeadersMapper- theInboundMessageMapperto use.
-
setStreamInitialSequence
public void setStreamInitialSequence(software.amazon.kinesis.common.InitialPositionInStreamExtended streamInitialSequence) -
setConsumerBackoff
public void setConsumerBackoff(int consumerBackoff) -
setConverter
public void setConverter(org.springframework.core.convert.converter.Converter<byte[], Object> converter) Specify aConverterto deserialize thebyte[]from record's body. Can benullmeaning no deserialization.- Parameters:
converter- theConverterto use or null
-
setListenerMode
-
setCheckpointsInterval
public void setCheckpointsInterval(long checkpointsInterval) Sets the interval between 2 checkpoints.- Parameters:
checkpointsInterval- interval between 2 checkpoints (in milliseconds)
-
setCheckpointMode
-
setWorkerId
Sets the worker identifier used to distinguish different workers/processes of a Kinesis application.- Parameters:
workerId- the worker identifier to use
-
setGlueSchemaRegistryDeserializer
public void setGlueSchemaRegistryDeserializer(com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializer glueSchemaRegistryDeserializer) -
setBindSourceRecord
public void setBindSourceRecord(boolean bindSourceRecord) Set to true to bind the source consumer record in the header namedIntegrationMessageHeaderAccessor.SOURCE_DATA. Does not apply to batch listeners.- Parameters:
bindSourceRecord- true to bind.- Since:
- 2.2
-
setFanOut
public void setFanOut(boolean fanOut) Specify a retrieval strategy: fan-out (true; default) or polling (false).- Parameters:
fanOut- false for a polling retrieval strategy.- Since:
- 3.0.2
-
setMetricsLevel
public void setMetricsLevel(software.amazon.kinesis.metrics.MetricsLevel metricsLevel) Specify a metrics level to emit. Defaults toMetricsLevel.DETAILED.- Parameters:
metricsLevel- theMetricsLevelfor emitting (or not) metrics into Cloud Watch.
-
onInit
protected void onInit()- Overrides:
onInitin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStart
protected void doStart()- Overrides:
doStartin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStop
protected void doStop()Takes no action by default. Subclasses may override this if they need lifecycle-managed behavior.- Overrides:
doStopin classorg.springframework.integration.endpoint.MessageProducerSupport
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Specified by:
destroyin interfaceorg.springframework.integration.support.management.IntegrationManagement- Overrides:
destroyin classorg.springframework.integration.endpoint.AbstractEndpoint
-
getErrorMessageAttributes
protected org.springframework.core.AttributeAccessor getErrorMessageAttributes(org.springframework.messaging.Message<?> message) - Overrides:
getErrorMessageAttributesin classorg.springframework.integration.endpoint.MessageProducerSupport
-
toString
- Overrides:
toStringin classorg.springframework.integration.context.IntegrationObjectSupport
-