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

TraceListener not work #278

Open
ctlove0523 opened this issue Nov 15, 2024 · 0 comments
Open

TraceListener not work #278

ctlove0523 opened this issue Nov 15, 2024 · 0 comments

Comments

@ctlove0523
Copy link

Version: 4.1.2
configure:

spring:
  cloud:
    bus:
      enabled: true
      id: MSGSMS:OMP:AMService:${VM_IP:${random.uuid}}
      trace:
        enabled: true
      ack:
        enabled: true

HttpExchangeRepository:

@Component
public class LogEventTraceRepository implements HttpExchangeRepository {
    private static final Logger log = LoggerFactory.getLogger(LogEventTraceRepository.class);

    private List<HttpExchange> traces = new ArrayList<>();


    @Override
    public List<HttpExchange> findAll() {
        return new ArrayList<>(traces);
    }

    @Override
    public void add(HttpExchange httpExchange) {
        traces.add(httpExchange);
        log.info("traces is {}", httpExchange);
    }

}

but when i define a AckRemoteApplicationEvent listener,it works well:

@Component
public class AckListener {

    @EventListener
    public void onApplicationEvent(AckRemoteApplicationEvent event) {
        System.out.println("get ack event " + event.getOriginService());
    }
}

how can i make trace listener works well

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

No branches or pull requests

2 participants