Skip to content

[Kafka] Setup client with examples #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2024
Merged

Conversation

shrenikbhatt
Copy link
Collaborator

@shrenikbhatt shrenikbhatt commented Aug 25, 2024

  • Setup Bitnami Kafka following this readme

Towards https://linear.app/ollm/issue/OLL-20/kafka-spin-up

@shrenikbhatt shrenikbhatt marked this pull request as ready for review August 25, 2024 19:48
Copy link

linear bot commented Aug 25, 2024

OLL-20 Kafka spin-up

@shrenikbhatt shrenikbhatt force-pushed the shrenik/setup-kafka-client branch from 70ac057 to 2535cb9 Compare August 25, 2024 20:11
.try_for_each(|borrowed_message| async move {
match borrowed_message.payload_view::<str>() {
Some(Ok(s)) => {
println!("Recevied payload: {}", s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
println!("Recevied payload: {}", s);
println!("Received payload: {}", s);

Comment on lines 18 to 23
bootstrap_server: &str,
group_id: Option<&str>,
batch_interval: Option<&str>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we document these parameters?

Comment on lines 36 to 37
let producer: FutureProducer = FutureProducer::from_config(&self.client_config)?;
Ok(producer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let producer: FutureProducer = FutureProducer::from_config(&self.client_config)?;
Ok(producer)
FutureProducer::from_config(&self.client_config)

will this work? same with create_consumer


pub async fn send_to_topic(
&self,
future_producer: &FutureProducer,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's worth defining our own wrapper around FutureProducer, for a friendlier type (we control what is created/used based on KafkaClient).

just a general thought

@shrenikbhatt shrenikbhatt force-pushed the shrenik/setup-kafka-client branch from b599099 to 25cc20f Compare September 26, 2024 02:37
@shrenikbhatt shrenikbhatt merged commit 90671cf into main Sep 29, 2024
1 check passed
@shrenikbhatt shrenikbhatt deleted the shrenik/setup-kafka-client branch September 29, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants