Skip to content

TraceListener not work #278

@ctlove0523

Description

@ctlove0523

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions