Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RabbitMQ4] Error with manual credit flow control #429

Open
singggum3b opened this issue Nov 4, 2024 · 3 comments
Open

[RabbitMQ4] Error with manual credit flow control #429

singggum3b opened this issue Nov 4, 2024 · 3 comments

Comments

@singggum3b
Copy link

Hi, thanks for the library ! I got below error when using with rabbitmq 4

var container = require('rhea');
container.on('message', function (context) {
	console.log(context.message.body);
	console.log(context.receiver.add_credit(1));
	// context.connection.close();
});
container.on('sendable', function (context) {
	console.log(context.sender.options.target.address);
	// console.log(context.sender);
	context.sender.send({body: 'Hello World!'});
	context.sender.send({body: 'Hello A!'});
	context.sender.send({body: 'Hello B!'});
	context.sender.send({body: 'Hello C!'});
	context.sender.send({body: 'Hello D!'});
});
var connection = container.connect({
	host: "amqp",
	'port': 5672,
	username: "guest",
	password: "guest",
	reconnect: true,
	sessionIdContext: "abc"
});
connection.open_receiver({
	source: {
		address: "Q-TEST_TEST_FLOW_2"
	},
	autoaccept: false,
	autosettle: true,
	credit_window: 1,
});
connection.open_receiver({
	source: {
		address: "Q-TEST_TEST_FLOW_2B"
	},
	autoaccept: false,
	autosettle: true,
	credit_window: 1,
});
connection.open_sender("Q-TEST_TEST_FLOW_2B");
connection.open_sender("Q-TEST_TEST_FLOW_2");
      throw er; // Unhandled 'error' event
      ^

RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= 0 and <= 4294967295. Received 4_294_967_304
    at checkInt (node:internal/buffer:74:11)
    at writeU_Int32BE (node:internal/buffer:804:3)
    at Buffer.writeUInt32BE (node:internal/buffer:817:10)
    at TypeDesc.write (/app/node_modules/rhea/lib/types.js:180:60)
    at types.Writer.write_fixed_width (/app/node_modules/rhea/lib/types.js:780:14)
    at types.Writer.write_value (/app/node_modules/rhea/lib/types.js:826:14)
    at types.Writer.write (/app/node_modules/rhea/lib/types.js:818:14)
    at types.Writer.write_compound (/app/node_modules/rhea/lib/types.js:853:18)
    at types.Writer.write_value (/app/node_modules/rhea/lib/types.js:830:14)
    at types.Writer.write (/app/node_modules/rhea/lib/types.js:818:14)
Emitted 'error' event on Container instance at:
    at Container.dispatch (/app/node_modules/rhea/lib/container.js:41:33)
    at Connection.dispatch (/app/node_modules/rhea/lib/connection.js:262:40)
    at Connection.output (/app/node_modules/rhea/lib/connection.js:527:18)
    at Connection._write_frame (/app/node_modules/rhea/lib/connection.js:778:10)
    at Session.output (/app/node_modules/rhea/lib/session.js:488:21)
    at Session._write_flow (/app/node_modules/rhea/lib/session.js:677:10)
    at link._process (/app/node_modules/rhea/lib/link.js:125:26)
    at Session._process (/app/node_modules/rhea/lib/session.js:649:27)
    at Connection._process (/app/node_modules/rhea/lib/connection.js:768:32)
    at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
  code: 'ERR_OUT_OF_RANGE'
}
@grs
Copy link
Member

grs commented Nov 4, 2024

This is a duplicate of #426 and should be fixed in 3.0.3

@singggum3b
Copy link
Author

hi @grs actually it's not. I've checked that issue and. tried 3.0.3. It only without manual credit flow control.

@grs grs mentioned this issue Nov 4, 2024
@grs
Copy link
Member

grs commented Nov 4, 2024

Yes, sorry, I was wrong there. Should be fixed by 1f0d28c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants