pub struct KafkaRecordSink { /* private fields */ }Expand description
The Kafka batch sink (SCALE-08, #187,
analytics_stream.sink.kafka): produces each flushed batch as
NDJSON messages to a Kafka topic via a Kafka REST Proxy. The REST
Proxy endpoint receives the batch as an HTTP POST with the
Content-Type: application/vnd.kafka.binary.v2+json media type;
each NDJSON line becomes a Kafka message value (base64 encoded
per the REST Proxy spec). Reuses the DW-044 webhook delivery
engine’s retry/budget shape — one delivery (with its retries) per
batch.
Implementations§
Source§impl KafkaRecordSink
impl KafkaRecordSink
Sourcepub fn compile(
cfg: &AnalyticsStreamKafka,
obs: Arc<Observability>,
ssrf_filter: SsrfFilter,
) -> Result<Self, String>
pub fn compile( cfg: &AnalyticsStreamKafka, obs: Arc<Observability>, ssrf_filter: SsrfFilter, ) -> Result<Self, String>
Compile the sink from its config block: URL decomposition and
secret-reference header resolution through the same
WebhookTarget bottom the webhook sink uses, so the two
sinks cannot drift on URL, header, or retry semantics. Fails
with a log-safe message (the caller skips the sink loudly,
fail closed).
Trait Implementations§
Source§impl Debug for KafkaRecordSink
impl Debug for KafkaRecordSink
Source§impl RecordSink for KafkaRecordSink
impl RecordSink for KafkaRecordSink
Source§fn deliver_batch<'life0, 'async_trait>(
&'life0 self,
batch: Bytes,
records: usize,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn deliver_batch<'life0, 'async_trait>(
&'life0 self,
batch: Bytes,
records: usize,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
records lines. Returns
whether the batch was accepted (2xx on some attempt for the
webhook sink) — the flusher only logs; outcome counting is the
implementation’s, in the metric family it owns.Auto Trait Implementations§
impl Freeze for KafkaRecordSink
impl !RefUnwindSafe for KafkaRecordSink
impl Send for KafkaRecordSink
impl Sync for KafkaRecordSink
impl Unpin for KafkaRecordSink
impl !UnwindSafe for KafkaRecordSink
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more