Open pscanlon1 opened 6 years ago
Did you figure this out?
I encountered this error when receiving a message that had the replyTo (reply-to) field set. In that case, the message is treated as an RPC call. The amqp-ts library automatically sends the queue.activateConsumer onMessage function's return value to the sender (i.e. to wherever the replyTo field is set to). If your onMessage function doesn't return anything, you will get this error: "Queue.onMessage consumer function returned error: content is not a buffer module=amqp-ts".
https://github.com/abreits/amqp-ts/wiki/Queue-class#activateConsumer
Seems documentation/example is wrong:
// rpc server that returns a Message
queue.activateConsumer((msg) => {
var rpcParameters = msg.getContent();
return new Amqp.Message(rpcParameters.value, {});
});
because return value for reply queue will be stringified: https://github.com/abreits/amqp-ts/blob/0ca8250b61ea3ea2128d1034cc54e88b0df3568d/src/amqp-ts.ts#L798
Or?
I am receiving the message, with all the right details, and then I am seeing this error. Any ideas?