userver
C++ Async Framework
Loading...
Searching...
No Matches
samples/kafka_service/src/consume.cpp
#include <consume.hpp>
#include <
userver/formats/json/value_builder.hpp
>
#include <
userver/testsuite/testpoint.hpp
>
namespace
kafka_sample {
void
Consume(
kafka::MessageBatchView
messages) {
for
(
const
auto
& message : messages) {
if
(!message.GetTimestamp().has_value()) {
continue
;
}
TESTPOINT
(
"message_consumed"
, [&message] {
formats::json::ValueBuilder
builder;
builder[
"key"
] = message.GetKey();
return
builder.
ExtractValue
();
}());
}
}
}
// namespace kafka_sample
Generated on Tue Nov 19 2024 11:25:18 for userver by
Doxygen
1.10.0