| 77 | } |
| 78 | |
| 79 | void on_message(proton::delivery&, proton::message& m) override { |
| 80 | |
| 81 | // Start a span |
| 82 | opentelemetry::nostd::shared_ptr<opentelemetry::trace::Tracer> tracer = provider->GetTracer("qpid-tracer", OPENTELEMETRY_SDK_VERSION); |
| 83 | opentelemetry::nostd::shared_ptr<opentelemetry::trace::Span> s = tracer->StartSpan("on_message"); |
| 84 | |
| 85 | opentelemetry::trace::Scope sc = tracer->WithActiveSpan(s); |
| 86 | |
| 87 | std::cout << "Received " << m.body() << std::endl; |
| 88 | |
| 89 | std::string reply_to = m.reply_to(); |
| 90 | proton::message reply; |
| 91 | |
| 92 | reply.to(reply_to); |
| 93 | reply.body(to_upper(proton::get<std::string>(m.body()))); |
| 94 | reply.correlation_id(m.correlation_id()); |
| 95 | reply.id(m.id()); |
| 96 | |
| 97 | if (!senders_[reply_to]) { |
| 98 | senders_[reply_to] = conn_.open_sender(reply_to); |
| 99 | } |
| 100 | |
| 101 | senders_[reply_to].send(reply); |
| 102 | } |
| 103 | }; |
| 104 | |
| 105 | int main(int argc, char **argv) { |
nothing calls this directly
no test coverage detected