You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for some clarity about these two ConsumerBuilder methods.
Here's the current signature and documentation comment for SetLogHandler():
publicConsumerBuilder<TKey,TValue> SetLogHandler(Action<IConsumer<TKey,TValue>,LogMessage>logHandler)
in class ConsumerBuilder<TKey,TValue>
TKey is Ignore
TValue isstring
Set the handler to call when there is information available to be logged. If not specified, a default callback that writes to stderr will be used.
Remarks: By default not many log messages are generated. For more verbose logging, specify one or more debug contexts using the 'Debug' configuration property. Warning: Log handlers are called spontaneously from internal librdkafka threads and the application must not call any Confluent.Kafka APIs from within a log handler or perform any prolonged operations.
Exceptions: Any exception thrown by your log handler will be silently ignored.
I'm interested in the part in bold. The first parameter to the callback is IConsumer. So you have access to the consumer within the callback... but you're not supposed to call anything on it/use any of its APIs? I want to check if I'm understanding correctly.
SetErrorHandler():
publicConsumerBuilder<TKey,TValue> SetErrorHandler(Action<IConsumer<TKey,TValue>,Error>errorHandler)
in class ConsumerBuilder<TKey,TValue>
TKey is Ignore
TValue isstring
Set the handler to call on error events e.g. connection failures or all brokers down. Note that the client will try to automatically recover from errors that are not marked as fatal. Non-fatal errors should be interpreted as informational rather than catastrophic.
Remarks: Executes as a side-effect of the Consume method (on the same thread).
Exceptions: Any exception thrown by your error handler will be silently ignored.
Does the same restriction about not using Confluent.Kafka APIs apply for SetErrorHandler()?
Thank you very much 🙏
The text was updated successfully, but these errors were encountered:
I'm looking for some clarity about these two
ConsumerBuilder
methods.Here's the current signature and documentation comment for
SetLogHandler()
:I'm interested in the part in bold. The first parameter to the callback is
IConsumer
. So you have access to the consumer within the callback... but you're not supposed to call anything on it/use any of its APIs? I want to check if I'm understanding correctly.SetErrorHandler()
:Does the same restriction about not using Confluent.Kafka APIs apply for
SetErrorHandler()
?Thank you very much 🙏
The text was updated successfully, but these errors were encountered: