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.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.ManageableLifecycle, org.springframework.integration.support.management.ManageableSmartLifecycle, org.springframework.integration.support.management.TrackableComponent

@ManagedResource @IntegrationManagedResource public class KclMessageDrivenChannelAdapter extends org.springframework.integration.endpoint.MessageProducerSupport
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
  • Field Summary

    Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint

    lifecycleCondition, lifecycleLock

    Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport

    EXPRESSION_PARSER, logger

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors
    Constructor
    Description
    KclMessageDrivenChannelAdapter(com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibConfiguration kinesisClientLibConfiguration)
     
    KclMessageDrivenChannelAdapter(com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibConfiguration kinesisClientLibConfiguration, AmazonKinesis kinesisClient, AmazonCloudWatch cloudWatchClient, AmazonDynamoDB dynamoDBClient)
     
     
     
    KclMessageDrivenChannelAdapter(String stream, AmazonKinesis kinesisClient, AmazonCloudWatch cloudWatchClient, AmazonDynamoDB dynamoDBClient, AWSCredentialsProvider kinesisProxyCredentialsProvider)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
     
    protected void
    Takes no action by default.
     
    protected org.springframework.core.AttributeAccessor
    getErrorMessageAttributes(org.springframework.messaging.Message<?> message)
     
    protected void
     
    void
    setBindSourceRecord(boolean bindSourceRecord)
    Set to true to bind the source consumer record in the header named IntegrationMessageHeaderAccessor.SOURCE_DATA.
    void
     
    void
    setCheckpointsInterval(long checkpointsInterval)
    Sets the interval between 2 checkpoints.
    void
    setConsumerBackoff(int consumerBackoff)
     
    void
    setConsumerGroup(String consumerGroup)
     
    void
    setConverter(org.springframework.core.convert.converter.Converter<byte[],Object> converter)
    Specify a Converter to deserialize the byte[] from record's body.
    void
    setEmbeddedHeadersMapper(org.springframework.integration.mapping.InboundMessageMapper<byte[]> embeddedHeadersMapper)
    Specify an InboundMessageMapper to extract message headers embedded into the record data.
    void
    setExecutor(org.springframework.core.task.TaskExecutor executor)
     
    void
    setIdleBetweenPolls(int idleBetweenPolls)
     
    void
     
    void
    setStreamInitialSequence(com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionInStream streamInitialSequence)
     
    void
    setWorkerId(String workerId)
    Sets the worker identifier used to distinguish different workers/processes of a Kinesis application.
     

    Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport

    afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher

    Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint

    doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop

    Methods 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, setTaskScheduler

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.integration.support.context.NamedComponent

    getBeanName, getComponentName, getComponentType
  • Constructor Details

    • KclMessageDrivenChannelAdapter

      public KclMessageDrivenChannelAdapter(String streams)
    • KclMessageDrivenChannelAdapter

      public KclMessageDrivenChannelAdapter(String streams, Regions region)
    • KclMessageDrivenChannelAdapter

      public KclMessageDrivenChannelAdapter(String stream, AmazonKinesis kinesisClient, AmazonCloudWatch cloudWatchClient, AmazonDynamoDB dynamoDBClient, AWSCredentialsProvider kinesisProxyCredentialsProvider)
    • KclMessageDrivenChannelAdapter

      public KclMessageDrivenChannelAdapter(com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibConfiguration kinesisClientLibConfiguration)
    • KclMessageDrivenChannelAdapter

      public KclMessageDrivenChannelAdapter(com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibConfiguration kinesisClientLibConfiguration, AmazonKinesis kinesisClient, AmazonCloudWatch cloudWatchClient, AmazonDynamoDB dynamoDBClient)
  • Method Details

    • setExecutor

      public void setExecutor(org.springframework.core.task.TaskExecutor executor)
    • setConsumerGroup

      public void setConsumerGroup(String consumerGroup)
    • getConsumerGroup

      public String getConsumerGroup()
    • setEmbeddedHeadersMapper

      public void setEmbeddedHeadersMapper(org.springframework.integration.mapping.InboundMessageMapper<byte[]> embeddedHeadersMapper)
      Specify an InboundMessageMapper to extract message headers embedded into the record data.
      Parameters:
      embeddedHeadersMapper - the InboundMessageMapper to use.
    • setStreamInitialSequence

      public void setStreamInitialSequence(com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionInStream streamInitialSequence)
    • setIdleBetweenPolls

      public void setIdleBetweenPolls(int idleBetweenPolls)
    • setConsumerBackoff

      public void setConsumerBackoff(int consumerBackoff)
    • setConverter

      public void setConverter(org.springframework.core.convert.converter.Converter<byte[],Object> converter)
      Specify a Converter to deserialize the byte[] from record's body. Can be null meaning no deserialization.
      Parameters:
      converter - the Converter to use or null
    • setListenerMode

      public void setListenerMode(ListenerMode listenerMode)
    • setCheckpointsInterval

      public void setCheckpointsInterval(long checkpointsInterval)
      Sets the interval between 2 checkpoints.
      Parameters:
      checkpointsInterval - interval between 2 checkpoints (in milliseconds)
    • setCheckpointMode

      public void setCheckpointMode(CheckpointMode checkpointMode)
    • setWorkerId

      public void setWorkerId(String workerId)
      Sets the worker identifier used to distinguish different workers/processes of a Kinesis application.
      Parameters:
      workerId - the worker identifier to use
    • setBindSourceRecord

      public void setBindSourceRecord(boolean bindSourceRecord)
      Set to true to bind the source consumer record in the header named IntegrationMessageHeaderAccessor.SOURCE_DATA. Does not apply to batch listeners.
      Parameters:
      bindSourceRecord - true to bind.
      Since:
      2.2
    • onInit

      protected void onInit()
      Overrides:
      onInit in class org.springframework.integration.endpoint.MessageProducerSupport
    • doStart

      protected void doStart()
      Overrides:
      doStart in class org.springframework.integration.endpoint.MessageProducerSupport
    • doStop

      protected void doStop()
      Takes no action by default. Subclasses may override this if they need lifecycle-managed behavior.
      Overrides:
      doStop in class org.springframework.integration.endpoint.MessageProducerSupport
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Overrides:
      destroy in class org.springframework.integration.endpoint.AbstractEndpoint
    • getErrorMessageAttributes

      protected org.springframework.core.AttributeAccessor getErrorMessageAttributes(org.springframework.messaging.Message<?> message)
      Overrides:
      getErrorMessageAttributes in class org.springframework.integration.endpoint.MessageProducerSupport
    • toString

      public String toString()
      Overrides:
      toString in class org.springframework.integration.context.IntegrationObjectSupport