[jira] [Comment Edited] (KAFKA-5409) Providing a custom client-id to the ConsoleProducer tool

2017-06-08 Thread Paolo Patierno (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-5409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16043185#comment-16043185
 ] 

Paolo Patierno edited comment on KAFKA-5409 at 6/8/17 6:23 PM:
---

Hi Bharat,
you are right but ... inside the getNewProducerProps() method, the call to 
producerProps(config) gets the "extraProducerProps" and fill the properties 
(i.e. the client.id passed by the --producer-property option) in the right way 
... 

{code}
private def producerProps(config: ProducerConfig): Properties = {
val props =
  if (config.options.has(config.producerConfigOpt))
Utils.loadProps(config.options.valueOf(config.producerConfigOpt))
  else new Properties
props.putAll(config.extraProducerProps)
props
  }
{code}

then ... the client.id is overridden by :

{code}
props.put(ProducerConfig.CLIENT_ID_CONFIG, "console-producer")
{code}

so the --producer-property option loses its effect.


was (Author: ppatierno):
Hi Bharat,
you are right but ... inside the getNewProducerProps() method, the call to 
producerProps(config) gets the "extraProducerProps" and fill the properties 
(i.e. the client.id passed by the --producer-property option) in the right way 
then ... the client.id is overridden by :

{code}
props.put(ProducerConfig.CLIENT_ID_CONFIG, "console-producer")
{code}

so the --producer-property option loses its effect.

> Providing a custom client-id to the ConsoleProducer tool
> 
>
> Key: KAFKA-5409
> URL: https://issues.apache.org/jira/browse/KAFKA-5409
> Project: Kafka
>  Issue Type: Improvement
>  Components: tools
>Reporter: Paolo Patierno
>Priority: Minor
>
> Hi,
> I see that the client-id properties for the ConsoleProducer tool is always 
> "console-producer". It could be useful having it as parameter on the command 
> line or generating a random one like happens for the ConsolerConsumer.
> If it makes sense to you, I can work on that.
> Thanks,
> Paolo.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Comment Edited] (KAFKA-5409) Providing a custom client-id to the ConsoleProducer tool

2017-06-08 Thread Bharat Viswanadham (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-5409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16043002#comment-16043002
 ] 

Bharat Viswanadham edited comment on KAFKA-5409 at 6/8/17 4:44 PM:
---

Hi Paolo,
There are 2 ways provided currently to pass in additional producer properties.
1. Using --producer-property. Ex: --producer-property client.id=producer1
2. Using --producer.config Ex: -producer.config=<>
In config file add the parameter, you are interested.






was (Author: bharatviswa):
Hi Paolo,
There are 2 ways provided currently to pass in additional producer properties.
1. Using --producer-property. Ex: --producer-property client.id=producer1
2. Using --producer.config Ex: -producer.config=<>
In config file add the parameter, you are interested.





> Providing a custom client-id to the ConsoleProducer tool
> 
>
> Key: KAFKA-5409
> URL: https://issues.apache.org/jira/browse/KAFKA-5409
> Project: Kafka
>  Issue Type: Improvement
>  Components: tools
>Reporter: Paolo Patierno
>Priority: Minor
>
> Hi,
> I see that the client-id properties for the ConsoleProducer tool is always 
> "console-producer". It could be useful having it as parameter on the command 
> line or generating a random one like happens for the ConsolerConsumer.
> If it makes sense to you, I can work on that.
> Thanks,
> Paolo.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)