An RPC server that consumes messages from a queue and replies to each caller.
Uses the session's queue and subscribe machinery, so the consumer is automatically recovered after a reconnection.
const session = await AMQPSession.connect("amqp://localhost")const server = await session.rpcServer("my_rpc_queue", async (msg) => { return `processed:${msg.bodyString()}`})// later…await session.stop() Copy
const session = await AMQPSession.connect("amqp://localhost")const server = await session.rpcServer("my_rpc_queue", async (msg) => { return `processed:${msg.bodyString()}`})// later…await session.stop()
Cancel the consumer. The underlying queue remains declared.
An RPC server that consumes messages from a queue and replies to each caller.
Uses the session's queue and subscribe machinery, so the consumer is automatically recovered after a reconnection.
Example