Skip to content
New issue

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

Cannot publish object to deferPublish #274

Open
gijo-varghese opened this issue Jan 30, 2019 · 0 comments
Open

Cannot publish object to deferPublish #274

gijo-varghese opened this issue Jan 30, 2019 · 0 comments

Comments

@gijo-varghese
Copy link

gijo-varghese commented Jan 30, 2019

const account = { name: "Gijo Varghese"};

writer.publish('account-updated', account); // works fine

writer.deferPublish('account-updated', account, 1000); // ERROR - Expect an array of messages to produceMessages

writer.deferPublish('account-updated', [account], 1000); // ERROR - The "list[2]" argument must be one of type Array, Buffer, or Uint8Array. Received type object

writer.deferPublish('account-updated', [JSON.stringify(account)], 1000); // works!

From the docs:

deferPublish(topic, msg, timeMs, [callback])
topic is a string. msg is either a string, a Buffer, JSON serializable object. timeMs is the delay by which the message should be delivered. callback takes a single error argument.

Is it a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant