Comments (3)
Did you figure this out?
from amqp-ts.
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
from amqp-ts.
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:
Line 798 in 0ca8250
Or?
from amqp-ts.
Related Issues (20)
- Not able to find these modules HOT 2
- Implicit any type, fails strict TS HOT 1
- Minor queue.rpc documentation issue HOT 2
- Unhandled rejection TypeError: message.sendTo is not a function HOT 2
- Namespace 'winston' has no exported member 'LoggerInstance'. HOT 2
- IllegalOperationError: Channel closed HOT 2
- Using amqp-ts for angular 8.0.0 throws error HOT 5
- RPC: how can I send multiples messages to some queue (error reply consumer already set)
- Queue.onMessage RPC promise returned error: mapper_parsing_exception module=amqp-ts
- How to apply the timeout mechanism in RPC.
- Exchange.rpc function doesn't work correctly.
- Channel for each queue and exchange
- Close connection
- message.ack() takes 40+ milliseconds to actually ack HOT 5
- when network is bad ,then reconnection ,and the RPC don't work HOT 1
- Change Message.getContent() return to "unknown" type
- Upgrade to latest amqlib version
- missing @types/amqplib and @types/bluebird
- Unable to Connect RabbitMq from Browser using amqp-ts HOT 2
- IllegalOperationError: Channel closed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amqp-ts.