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.-
Field Summary
Fields inherited from class org.frankframework.extensions.kafka.AbstractKafkaFacade
properties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterMessageProcessed
(PipeLineResult processResult, RawMessageWrapper<org.apache.kafka.clients.consumer.ConsumerRecord<String, byte[]>> rawMessage, PipeLineSession pipeLineSession) Deprecated.Called to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.protected org.apache.kafka.clients.consumer.Consumer
<String, byte[]> Deprecated.void
closeThread
(Map<String, Object> threadContext) Deprecated.Finalizes a message receiving thread.void
Deprecated.Configure this component.extractMessage
(RawMessageWrapper<org.apache.kafka.clients.consumer.ConsumerRecord<String, byte[]>> wrappedMessage, Map<String, Object> threadContext) Deprecated.Extracts data from message obtained fromIPullingListener.getRawMessage(Map)
orIPushingListener.wrapRawMessage(Object, PipeLineSession)
.Deprecated.RawMessageWrapper
<org.apache.kafka.clients.consumer.ConsumerRecord<String, byte[]>> getRawMessage
(Map<String, Object> threadContext) Deprecated.Retrieves messages from queue or other channel, but does no processing on it.Deprecated.Prepares a thread for receiving messages.void
start()
Deprecated.Prepares the listener for receiving messages.void
stop()
Deprecated.Close all resources used for listening.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoader
Methods inherited from interface org.frankframework.core.HasPhysicalDestination
getDomain
-
Constructor Details
-
KafkaListener
public KafkaListener()Deprecated.
-
-
Method Details
-
configure
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 thisIConfigurable
. 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 theconfigure()
, to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configure
in interfaceIConfigurable
- Overrides:
configure
in classAbstractKafkaFacade
- 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. -
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. -
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 fromIPullingListener.getRawMessage(Map)
orIPushingListener.wrapRawMessage(Object, PipeLineSession)
. May also extract other parameters from the message and put those into the context.- Specified by:
extractMessage
in interfaceIListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,
byte[]>> - Parameters:
wrappedMessage
- TheRawMessageWrapper
from which to extract theMessage
.threadContext
- Context to populate. Either aPipeLineSession
or aMap
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 interfaceIListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,
byte[]>>
-
getPhysicalDestinationName
Deprecated.- Specified by:
getPhysicalDestinationName
in interfaceHasPhysicalDestination
-
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 interfaceIPullingListener<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
Deprecated.Description copied from interface:IPullingListener
Finalizes a message receiving thread. Called once for each thread that listens for messages, just beforeIListener.stop()
is called.- Specified by:
closeThread
in interfaceIPullingListener<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, orsynchronized
.Any thread-specific properties should be stored in and retrieved from the threadContext.
- Specified by:
getRawMessage
in interfaceIPullingListener<org.apache.kafka.clients.consumer.ConsumerRecord<String,
byte[]>>
-