public class KafkaMessageDrivenChannelAdapter
extends org.springframework.integration.endpoint.MessageProducerSupport
implements org.springframework.integration.context.OrderlyShutdownCapable
Constructor and Description |
---|
KafkaMessageDrivenChannelAdapter(KafkaMessageListenerContainer messageListenerContainer) |
Modifier and Type | Method and Description |
---|---|
int |
afterShutdown() |
int |
beforeShutdown() |
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
getComponentType() |
protected void |
onInit() |
void |
setAutoCommitOffset(boolean autoCommitOffset)
Automatically commit the offsets when 'true'.
|
void |
setGenerateMessageId(boolean generateMessageId)
Generate
Message ids for produced messages. |
void |
setGenerateTimestamp(boolean generateTimestamp)
Generate
timestamp for produced messages. |
void |
setKeyDecoder(kafka.serializer.Decoder<?> keyDecoder) |
void |
setPayloadDecoder(kafka.serializer.Decoder<?> payloadDecoder) |
void |
setUseMessageBuilderFactory(boolean useMessageBuilderFactory)
Use the
MessageBuilderFactory returned by IntegrationObjectSupport.getMessageBuilderFactory() to create messages. |
sendMessage, setErrorChannel, setOutputChannel, setSendTimeout, setShouldTrack
doStop, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, toString
public KafkaMessageDrivenChannelAdapter(KafkaMessageListenerContainer messageListenerContainer)
public void setKeyDecoder(kafka.serializer.Decoder<?> keyDecoder)
public void setPayloadDecoder(kafka.serializer.Decoder<?> payloadDecoder)
public void setAutoCommitOffset(boolean autoCommitOffset)
Acknowledgment.acknowledge()
method.
Default 'true'.autoCommitOffset
- false to not auto-commit (default true).public void setGenerateMessageId(boolean generateMessageId)
Message
ids
for produced messages.
If set to false
, will try to use a default value. By default set to false
.
Note that this option is only guaranteed to work when
useMessageBuilderFactory
is false (default).
If the latter is set to true
, then some MessageBuilderFactory
implementations such as
DefaultMessageBuilderFactory
may ignore it.generateMessageId
- true if a message id should be generatedpublic void setGenerateTimestamp(boolean generateTimestamp)
timestamp
for produced messages. If set to false
, -1 is used instead.
By default set to false
.
Note that this option is only guaranteed to work when
useMessageBuilderFactory
is false (default).
If the latter is set to true
, then some MessageBuilderFactory
implementations such as
DefaultMessageBuilderFactory
may ignore it.generateTimestamp
- true if a timestamp should be generatedpublic void setUseMessageBuilderFactory(boolean useMessageBuilderFactory)
MessageBuilderFactory
returned by IntegrationObjectSupport.getMessageBuilderFactory()
to create messages.useMessageBuilderFactory
- true if the MessageBuilderFactory
returned by
IntegrationObjectSupport.getMessageBuilderFactory()
should be used.protected void onInit()
onInit
in class org.springframework.integration.endpoint.MessageProducerSupport
protected void doStart()
doStart
in class org.springframework.integration.endpoint.MessageProducerSupport
protected void doStop()
doStop
in class org.springframework.integration.endpoint.MessageProducerSupport
public java.lang.String getComponentType()
getComponentType
in interface org.springframework.integration.support.context.NamedComponent
getComponentType
in class org.springframework.integration.context.IntegrationObjectSupport
public int beforeShutdown()
beforeShutdown
in interface org.springframework.integration.context.OrderlyShutdownCapable
public int afterShutdown()
afterShutdown
in interface org.springframework.integration.context.OrderlyShutdownCapable