Struct mz_test_util::kafka::kafka_client::KafkaClient
source · pub struct KafkaClient {
producer: FutureProducer<MzClientContext>,
kafka_url: String,
}
Fields§
§producer: FutureProducer<MzClientContext>
§kafka_url: String
Implementations§
source§impl KafkaClient
impl KafkaClient
pub fn new( kafka_url: &str, group_id: &str, configs: &[(&str, &str)], ) -> Result<KafkaClient, Error>
pub async fn create_topic( &self, topic_name: &str, partitions: i32, replication: i32, configs: &[(&str, &str)], timeout: Option<Duration>, ) -> Result<(), Error>
pub fn send( &self, topic_name: &str, message: &[u8], ) -> Result<DeliveryFuture, KafkaError>
pub fn send_key_value( &self, topic_name: &str, key: &[u8], message: Option<Vec<u8>>, ) -> Result<DeliveryFuture, KafkaError>
Auto Trait Implementations§
impl Freeze for KafkaClient
impl !RefUnwindSafe for KafkaClient
impl Send for KafkaClient
impl Sync for KafkaClient
impl Unpin for KafkaClient
impl !UnwindSafe for KafkaClient
Blanket Implementations§
source§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
Mutably borrows from an owned value. Read more
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Creates a shared type from an unshared type.