KafkaOutput Interface
public interface KafkaOutput
KafkaOutput(name = "event", topic = "users", brokerList="broker:29092") OutputBinding<String<output, final ExecutionContext context) { context.getLogger().info("Message:" + message); output.setValue(message); return "{ \"id": "" + System.currentTimeMillis() + "", "description": "" + message + "" }"; }
Method Summary
Modifier and Type | Method and Description |
---|---|
Broker |
authenticationMode()
SASL mechanism to use for authentication. Default: PLAIN |
int |
batchSize()
Defines the maximum number of messages batched in one MessageSet. default: 10000 |
String |
brokerList()
Defines the BrokerList. |
String |
dataType()
Defines how Functions runtime should treat the parameter value. Possible values are:
|
boolean |
enableIdempotence()
When set to `true`, the producer will ensure that messages are successfully produced exactly once and in the original produce order. default: false |
int |
maxMessageBytes()
Defines the maximum transmit message size. Default: 1MB |
int |
maxRetries()
How many times to retry sending a failing Message. **Note:** default: 2 Retrying may cause reordering unless EnableIdempotence is set to true. |
int |
messageTimeoutMs()
Local message timeout. This value is only enforced locally and limits the time a produced message waits for successful delivery. A time of 0 is infinite. This is the maximum time used to deliver a message (including retries). Delivery error occurs when either the retry count or the message timeout are exceeded. default: 300000 |
String |
name()
The variable name used in function.json. |
String |
password()
SASL password with the PLAIN and SASL-SCRAM-.. mechanisms Default is plaintext security.protocol in librdkafka |
Broker |
protocol()
Gets or sets the security protocol used to communicate with brokers default is PLAINTEXT |
int |
requestTimeoutMs()
The ack timeout of the producer request in milliseconds. default: 5000 |
String |
sslCaLocation()
Path to CA certificate file for verifying the broker's certificate. ssl.ca.location in librdkafka |
String |
sslCertificateLocation()
Path to client's certificate. ssl.certificate.location in librdkafka |
String |
sslKeyLocation()
Path to client's private key (PEM) used for authentication. Default "" ssl.key.location in librdkafka |
String |
sslKeyPassword()
Password for client's certificate. ssl.key.password in librdkafka |
String |
topic()
Defines the Topic. |
String |
username()
SASL username with the PLAIN and SASL-SCRAM-.. mechanisms Default: "" |
Method Details
authenticationMode
public BrokerAuthenticationMode authenticationMode() default BrokerAuthenticationMode.NOTSET
SASL mechanism to use for authentication. Default: PLAIN
Returns:
batchSize
public int batchSize() default 10000
Defines the maximum number of messages batched in one MessageSet. default: 10000
Returns:
brokerList
public String brokerList()
Defines the BrokerList.
Returns:
dataType
public String dataType() default ""
Defines how Functions runtime should treat the parameter value. Possible values are:
<li>
<p>"" or string: treat it as a string whose value is serialized from the parameter </p>
</li>
<li>
<p>binary: treat it as a binary data whose value comes from for example OutputBinding<byte[]<</p>
</li>
Returns:
enableIdempotence
public boolean enableIdempotence() default false
When set to `true`, the producer will ensure that messages are successfully produced exactly once and in the original produce order. default: false
Returns:
maxMessageBytes
public int maxMessageBytes() default 1000012
Defines the maximum transmit message size. Default: 1MB
Returns:
maxRetries
public int maxRetries() default 2
How many times to retry sending a failing Message. **Note:** default: 2 Retrying may cause reordering unless EnableIdempotence is set to true.
Returns:
messageTimeoutMs
public int messageTimeoutMs() default 300000
Local message timeout. This value is only enforced locally and limits the time a produced message waits for successful delivery. A time of 0 is infinite. This is the maximum time used to deliver a message (including retries). Delivery error occurs when either the retry count or the message timeout are exceeded. default: 300000
Returns:
name
public String name()
The variable name used in function.json.
Returns:
password
public String password() default ""
SASL password with the PLAIN and SASL-SCRAM-.. mechanisms Default is plaintext
security.protocol in librdkafka
Returns:
protocol
public BrokerProtocol protocol() default BrokerProtocol.NOTSET
Gets or sets the security protocol used to communicate with brokers default is PLAINTEXT
Returns:
requestTimeoutMs
public int requestTimeoutMs() default 5000
The ack timeout of the producer request in milliseconds. default: 5000
Returns:
sslCaLocation
public String sslCaLocation() default ""
Path to CA certificate file for verifying the broker's certificate. ssl.ca.location in librdkafka
Returns:
sslCertificateLocation
public String sslCertificateLocation() default ""
Path to client's certificate. ssl.certificate.location in librdkafka
Returns:
sslKeyLocation
public String sslKeyLocation() default ""
Path to client's private key (PEM) used for authentication. Default "" ssl.key.location in librdkafka
Returns:
sslKeyPassword
public String sslKeyPassword() default ""
Password for client's certificate. ssl.key.password in librdkafka
Returns:
topic
public String topic()
Defines the Topic.
Returns:
username
public String username() default ""
SASL username with the PLAIN and SASL-SCRAM-.. mechanisms Default: ""
Returns: