| 86 | } |
| 87 | |
| 88 | void on_message(proton::delivery &, proton::message &m) override { |
| 89 | std::cout << "Received " << m.body() << std::endl; |
| 90 | |
| 91 | std::string reply_to = m.reply_to(); |
| 92 | sender_map::iterator it = senders.find(reply_to); |
| 93 | |
| 94 | if (it == senders.end()) { |
| 95 | std::cout << "No link for reply_to: " << reply_to << std::endl; |
| 96 | } else { |
| 97 | proton::sender sender = it->second; |
| 98 | proton::message reply; |
| 99 | |
| 100 | reply.to(reply_to); |
| 101 | reply.body(to_upper(proton::get<std::string>(m.body()))); |
| 102 | reply.correlation_id(m.correlation_id()); |
| 103 | |
| 104 | sender.send(reply); |
| 105 | } |
| 106 | } |
| 107 | }; |
| 108 | |
| 109 | int main(int argc, char **argv) { |