Hi,
Is there a way to know about the taskId in a SinkTask ?
I need to differentiate tasks when logging specific actions, so would need to have access to a clientId or a taskId in the start() or put() method of my SinkTask.
I couldn’t find any public field anywhere, I only found a private KafkaConsumer field in the task’s context (SinkTaskContext), that has a private clientId field.
I could probably use reflection to dig the clientId string, but it’s a bit ugly.
Any ideas ?
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/F6A8DEE6B40A30419B89834C7CFF43F40357D994%40gsdgeup01env2.firmwide.corp.gs.com.
For more options, visit https://groups.google.com/d/optout.
Hi,
Yeah I thought of that, but this would be an arbitrary naming, uncorrelated from the kafka consumer threads.
Whilst this gives you a way of differentiating tasks, it doesn’t allow to pinpoint what tasks is working on which partitions.
Ideally, the Connect API would give access to this information (it’s here somewhere, it’s just not public nor protected), allowing to then correlate ; taskX is logging ‘foobar messages’, taskX is assigned to partitions 1/2/3 and its consumerlag is 123456.
Ultimately you could argue one could have the task log informations from TopicPartition etc, but other tools give you that anyway.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAPXNJrWWCyRARr%3D3%2BY01UEMMA1m1GrDpGfd_B2PwGqFb084reA%40mail.gmail.com.
Hi,
Yeah I thought of that, but this would be an arbitrary naming, uncorrelated from the kafka consumer threads.
Whilst this gives you a way of differentiating tasks, it doesn’t allow to pinpoint what tasks is working on which partitions.
Ideally, the Connect API would give access to this information (it’s here somewhere, it’s just not public nor protected), allowing to then correlate ; taskX is logging ‘foobar messages’, taskX is assigned to partitions 1/2/3 and its consumerlag is 123456.
Ultimately you could argue one could have the task log informations from TopicPartition etc, but other tools give you that anyway.
From: confluent-platform@googlegroups.com [mailto:confluent-platform@googlegroups.com] On Behalf Of Shikhar Bhushan
Sent: 30 November 2016 21:58
To: confluent-platform@googlegroups.com
Subject: Re: Kafka connect task identity
Hi Jonathan,
The task ID is not currently available through the interfaces exposed by the Connect API, though that seems like a simple reasonable enhancement, so that tasks' logging can also be correlated with framework actions on the tasks.
If you just want a way to distinguish between different tasks for connector-specific logging, you could pass in a property for it when generating your tasks' config in `Connector.taskConfigs()`.
[ Maybe not worth relying on, task ID's follow the format "$connectorName-$index", so you could in theory just pass that through. ]
Best,
Shikhar
On Wed, Nov 30, 2016 at 4:32 AM Skrzypek, Jonathan <Jonathan...@gs.com> wrote:
Hi,
Is there a way to know about the taskId in a SinkTask ?
I need to differentiate tasks when logging specific actions, so would need to have access to a clientId or a taskId in the start() or put() method of my SinkTask.
I couldn’t find any public field anywhere, I only found a private KafkaConsumer field in the task’s context (SinkTaskContext), that has a private clientId field.
I could probably use reflection to dig the clientId string, but it’s a bit ugly.
Any ideas ?
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/F6A8DEE6B40A30419B89834C7CFF43F40357D994%40gsdgeup01env2.firmwide.corp.gs.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAPXNJrWWCyRARr%3D3%2BY01UEMMA1m1GrDpGfd_B2PwGqFb084reA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/F6A8DEE6B40A30419B89834C7CFF43F40358EC08%40gsdgeup01env2.firmwide.corp.gs.com.To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.