Skip to content

Competing Consumer Pattern #776

Answered by scottf
thenhawke asked this question in Q&A
May 31, 2023 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Sorry I missed putting the queue name in the subscribe call. Here is a full example.

using (IConnection c = new ConnectionFactory().CreateConnection(opts))
{
    IJetStreamManagement _jetStreamManagement = c.CreateJetStreamManagementContext();
    IJetStream _jetStream = c.CreateJetStreamContext();
            
    _jetStreamManagement.AddStream(StreamConfiguration.Builder()
        .WithName("NewOrders")
        .WithSubjects("Orders.Created.*")
        .WithRetentionPolicy(RetentionPolicy.WorkQueue)
        .WithStorageType(StorageType.Memory) // for testing
        .Build());

    // for testing, always gives a clean set of messages in case I re-run the example
    _jetStreamManagement…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@thenhawke
Comment options

Comment options

You must be logged in to vote
1 reply
@thenhawke
Comment options

Answer selected by thenhawke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants