Skip to content

Cannot publish object to deferPublish #274

@gijo-varghese

Description

@gijo-varghese
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions