Class KafkaListener

java.lang.Object
org.frankframework.extensions.kafka.AbstractKafkaFacade
org.frankframework.extensions.kafka.KafkaListener
All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasPhysicalDestination, IConfigurable, IListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>, IPullingListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>, IScopeProvider, NameAware, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Deprecated(forRemoval=false) @ConfigurationWarning("Experimental and under development. Do not use unless you wish to participate in this development.") public class KafkaListener extends AbstractKafkaFacade implements IPullingListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>
Deprecated.
Experimental IListener for listening to a topic in a Kafka instance. The Kafka integration is still under development so do not currently use unless you wish to participate in this development.
  • Constructor Details

    • KafkaListener

      public KafkaListener()
      Deprecated.
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Deprecated.
      Description copied from interface: IConfigurable
      Configure this component.

      configure() is called once at startup of the framework in the configure method of the owner of this IConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in the configure(), to improve performance.

      In the case of a container, this will propagate the configure signal to all components that apply.

      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class AbstractKafkaFacade
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • start

      public void start()
      Deprecated.
      Description copied from interface: IListener
      Prepares the listener for receiving messages. start() is called once each time the listener is started.
      Specified by:
      start in interface IListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>
    • buildConsumer

      protected org.apache.kafka.clients.consumer.Consumer<String,byte[]> buildConsumer()
      Deprecated.
    • stop

      public void stop()
      Deprecated.
      Description copied from interface: IListener
      Close all resources used for listening. Called once each time the listener is stopped.
      Specified by:
      stop in interface IListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>
    • extractMessage

      public Message extractMessage(@Nonnull RawMessageWrapper<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>> wrappedMessage, @Nonnull Map<String,Object> threadContext)
      Deprecated.
      Description copied from interface: IListener
      Extracts data from message obtained from IPullingListener.getRawMessage(Map) or IPushingListener.wrapRawMessage(Object, PipeLineSession). May also extract other parameters from the message and put those into the context.
      Specified by:
      extractMessage in interface IListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>
      Parameters:
      wrappedMessage - The RawMessageWrapper from which to extract the Message.
      threadContext - Context to populate. Either a PipeLineSession or a Map threadContext depending on caller.
      Returns:
      input Message for adapter.
    • afterMessageProcessed

      public void afterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>> rawMessage, PipeLineSession pipeLineSession)
      Deprecated.
      Description copied from interface: IListener
      Called to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.
      Specified by:
      afterMessageProcessed in interface IListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>
    • getPhysicalDestinationName

      public String getPhysicalDestinationName()
      Deprecated.
      Specified by:
      getPhysicalDestinationName in interface HasPhysicalDestination
    • openThread

      @Nonnull public Map<String,Object> openThread()
      Deprecated.
      Description copied from interface: IPullingListener
      Prepares a thread for receiving messages. Called once for each thread that will listen for messages.
      Specified by:
      openThread in interface IPullingListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>
      Returns:
      the threadContext for this thread. The threadContext is a Map in which thread-specific data can be stored. May not be null, must be a mutable map type.
    • closeThread

      public void closeThread(@Nonnull Map<String,Object> threadContext)
      Deprecated.
      Description copied from interface: IPullingListener
      Finalizes a message receiving thread. Called once for each thread that listens for messages, just before IListener.stop() is called.
      Specified by:
      closeThread in interface IPullingListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>
    • getRawMessage

      public RawMessageWrapper<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>> getRawMessage(@Nonnull Map<String,Object> threadContext)
      Deprecated.
      Description copied from interface: IPullingListener
      Retrieves messages from queue or other channel, but does no processing on it. Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, or synchronized.

      Any thread-specific properties should be stored in and retrieved from the threadContext.

      Specified by:
      getRawMessage in interface IPullingListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]>>