public class ConsumerBuilder
extends java.lang.Object
| Constructor and Description |
|---|
ConsumerBuilder(java.lang.String base,
ChannelAuth auth,
java.lang.String consumerGroup)
Constructor for
ConsumerBuilder |
| Modifier and Type | Method and Description |
|---|---|
Consumer |
build()
|
ConsumerBuilder |
withCertificateBundle(java.lang.String verifyCertBundle)
|
ConsumerBuilder |
withConsumerPathPrefix(java.lang.String consumerPathPrefix)
|
ConsumerBuilder |
withExtraConfigs(java.util.Properties extraConfigs)
|
ConsumerBuilder |
withHttpProxy(HttpProxySettings httpProxySettings)
|
ConsumerBuilder |
withRetryOnFail(boolean retryOnFail)
|
public ConsumerBuilder(java.lang.String base,
ChannelAuth auth,
java.lang.String consumerGroup)
Constructor for ConsumerBuilder
base - base URL at which the streaming service resides.auth - Authentication object to use for channel requests.consumerGroup - Consumer group to subscribe the channel consumer topublic ConsumerBuilder withConsumerPathPrefix(java.lang.String consumerPathPrefix)
consumerPathPrefix - Path to append to consumer-related requests made to the streaming service. Note that
if the pathPrefix parameter is set to a non-empty value, the pathPrefix value will be
appended to consumer-related requests instead of the consumerPathPrefix value.ConsumerBuilder instancepublic ConsumerBuilder withRetryOnFail(boolean retryOnFail)
retryOnFail - Whether or not the channel will automatically retry a call which failed due to a temporary
error.ConsumerBuilder instancepublic ConsumerBuilder withCertificateBundle(java.lang.String verifyCertBundle)
verifyCertBundle - CA Bundle chain certificates. This string shall be either the certificates themselves or
a path to a CA bundle file containing those certificates. The CA bundle is used to
validate that the certificate of the authentication server being connected to was signed
by a valid authority. If set to an empty string, the server certificate will not be
validated.ConsumerBuilder instancepublic ConsumerBuilder withExtraConfigs(java.util.Properties extraConfigs)
extraConfigs - Dictionary of key/value pairs containing any custom configuration settings which should be
sent to the streaming service when a consumer is created. Examples of key/value pairs are:
("auto.offset.reset", "latest"); ("request.timeout.ms", 30000) and
("session.timeout.ms", 10000).ConsumerBuilder instancepublic ConsumerBuilder withHttpProxy(HttpProxySettings httpProxySettings)
httpProxySettings - contains http proxy hostname, port, username and password.ConsumerBuilder instancepublic Consumer build() throws TemporaryError
Consumer object which only exposes the Channel consume related methods, e.g.:
Channel.create(), Channel.subscribe(List), Channel.subscriptions(),
Channel.consume(), Channel.commit(),
Channel.run(ConsumerRecordProcessor, List, int), Channel.delete(), Channel.stop()
and Channel.close()TemporaryError - if Channel http client request object failed to be created.