| 27 | |
| 28 | |
| 29 | comm::RetCode SimpleConsumer::Get(const comm::proto::GetRequest &req, |
| 30 | comm::proto::GetResponse &resp) { |
| 31 | sleep(1); |
| 32 | |
| 33 | QLInfo("Get topic_id %d store_id %d queue_id %d", req.topic_id(), req.store_id(), req.queue_id()); |
| 34 | |
| 35 | comm::proto::QItem item; |
| 36 | comm::proto::Meta &meta = *item.mutable_meta(); |
| 37 | |
| 38 | meta.set_topic_id(1000); |
| 39 | meta.set_handle_id(1); |
| 40 | |
| 41 | resp.set_prev_cursor_id(1); |
| 42 | resp.set_next_cursor_id(1); |
| 43 | |
| 44 | item.mutable_meta()->set_uin(111); |
| 45 | resp.add_items()->CopyFrom(item); |
| 46 | item.mutable_meta()->set_uin(222); |
| 47 | resp.add_items()->CopyFrom(item); |
| 48 | |
| 49 | return comm::RetCode::RET_OK; |
| 50 | } |
| 51 | |
| 52 | comm::RetCode SimpleConsumer::Add(comm::proto::AddRequest &req, |
| 53 | comm::proto::AddResponse &resp) { |