How to configure consumer push #471
Vitor-Henrique-EM
started this conversation in
General
Replies: 2 comments 3 replies
-
we try to hide the consumer internals, that's why we do not expose any concept of pull or push consumers. If you want us to expose that please feel free to create an issue so we can look into it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@mtmk Hi. Are the latest consumers considered to be Pull or Push ones? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the old version of the Nats.Client library, there was a way to use pull and push consumers.
When we had a stream context in which we wanted to create a push consumer, we used it as follows:
"jetStream.PushSubscribeAsync(subject, handler)".
In this new version, how do push consumers work?
I can't specify a subject for the consumer to listen to?
For example:
StreamConfig optionsStream = new(nameStream, ["DOMAIN.CHANNEL.", "DOMAIN.RESPONSIBLE."]);
INatsJSStream jetStream = await jetStreamContext.CreateStreamAsync(optionsStream);
INatsJSConsumer consumer = await jetStream.CreateOrUpdateConsumerAsync(new ConsumerConfig()
{
DeliverPolicy = ConsumerConfigDeliverPolicy.New
});
await foreach (NatsJSMsg msg in consumer.ConsumeAsync())
//Here at this point the consumer will receive all messages published on the channel, and there is no way to specify a specific subject
Beta Was this translation helpful? Give feedback.
All reactions