pub struct KafkaClient { /* private fields */ }
Expand description
Keeps all the configured kafka producers and responsible for the routing of the messages.
Implementations§
source§impl KafkaClient
impl KafkaClient
sourcepub fn builder() -> KafkaClientBuilder
pub fn builder() -> KafkaClientBuilder
Returns the KafkaClientBuilder
sourcepub fn send_message(
&self,
topic: KafkaTopic,
message: &impl Message,
) -> Result<&str, ClientError>
pub fn send_message( &self, topic: KafkaTopic, message: &impl Message, ) -> Result<&str, ClientError>
Sends message to the provided kafka topic.
Returns the name of the kafka topic to which the message was produced.
sourcepub fn send(
&self,
topic: KafkaTopic,
key: &[u8; 16],
headers: Option<&BTreeMap<String, String>>,
variant: &str,
payload: &[u8],
) -> Result<&str, ClientError>
pub fn send( &self, topic: KafkaTopic, key: &[u8; 16], headers: Option<&BTreeMap<String, String>>, variant: &str, payload: &[u8], ) -> Result<&str, ClientError>
Sends the payload to the correct producer for the current topic.
Returns the name of the kafka topic to which the message was produced.
Trait Implementations§
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