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

Add client properties #237

Merged
merged 4 commits into from
Nov 5, 2024
Merged

Add client properties #237

merged 4 commits into from
Nov 5, 2024

Conversation

Gsantomaggio
Copy link
Member

Add client properties

Screenshot 2024-10-30 at 13 06 16

Signed-off-by: Gabriele Santomaggio <[email protected]>
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 88.75000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 89.51%. Comparing base (c05e420) to head (f468ea2).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/environment.rs 71.42% 4 Missing ⚠️
src/superstream_consumer.rs 20.00% 4 Missing ⚠️
src/client/options.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #237      +/-   ##
==========================================
+ Coverage   88.92%   89.51%   +0.58%     
==========================================
  Files          78       78              
  Lines        6662     6741      +79     
==========================================
+ Hits         5924     6034     +110     
+ Misses        738      707      -31     

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

Signed-off-by: Gabriele Santomaggio <[email protected]>
@Gsantomaggio
Copy link
Member Author

it is possible to set the client_provider_name

Default values

default

Change the client_provided_name

let mut producer = env
            .producer()
            .client_provided_name("my first producer")

clustom

@Gsantomaggio Gsantomaggio marked this pull request as ready for review November 4, 2024 10:17
@DanielePalaia
Copy link
Contributor

@Gsantomaggio it looks good to me but I think we need to add this support for superstream too. It should be very similar to normal Producers/Consumers. At creation time of the superstream producers/consumers we can specify the client_provided_name and then propagate it when we create the producers in: https://github.com/rabbitmq/rabbitmq-stream-rust-client/blob/main/src/superstream_producer.rs#L69

Looks good if we want to do it in a different PR

@Gsantomaggio
Copy link
Member Author

@DanielePalaia
here the default value:
Screenshot 2024-11-04 at 17 16 21

How to change:

  let mut super_stream_producer = environment
        .super_stream_producer(RoutingStrategy::HashRoutingStrategy(
            HashRoutingMurmurStrategy {
                routing_extractor: &hash_strategy_value_extractor,
            },
        ))
        .client_provided_name("my super stream producer for hello rust") // here you can change it

@Gsantomaggio Gsantomaggio merged commit f0f5f1d into main Nov 5, 2024
3 of 4 checks passed
@Gsantomaggio Gsantomaggio deleted the client_properties branch November 5, 2024 09:01
@Gsantomaggio Gsantomaggio added the enhancement New feature or request label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants