Skip to content
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

feat: Built-in Pulsar source #2237

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

feat: Built-in Pulsar source #2237

wants to merge 14 commits into from

Conversation

BulkBeing
Copy link
Contributor

@BulkBeing BulkBeing commented Nov 22, 2024

Status: Tested by running a Pipeline and a Monovertex with Pulsar as built-in source

vigith and others added 2 commits November 21, 2024 20:25
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 80.23256% with 85 lines in your changes missing coverage. Please review.

Project coverage is 64.19%. Comparing base (c5afc90) to head (5d210ab).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
rust/numaflow-extns/pulsar/src/source.rs 81.81% 30 Missing ⚠️
rust/numaflow-core/src/monovertex.rs 37.50% 15 Missing ⚠️
rust/numaflow-core/src/source.rs 0.00% 12 Missing ⚠️
rust/numaflow-core/src/pipeline.rs 0.00% 8 Missing ⚠️
rust/numaflow-core/src/config/components.rs 88.00% 6 Missing ⚠️
rust/numaflow-core/src/source/pulsar.rs 94.69% 6 Missing ⚠️
rust/numaflow-extns/pulsar/src/lib.rs 0.00% 6 Missing ⚠️
rust/numaflow-core/src/message.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2237      +/-   ##
==========================================
+ Coverage   63.91%   64.19%   +0.27%     
==========================================
  Files         338      342       +4     
  Lines       41085    41174      +89     
==========================================
+ Hits        26259    26431     +172     
+ Misses      13756    13670      -86     
- Partials     1070     1073       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 123 to 143
impl TryFrom<PulsarMessage> for Message {
type Error = Error;

fn try_from(message: PulsarMessage) -> Result<Self> {
let offset = Offset::Int(IntOffset::new(message.offset, 1)); // FIXME: partition id

Ok(Message {
keys: vec![message.key],
value: message.payload,
offset: Some(offset.clone()),
event_time: message.event_time,
id: MessageID {
vertex_name: get_vertex_name().to_string(),
offset: offset.to_string(),
index: 0,
},
headers: message.headers,
})
}
}

Copy link
Member

Choose a reason for hiding this comment

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

move this to source/pulsar.rs

Comment on lines 19 to 25
type PulsarSource struct {
ServerAddr string `json:"serverAddr" protobuf:"bytes,1,name=server_addr"`
Topic string `json:"topic" protobuf:"bytes,2,name=topic"`
ConsumerName string `json:"consumerName" protobuf:"bytes,3,name=consumerName"`
SubscriptionName string `json:"subscriptionName" protobuf:"bytes,4,name=subscriptionName"`
MaxUnack uint32 `json:"maxUnack,omitempty" protobuf:"bytes,5,opt,name=maxUnack"`
}
Copy link
Member

Choose a reason for hiding this comment

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

please add TLS and Auth too, if you prefer you can do that in a follow up PR.

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