Class KplMessageHandler

java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.aws.outbound.AbstractAwsMessageHandler<Void>
org.springframework.integration.aws.outbound.KplMessageHandler
All Implemented Interfaces:
org.reactivestreams.Subscriber<org.springframework.messaging.Message<?>>, 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.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.core.Ordered, org.springframework.integration.context.ExpressionCapable, org.springframework.integration.context.Orderable, org.springframework.integration.core.MessageProducer, org.springframework.integration.handler.HeaderPropagationAware, org.springframework.integration.IntegrationPattern, org.springframework.integration.support.context.NamedComponent, org.springframework.integration.support.management.IntegrationManagement, org.springframework.integration.support.management.TrackableComponent, org.springframework.messaging.MessageHandler, reactor.core.CoreSubscriber<org.springframework.messaging.Message<?>>

public class KplMessageHandler extends AbstractAwsMessageHandler<Void> implements org.springframework.context.Lifecycle
The AbstractMessageHandler implementation for the Amazon Kinesis Producer Library putRecord(s).
Since:
2.2
Author:
Arnaud Lecollaire, Artem Bilan
See Also:
  • KinesisAsyncClient.putRecord(PutRecordRequest)
  • KinesisAsyncClient.putRecords(PutRecordsRequest)
  • AsyncHandler
  • 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.aws.outbound.AbstractAwsMessageHandler

    DEFAULT_SEND_TIMEOUT

    Fields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler

    messagingTemplate

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

    EXPRESSION_PARSER, logger

    Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement

    METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    KplMessageHandler(com.amazonaws.services.kinesis.producer.KinesisProducer kinesisProducer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Map<String,?>
    additionalOnSuccessHeaders(software.amazon.awssdk.awscore.AwsRequest request, software.amazon.awssdk.awscore.AwsResponse response)
     
    protected CompletableFuture<? extends software.amazon.awssdk.awscore.AwsResponse>
    handleMessageToAws(org.springframework.messaging.Message<?> message, software.amazon.awssdk.awscore.AwsRequest request)
     
    boolean
     
    protected software.amazon.awssdk.awscore.AwsRequest
    messageToAwsRequest(org.springframework.messaging.Message<?> message)
     
    void
    setConverter(org.springframework.core.convert.converter.Converter<Object,byte[]> converter)
    void
    setEmbeddedHeadersMapper(org.springframework.integration.mapping.OutboundMessageMapper<byte[]> embeddedHeadersMapper)
    Specify a OutboundMessageMapper for embedding message headers into the record data together with payload.
    void
    setExplicitHashKey(String explicitHashKey)
     
    void
    setExplicitHashKeyExpression(org.springframework.expression.Expression explicitHashKeyExpression)
     
    void
    setExplicitHashKeyExpressionString(String explicitHashKeyExpression)
     
    void
    setFlushDuration(Duration flushDuration)
    Configure a Duration how often to call a KinesisProducer.flush().
    void
    setGlueSchema(com.amazonaws.services.schemaregistry.common.Schema glueSchema)
    Set a Schema to add into a UserRecord built from the request message.
    void
    setGlueSchemaExpression(org.springframework.expression.Expression glueSchemaExpression)
    Set a SpEL expression for Schema to add into a UserRecord built from the request message.
    void
    setGlueSchemaExpressionString(String glueSchemaExpression)
    Set a SpEL expression for Schema to add into a UserRecord built from the request message.
    void
    setHeaderMapper(org.springframework.integration.mapping.HeaderMapper<Void> headerMapper)
    Unsupported operation.
    void
    setMessageConverter(org.springframework.messaging.converter.MessageConverter messageConverter)
    Configure a MessageConverter for converting payload to byte[] for Kinesis record.
    void
    setPartitionKey(String partitionKey)
     
    void
    setPartitionKeyExpression(org.springframework.expression.Expression partitionKeyExpression)
     
    void
    setPartitionKeyExpressionString(String partitionKeyExpression)
     
    void
    setSequenceNumberExpression(org.springframework.expression.Expression sequenceNumberExpression)
     
    void
    setSequenceNumberExpressionString(String sequenceNumberExpression)
     
    void
    setStream(String stream)
     
    void
    setStreamExpression(org.springframework.expression.Expression streamExpression)
     
    void
     
    void
     
    void
     

    Methods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler

    addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setupMessageProcessor, shouldSplitOutput, updateNotPropagatedHeaders

    Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler

    handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConvention

    Methods inherited from class org.springframework.integration.handler.MessageHandlerSupport

    buildSendTimer, destroy, getComponentType, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack

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

    afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface reactor.core.CoreSubscriber

    currentContext

    Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement

    getThisAs

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

    getBeanName, getComponentName
  • Constructor Details

    • KplMessageHandler

      public KplMessageHandler(com.amazonaws.services.kinesis.producer.KinesisProducer kinesisProducer)
  • Method Details

    • setConverter

      @Deprecated public void setConverter(org.springframework.core.convert.converter.Converter<Object,byte[]> converter)
      Specify a Converter to serialize payload to the byte[] if that isn't byte[] already.
      Parameters:
      converter - the Converter to use; cannot be null.
    • setMessageConverter

      public void setMessageConverter(org.springframework.messaging.converter.MessageConverter messageConverter)
      Configure a MessageConverter for converting payload to byte[] for Kinesis record.
      Parameters:
      messageConverter - the MessageConverter to use.
      Since:
      2.3
    • setStream

      public void setStream(String stream)
    • setStreamExpressionString

      public void setStreamExpressionString(String streamExpression)
    • setStreamExpression

      public void setStreamExpression(org.springframework.expression.Expression streamExpression)
    • setPartitionKey

      public void setPartitionKey(String partitionKey)
    • setPartitionKeyExpressionString

      public void setPartitionKeyExpressionString(String partitionKeyExpression)
    • setPartitionKeyExpression

      public void setPartitionKeyExpression(org.springframework.expression.Expression partitionKeyExpression)
    • setExplicitHashKey

      public void setExplicitHashKey(String explicitHashKey)
    • setExplicitHashKeyExpressionString

      public void setExplicitHashKeyExpressionString(String explicitHashKeyExpression)
    • setExplicitHashKeyExpression

      public void setExplicitHashKeyExpression(org.springframework.expression.Expression explicitHashKeyExpression)
    • setSequenceNumberExpressionString

      public void setSequenceNumberExpressionString(String sequenceNumberExpression)
    • setSequenceNumberExpression

      public void setSequenceNumberExpression(org.springframework.expression.Expression sequenceNumberExpression)
    • setEmbeddedHeadersMapper

      public void setEmbeddedHeadersMapper(org.springframework.integration.mapping.OutboundMessageMapper<byte[]> embeddedHeadersMapper)
      Specify a OutboundMessageMapper for embedding message headers into the record data together with payload.
      Parameters:
      embeddedHeadersMapper - the OutboundMessageMapper to embed headers into the record data.
      Since:
      2.0
      See Also:
      • EmbeddedJsonHeadersMessageMapper
    • setFlushDuration

      public void setFlushDuration(Duration flushDuration)
      Configure a Duration how often to call a KinesisProducer.flush().
      Parameters:
      flushDuration - the Duration to periodic call of a KinesisProducer.flush().
      Since:
      2.3.6
    • setHeaderMapper

      public void setHeaderMapper(org.springframework.integration.mapping.HeaderMapper<Void> headerMapper)
      Overrides:
      setHeaderMapper in class AbstractAwsMessageHandler<Void>
      Parameters:
      headerMapper - is not used.
      See Also:
    • setGlueSchema

      public void setGlueSchema(com.amazonaws.services.schemaregistry.common.Schema glueSchema)
      Set a Schema to add into a UserRecord built from the request message.
      Parameters:
      glueSchema - the Schema to add into a UserRecord.
      Since:
      2.5.2
      See Also:
      • UserRecord.setSchema(Schema)
    • setGlueSchemaExpressionString

      public void setGlueSchemaExpressionString(String glueSchemaExpression)
      Set a SpEL expression for Schema to add into a UserRecord built from the request message.
      Parameters:
      glueSchemaExpression - the SpEL expression to evaluate a Schema.
      Since:
      2.5.2
      See Also:
      • UserRecord.setSchema(Schema)
    • setGlueSchemaExpression

      public void setGlueSchemaExpression(org.springframework.expression.Expression glueSchemaExpression)
      Set a SpEL expression for Schema to add into a UserRecord built from the request message.
      Parameters:
      glueSchemaExpression - the SpEL expression to evaluate a Schema.
      Since:
      2.5.2
      See Also:
      • UserRecord.setSchema(Schema)
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • messageToAwsRequest

      protected software.amazon.awssdk.awscore.AwsRequest messageToAwsRequest(org.springframework.messaging.Message<?> message)
      Specified by:
      messageToAwsRequest in class AbstractAwsMessageHandler<Void>
    • handleMessageToAws

      protected CompletableFuture<? extends software.amazon.awssdk.awscore.AwsResponse> handleMessageToAws(org.springframework.messaging.Message<?> message, software.amazon.awssdk.awscore.AwsRequest request)
      Specified by:
      handleMessageToAws in class AbstractAwsMessageHandler<Void>
    • additionalOnSuccessHeaders

      protected Map<String,?> additionalOnSuccessHeaders(software.amazon.awssdk.awscore.AwsRequest request, software.amazon.awssdk.awscore.AwsResponse response)
      Specified by:
      additionalOnSuccessHeaders in class AbstractAwsMessageHandler<Void>