Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting Spring Sleuth implementation of @KafkaListener support #83

Merged
merged 1 commit into from Oct 27, 2020

Conversation

orange-buffalo
Copy link
Contributor

A fix for #26.

@@ -26,7 +26,6 @@

@KafkaListener(topics = "spring")
public void listen(String message) {
// TODO: no active span
System.out.println("active span: " + tracer.activeSpan());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orange-buffalo could you add a check that active span is not null here anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, added an assertion.

*/
package io.opentracing.contrib.kafka.spring;

import io.opentracing.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't use .* in imports

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. It would be helpful for the contributors if project owners integrated a checkstyle or similar tool into the build, if some code convention rules are important to them.

import org.springframework.kafka.core.DefaultKafkaProducerFactory;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.core.ProducerFactory;
import org.springframework.kafka.core.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't use .* in imports

}

@Pointcut("execution(public * org.springframework.kafka.config.KafkaListenerContainerFactory.createListenerContainer(..))")
private void anyCreateListenerContainer() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need it if it doesn't do anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean, it is used by @Around aspect. Defining a pointcut is a canonical Spring AOP way to introduce aspects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

@coveralls
Copy link

coveralls commented Oct 27, 2020

Pull Request Test Coverage Report for Build 250

  • 35 of 42 (83.33%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.6%) to 67.763%

Changes Missing Coverage Covered Lines Changed/Added Lines %
opentracing-kafka-spring/src/main/java/io/opentracing/contrib/kafka/spring/TracingKafkaAspect.java 15 17 88.24%
opentracing-kafka-spring/src/main/java/io/opentracing/contrib/kafka/spring/MessageListenerMethodInterceptor.java 20 25 80.0%
Totals Coverage Status
Change from base Build 247: 1.6%
Covered Lines: 309
Relevant Lines: 456

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants