Пример #1
0
 void on_sendable(proton::event &e) {
     proton::sender sender = e.sender();
     while (sender.credit() && sent < total) {
         proton::message msg;
         msg.id(sent + 1);
         std::map<std::string, int> m;
         m["sequence"] = sent+1;
         msg.body(m);
         sender.send(msg);
         sent++;
     }
 }
Пример #2
0
    void on_sendable(proton::event &e) {
        proton::sender sender = e.sender();

        while (sender.credit() && sent_ < total_) {
            id_value_ = sent_ + 1;
            message_.correlation_id(id_value_);
            proton::amqp_timestamp reactor_now(reactor_.now());
            message_.creation_time(reactor_now);
            sender.send(message_);
            sent_++;
        }
    }
Пример #3
0
 void on_sendable(proton::event &e) {
     proton::message m;
     m.body("Hello World!");
     e.sender().send(m);
     e.sender().close();
 }