We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Based on the document, we only need pass defer parameter in ms to achieve message delay delivery. https://nsq.io/components/nsqd.html#post-pub
const nsq = require('nsqjs') const moment = require('moment') // reader const reader = new nsq.Reader('sample_topic', 'sample_topic', { lookupdHTTPAddresses: 'nsqlookupd:4161' }) reader.connect() reader.on('message', msg => { console.log('Received message [%s] [%s]: %s', moment.utc().format('YYYY-MM-DD HH:mm:ss:SSS'), msg.id, msg.body.toString()) setTimeout(() => { msg.finish() }, 1000) });
pre-request part, will generate the current time in ms.
var moment = require('moment'); var date = moment.utc().format('YYYY-MM-DD HH:mm:ss:SSS'); pm.environment.set("now", date);
in the request
{ "text": "some message", "message ": [{{now}}] }
nsq-demo-client-1 | Received message [2022-12-13 14:37:15:684] [11bc612bb5c88000]: { nsq-demo-client-1 | "text": "some message", nsq-demo-client-1 | "message ": [2022-12-13 14:37:12:336] nsq-demo-client-1 | }
expect the Received message should be 5 seconds later comparing with the timestamp in the message body.
expect
actual the Received message is always within the defer ms.
actual
The text was updated successfully, but these errors were encountered:
Going to need the nsqd logs with --log-level=debug enabled to debug.
nsqd
--log-level=debug
Sorry, something went wrong.
No branches or pull requests
Based on the document, we only need pass defer parameter in ms to achieve message delay delivery.
https://nsq.io/components/nsqd.html#post-pub
expect
the Received message should be 5 seconds later comparing with the timestamp in the message body.
actual
the Received message is always within the defer ms.
The text was updated successfully, but these errors were encountered: