(cobra client) pass the message position to the subscription data callback

This commit is contained in:
Benjamin Sergeant
2020-03-13 12:49:37 -07:00
parent 90df3d1805
commit 332ffb0603
11 changed files with 59 additions and 43 deletions

View File

@ -201,10 +201,10 @@ namespace ix
conn.subscribe(channel,
filter,
[&jsonWriter, verbose, &throttled, &receivedCount, &queueManager](
const Json::Value& msg) {
const Json::Value& msg, const std::string& position) {
if (verbose)
{
spdlog::info("Subscriber received message -> {}", jsonWriter.write(msg));
spdlog::info("Subscriber received message {} -> {}", position, jsonWriter.write(msg));
}
// If we cannot send to sentry fast enough, drop the message

View File

@ -178,10 +178,10 @@ namespace ix
conn.subscribe(channel,
filter,
[&jsonWriter, &queueManager, verbose, &receivedCount](
const Json::Value& msg) {
const Json::Value& msg, const std::string& position) {
if (verbose)
{
spdlog::info(jsonWriter.write(msg));
spdlog::info("Subscriber received message {} -> {}", position, jsonWriter.write(msg));
}
receivedCount++;