public class AxualClient
extends java.lang.Object
implements java.lang.AutoCloseable
ClientConfig object to the constructor. The configuration passed
in is automatically applied to all created Producers and Consumers.| Constructor and Description |
|---|
AxualClient(io.axual.common.config.ClientConfig config)
Instantiates a new Axual client with given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
<K,V> Consumer<K,V> |
buildConsumer(ConsumerConfig<K,V> consumerConfig,
Processor<K,V> processor)
Build a new Consumer with any key/value type.
|
Consumer<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> |
buildConsumer(GenericAvroConsumerConfig consumerConfig,
Processor<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> processor)
Build a new Consumer that consumes generic Avro messages.
|
<K extends org.apache.avro.specific.SpecificRecord,V extends org.apache.avro.specific.SpecificRecord> |
buildConsumer(SpecificAvroConsumerConfig<K,V> consumerConfig,
Processor<K,V> processor)
Build a new Consumer that consumes specific Avro messages.
|
Producer<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> |
buildProducer(GenericAvroProducerConfig producerConfig)
Build a new Producer that produces generic Avro messages.
|
<K,V> Producer<K,V> |
buildProducer(ProducerConfig<K,V> producerConfig)
Build a new Producer with any key/value type.
|
<K extends org.apache.avro.specific.SpecificRecord,V extends org.apache.avro.specific.SpecificRecord> |
buildProducer(SpecificAvroProducerConfig<K,V> producerConfig)
Build a new Producer that produces specific Avro messages.
|
void |
close() |
io.axual.common.config.ClientConfig |
getConfig()
Gets the client configuration.
|
public AxualClient(io.axual.common.config.ClientConfig config)
config - the configuration of the application's connection to Axual Platform.public io.axual.common.config.ClientConfig getConfig()
public <K,V> Consumer<K,V> buildConsumer(ConsumerConfig<K,V> consumerConfig, Processor<K,V> processor)
K - the key type of consumed messagesV - the value type of consumed messagesconsumerConfig - the consumer configurationprocessor - the processor that receives callbacks for every message receivedpublic Consumer<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> buildConsumer(GenericAvroConsumerConfig consumerConfig, Processor<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> processor)
consumerConfig - the consumer configurationprocessor - the processor that receives callbacks for every message receivedpublic <K extends org.apache.avro.specific.SpecificRecord,V extends org.apache.avro.specific.SpecificRecord> Consumer<K,V> buildConsumer(SpecificAvroConsumerConfig<K,V> consumerConfig, Processor<K,V> processor)
K - the specific key type of consumed Avro messagesV - the specific value type of consumed Avro messagesconsumerConfig - the consumer configurationprocessor - the processor that receives callbacks for every message receivedpublic <K,V> Producer<K,V> buildProducer(ProducerConfig<K,V> producerConfig)
K - the key type of produced messagesV - the value type of produced messagesproducerConfig - An instance of ProducerConfig containing the necessary
configuration to create this producerpublic Producer<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> buildProducer(GenericAvroProducerConfig producerConfig)
producerConfig - An instance of GenericAvroProducerConfig containing the
necessary configuration to create this producerpublic <K extends org.apache.avro.specific.SpecificRecord,V extends org.apache.avro.specific.SpecificRecord> Producer<K,V> buildProducer(SpecificAvroProducerConfig<K,V> producerConfig)
K - the specific key type of produced Avro messagesV - the specific value type of produced Avro messagesproducerConfig - An instance of SpecificAvroProducerConfig containing the
necessary configuration to create this producerProducerpublic void close()
close in interface java.lang.AutoCloseableCopyright © 2020–2021 Axual B.V.. All rights reserved.