Skip to content

Commit 100fe0b

Browse files
authored
fix issue with variable name in the example
There is an issue in the second example when constructing the Server instance. You are sending `queueName` but the server expects `requestsQueue`.
1 parent 1112776 commit 100fe0b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ async function init() {
6464
const connection = await amqplib.connect('amqp://localhost');
6565

6666
// initial setup (e.g. should be provided on first launch)
67-
const queueName = 'predefined-queue-name';
67+
const requestsQueue = 'predefined-queue-name';
6868
const channel = await connection.createChannel();
69-
await channel.assertQueue(queueName);
69+
await channel.assertQueue(requestsQueue);
7070

7171
// server start
72-
const server = new AMQPRPCServer(connection, {queueName});
72+
const server = new AMQPRPCServer(connection, { requestsQueue });
7373
server.addCommand('hello', (name) => ({message: `Hello, ${name}!`}));
7474
await server.start();
7575

7676
// client start
77-
const client = new AMQPRPCClient(connection, {requestsQueue:queueName});
77+
const client = new AMQPRPCClient(connection, { requestsQueue });
7878
await client.start();
7979
const response = await client.sendCommand('hello', ['Alisa']);
8080
console.log('Alisa got response:', response);

0 commit comments

Comments
 (0)