Skip to content

Add Info class to the Producer/Consumer classes #322

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
Oct 11, 2023

Conversation

Gsantomaggio
Copy link
Member

@Gsantomaggio Gsantomaggio commented Oct 10, 2023

The call returns the Reference and Stream.
So that you know, the Reference is deprecated for the producer class and will be removed at some point. So the info.reference for the producer will also be removed.

We can add other info about the consumer and producer and the consumer in the future.

ref: #321

To get the info:

 var consumer = await Consumer.Create(new ConsumerConfig(system, "MyStream") { Reference = "consumer", });

entityInfo = consumer.Info;
Assert.Equal("MyStream", entityInfo.Stream);
Assert.Equal("consumer", entityInfo.Reference);

and also in the handler:

MessageHandler = async (sourceStream, consumer, ctx, message) =>
{
                        
    Console.WriteLine($"Consumer info Reference: {consumer.Info.Reference} ");

The call returns the Reference and Stream.
Note that for the producer class the Reference is deprecated and it will be removed
at some point. So the info.reference for the producer will be removed as well.

We can add other info about the consumer and the consumer in the future.

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

codecov bot commented Oct 10, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (0711e13) 92.60% compared to head (64817bc) 92.57%.

❗ Current head 64817bc differs from pull request most recent head 18132c0. Consider uploading reports for the commit 18132c0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #322      +/-   ##
==========================================
- Coverage   92.60%   92.57%   -0.04%     
==========================================
  Files         112      113       +1     
  Lines        9884     9963      +79     
  Branches      825      825              
==========================================
+ Hits         9153     9223      +70     
- Misses        555      562       +7     
- Partials      176      178       +2     
Files Coverage Δ
RabbitMQ.Stream.Client/AbstractEntity.cs 100.00% <ø> (ø)
RabbitMQ.Stream.Client/EntityInfo.cs 100.00% <100.00%> (ø)
RabbitMQ.Stream.Client/IConsumer.cs 100.00% <ø> (ø)
RabbitMQ.Stream.Client/IProducer.cs 100.00% <ø> (ø)
RabbitMQ.Stream.Client/RawConsumer.cs 84.36% <100.00%> (+0.03%) ⬆️
RabbitMQ.Stream.Client/RawProducer.cs 88.35% <100.00%> (+0.04%) ⬆️
RabbitMQ.Stream.Client/RawSuperStreamConsumer.cs 94.30% <100.00%> (+0.03%) ⬆️
RabbitMQ.Stream.Client/RawSuperStreamProducer.cs 96.72% <100.00%> (ø)
RabbitMQ.Stream.Client/Reliable/Consumer.cs 100.00% <100.00%> (ø)
...MQ.Stream.Client/Reliable/DeduplicatingProducer.cs 100.00% <100.00%> (ø)
... and 3 more

... and 2 files with indirect coverage changes

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

@Gsantomaggio Gsantomaggio marked this pull request as ready for review October 11, 2023 09:22
@Gsantomaggio
Copy link
Member Author

FYI: #321 (reply in thread)

@Gsantomaggio Gsantomaggio requested a review from Zerpet October 11, 2023 09:23
@Gsantomaggio Gsantomaggio merged commit e37f2a2 into main Oct 11, 2023
@Gsantomaggio Gsantomaggio deleted the expose_configuration branch October 11, 2023 11:10
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