summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/tests/consume.cpp2
-rw-r--r--cpp/src/tests/publish.cpp10
2 files changed, 9 insertions, 3 deletions
diff --git a/cpp/src/tests/consume.cpp b/cpp/src/tests/consume.cpp
index cb7886f6a0..6d2f0a7413 100644
--- a/cpp/src/tests/consume.cpp
+++ b/cpp/src/tests/consume.cpp
@@ -77,7 +77,7 @@ struct Client
Message msg;
for (size_t i = 0; i < opts.count; ++i) {
msg=lq.pop();
- std::cout << "Received: " << msg.getData().substr(0, 10) << "..." << std::endl;
+ std::cout << "Received: " << msg.getMessageProperties().getCorrelationId() << std::endl;
}
if (opts.ack != 0)
subs.getAckPolicy().ackOutstanding(session); // Cumulative ack for final batch.
diff --git a/cpp/src/tests/publish.cpp b/cpp/src/tests/publish.cpp
index 4cb23782cc..17e3d4e104 100644
--- a/cpp/src/tests/publish.cpp
+++ b/cpp/src/tests/publish.cpp
@@ -69,6 +69,13 @@ struct Client
session = connection.newSession(ASYNC);
}
+ std::string id(uint i)
+ {
+ std::stringstream s;
+ s << "msg" << i;
+ return s.str();
+ }
+
void publish()
{
Message msg(string(opts.size, 'X'), opts.routingKey);
@@ -76,8 +83,7 @@ struct Client
msg.getDeliveryProperties().setDeliveryMode(framing::PERSISTENT);
for (uint i = 0; i < opts.count; i++) {
- const_cast<std::string&>(msg.getData()).replace(0, sizeof(uint32_t),
- reinterpret_cast<const char*>(&i), sizeof(uint32_t));
+ msg.getMessageProperties().setCorrelationId(id(i + 1));
session.messageTransfer(arg::destination=opts.destination,
arg::content=msg,
arg::acceptMode=1);