Skip to content

Implement SuperStream for ReliableProducer #172

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 2 commits into from
Oct 7, 2022

Conversation

Gsantomaggio
Copy link
Member

@Gsantomaggio Gsantomaggio commented Oct 5, 2022

Add SuperStreamConfig to enable super stream

Signed-off-by: Gabriele Santomaggio [email protected]

ReliableProducer can handle standard producers and super stream producers. From the user's perspective, the behaviour is hidden.

Standard producer

  var reliableProducer = await ReliableProducer.CreateReliableProducer(new ReliableProducerConfig()
   {
   StreamSystem = system,
   Stream = stream,
   Reference = "my-reliable-producer",
   ClientProvidedName = "my-reliable-producer",
   ConfirmationHandler = confirmation =>

Super stream:

  var reliableProducer = await ReliableProducer.CreateReliableProducer(new ReliableProducerConfig()
  {
  StreamSystem = system,
  Stream = stream,
  Reference = "my-reliable-producer",
  ClientProvidedName = "my-reliable-producer",
  SuperStreamConfig = new SuperStreamConfig()
    {
         Routing = message => message.Properties.MessageId.ToString()
     },
  ConfirmationHandler = confirmation =>

Recap:

We have two different low-level classes:
StandardProducer : IProducer
SuperStreamProducer : IProducer

One Smart layer class:
ReliableProducer that handles:

  • StandardProducer and SuperStreamProducer
  • Confirmation messages with timeouts and errors
  • Auto reconnect

- Add SuperStreamConfig to enable super stream
for the user perspective producer and super stream is hidden

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

codecov bot commented Oct 5, 2022

Codecov Report

Base: 92.29% // Head: 92.56% // Increases project coverage by +0.26% 🎉

Coverage data is based on head (14b1884) compared to base (c3151db).
Patch coverage: 99.52% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #172      +/-   ##
==========================================
+ Coverage   92.29%   92.56%   +0.26%     
==========================================
  Files          89       90       +1     
  Lines        7138     7301     +163     
  Branches      445      463      +18     
==========================================
+ Hits         6588     6758     +170     
+ Misses        445      440       -5     
+ Partials      105      103       -2     
Impacted Files Coverage Δ
RabbitMQ.Stream.Client/SuperStreamProducer.cs 99.40% <90.90%> (-0.60%) ⬇️
RabbitMQ.Stream.Client/Producer.cs 80.28% <100.00%> (+3.44%) ⬆️
...abbitMQ.Stream.Client/Reliable/ConfirmationPipe.cs 100.00% <100.00%> (ø)
RabbitMQ.Stream.Client/Reliable/ProducerFactory.cs 100.00% <100.00%> (ø)
...abbitMQ.Stream.Client/Reliable/ReliableProducer.cs 83.07% <100.00%> (-3.35%) ⬇️
Tests/ReliableTests.cs 99.27% <100.00%> (ø)
Tests/SuperStreamTests.cs 99.34% <100.00%> (+0.20%) ⬆️
RabbitMQ.Stream.Client/Consumer.cs 87.75% <0.00%> (-2.73%) ⬇️
RabbitMQ.Stream.Client/Reliable/ReliableBase.cs 98.63% <0.00%> (-1.37%) ⬇️
RabbitMQ.Stream.Client/Client.cs 90.12% <0.00%> (-0.73%) ⬇️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

ConfirmFrames
MessagesSent
IncomingFrames
PublishCommandsSent
PendingCount

Signed-off-by: Gabriele Santomaggio <[email protected]>
@Gsantomaggio Gsantomaggio merged commit 59642a6 into main Oct 7, 2022
@Gsantomaggio Gsantomaggio deleted the reliable_producer_super_stream branch October 7, 2022 08:36
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.

1 participant