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 Wed Dec 4 2024 18:42:01 for userver by
Doxygen
1.10.0