This question is related to why do I need to poll message hub, The documentation linked with that answer shows that Kafka will support a 'long-poll' concept, but there is no clear way in the existing nodejs support for message-hub to implement such a mechanism. The demo app provided for nodejs just uses a 250mSec timer interval to handle retrieving messages from the server. I'd like to replace that with a more sophisticated long-poll approach using the Kafka support long-poll approach: To avoid this we have parameters in our pull request that allow the consumer request to block in a "long poll" waiting until data arrives
However the existing implementation does not appear to allow for configuring any such kind of parameter, nor is it clear what the necessary parameter would be. The prototype for the get function is defined as:
MessageHub.ConsumerInstance.prototype.get(topicName [toValue])
Retrieves a message from the provided topic name.
topicName - (String) (required), the topic to retrieve messages from.
toValue - (Boolean) (optional), unwraps base64 encoded messages, if true. Defaults to true.
Returns a Promise object which will be fulfilled when the request to the service resolves.
so no config options. Alternately, could you provide a link the documentation which defines the URLs and available options for those URLs which are implemented in the message-hub.js module?
via Bob Dill
No comments:
Post a Comment