|
Spring Integration Kafka Support | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.kafka.core.DefaultConnectionFactory
public class DefaultConnectionFactory
Default implementation of ConnectionFactory
Constructor Summary | |
---|---|
DefaultConnectionFactory(Configuration configuration)
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
Connection |
connect(BrokerAddress brokerAddress)
Create a connection to a Kafka broker, caching it internally |
void |
destroy()
|
java.lang.String |
getClientId()
|
Configuration |
getConfiguration()
|
BrokerAddress |
getLeader(Partition partition)
Return the leader for a single partition |
java.util.Map<Partition,BrokerAddress> |
getLeaders(java.lang.Iterable<Partition> partitions)
Retrieve the leaders for a set of partitions. |
java.util.Collection<Partition> |
getPartitions(java.lang.String topic)
Retrieves the partitions of a given topic |
void |
refreshLeaders(java.util.Collection<java.lang.String> topics)
Refresh the broker connections and partition leader map. |
void |
setBufferSize(int bufferSize)
The buffer size for this client |
void |
setClientId(java.lang.String clientId)
A client name to be used throughout this connection. |
void |
setFetchMetadataTimeout(int fetchMetadataTimeout)
The timeout on fetching metadata (e.g. |
void |
setMaxWait(int maxWait)
The maximum amount of time that a server fetch operation will wait before returning (unless minFetchSizeInBytes ) are available. |
void |
setMinBytes(int minBytes)
The minimum amount of data that a server fetch operation will wait for before returning, unless maxWaitTimeInMs has elapsed. |
void |
setSocketTimeout(int socketTimeout)
The socket timeout for this client |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultConnectionFactory(Configuration configuration)
Method Detail |
---|
public Configuration getConfiguration()
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public void setMinBytes(int minBytes)
maxWaitTimeInMs
has elapsed.
In conjunction with setMaxWait(int)
, controls latency
and throughput.
Smaller values increase responsiveness, but may increase the number of poll operations,
potentially reducing throughput and increasing CPU consumption.
minBytes
- the amount of data to fetchpublic void setMaxWait(int maxWait)
minFetchSizeInBytes
) are available.
In conjunction with setMinBytes(int)
,
controls latency and throughput.
Smaller intervals increase responsiveness, but may increase
the number of poll operations, potentially increasing CPU
consumption and reducing throughput.
maxWait
- timeout to waitpublic java.lang.String getClientId()
public void setClientId(java.lang.String clientId)
clientId
- the client namepublic void setBufferSize(int bufferSize)
bufferSize
- the buffer sizepublic void setSocketTimeout(int socketTimeout)
socketTimeout
- the socket timeoutpublic void setFetchMetadataTimeout(int fetchMetadataTimeout)
fetchMetadataTimeout
- timeoutpublic java.util.Map<Partition,BrokerAddress> getLeaders(java.lang.Iterable<Partition> partitions)
ConnectionFactory
getLeaders
in interface ConnectionFactory
partitions
- whose leaders are queried
ConnectionFactory.getLeaders(Iterable)
public BrokerAddress getLeader(Partition partition)
ConnectionFactory
getLeader
in interface ConnectionFactory
partition
- the partition whose leader is queried
ConnectionFactory.getLeader(Partition)
public Connection connect(BrokerAddress brokerAddress)
ConnectionFactory
connect
in interface ConnectionFactory
brokerAddress
- a broker address
ConnectionFactory.connect(BrokerAddress)
public void refreshLeaders(java.util.Collection<java.lang.String> topics)
ConnectionFactory
refreshLeaders
in interface ConnectionFactory
topics
- the topics for which to refresh the leadersConnectionFactory.refreshLeaders(Collection)
public java.util.Collection<Partition> getPartitions(java.lang.String topic)
ConnectionFactory
getPartitions
in interface ConnectionFactory
topic
- the topic to query for
ConnectionFactory.getPartitions(String)
|
Spring Integration Kafka Support | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |