JetStream: How to make Push Subscription with Durable consumer? (i get "No interest")

698 views Asked by At

I try to make Durable and Delivery consumer, but I get "No Interest" as result.

  1. It is "Active" When I create PushSubscribeOptions like this:

    PushSubscribeOptions pso = PushSubscribeOptions.Builder()

             .WithDurable(options?.DurableName)
              .WithStream(options?.StreamName)
             .Build();
         IJetStreamPushAsyncSubscription sub =
             _js.PushSubscribeAsync(options?.Subject, someHandler, true, pso);
    
  2. It is "No interest" when I use this code:

    PushSubscribeOptions pso = PushSubscribeOptions.Builder()

             .WithDurable(options?.DurableName)
             .WithStream(options?.StreamName)
             .WithDeliverGroup(options?.DeliveryGroup)
             .Build();
    
         IJetStreamPushAsyncSubscription sub =
             _js.PushSubscribeAsync(options?.Subject, someHandler, true, pso);
    

I am confused.

How to make Push subscription with Delivery+Durable options?

1

There are 1 answers

0
Thomas On

Start the subscriber before you create the push consumer. At least in go, the no-interest is only an optimization (why transmit on a topic no one is subscribing on), and there it will start to push as soon as the is a subscriber ON THE PUSH TOPIC