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

ASF GitHub Bot commented on KAFKA-3923:
---------------------------------------

guozhangwang commented on issue #1579: KAFKA-3923: Make KafkaMetric not final, 
update JmxReporter and unit tests
URL: https://github.com/apache/kafka/pull/1579#issuecomment-353669258
 
 
   Closing for cleanup.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> MetricReporter interface depends on final class KafkaMetric instead of Metric 
> interface
> ---------------------------------------------------------------------------------------
>
>                 Key: KAFKA-3923
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3923
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>            Reporter: Igor Stepanov
>
> Hello,
> I'm working on exposing Kafka's consumer/producer metrics to Spring Actuator.
> To achieve this, I've implemented Kafka's MetricReporter interface to allow 
> injecting it into the appropriate consumer/producer. No issues with 
> implementation itself, fine for me.
> But now I've moved to writing unit tests for this implementation and decided 
> to use mocked KafkaMetric instances for this. But mocking of KafkaMetric 
> itself is not so plain - the class is final. The logical step is to use 
> Metric interface for mocking, but MetricReporter accepts only KafkaMetric.
> I know that technically I can use PowerMock and most probably it will work 
> fine in this case, but talking about Kafka itself, is it a good approach to 
> depend on the exact implementation when interface is available?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to