Class MessagingTransformer<K,​V,​R>

  • Type Parameters:
    K - the key type.
    V - the value type.
    R - the result value type.
    All Implemented Interfaces:
    org.apache.kafka.streams.kstream.Transformer<K,​V,​org.apache.kafka.streams.KeyValue<K,​R>>

    public class MessagingTransformer<K,​V,​R>
    extends java.lang.Object
    implements org.apache.kafka.streams.kstream.Transformer<K,​V,​org.apache.kafka.streams.KeyValue<K,​R>>
    A Transformer implementation that invokes a MessagingFunction converting to/from spring-messaging Message. Can be used, for example, to invoke a Spring Integration flow.
    Since:
    2.3
    Author:
    Gary Russell
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void init​(org.apache.kafka.streams.processor.ProcessorContext context)  
      org.apache.kafka.streams.KeyValue<K,​R> transform​(K key, V value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MessagingTransformer

        public MessagingTransformer​(MessagingFunction function,
                                    MessagingMessageConverter converter)
        Construct an instance with the provided function and converter.
        Parameters:
        function - the function.
        converter - the converter.
    • Method Detail

      • init

        public void init​(org.apache.kafka.streams.processor.ProcessorContext context)
        Specified by:
        init in interface org.apache.kafka.streams.kstream.Transformer<K,​V,​R>
      • transform

        public org.apache.kafka.streams.KeyValue<K,​R> transform​(K key,
                                                                      V value)
        Specified by:
        transform in interface org.apache.kafka.streams.kstream.Transformer<K,​V,​R>
      • close

        public void close()
        Specified by:
        close in interface org.apache.kafka.streams.kstream.Transformer<K,​V,​R>