Replies: 3 comments
-
What language are you working in? We have a newer JS API that has a Consume() method which from a client perspective is similar to a push consumer. |
Beta Was this translation helpful? Give feedback.
-
This looks like javascript API, so I would reach to @aricart However, you can get responses immediately, even if you have high expires value. |
Beta Was this translation helpful? Give feedback.
-
@aristelecom consumers currently limit expires to be 1s or greater. Otherwise your clients would slam on the server. The only time the client would take 1s is If there are no messages or the number of messages you requested are not available. In your case, you are requesting 100 messages so if there are less than that, the request will not close until the expires hits. You can specify |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm creating an API to retrieve messages from nats, is there an alternative to fetch that skips the wait of at least 1s to retrieve messages?
since I need to have response times less than 1s
const sub = await consumer.fetch({expires:1000})
Beta Was this translation helpful? Give feedback.
All reactions