onebeyond / rascal

A config driven wrapper for amqp.node supporting multi-host connections, automatic error recovery, redelivery flood protection, transparent encryption / decryption and channel pooling.
MIT License
451 stars 69 forks source link

No channels left to allocate #223

Closed pico21 closed 1 year ago

pico21 commented 1 year ago

RabbitMQ 3.8.11, Erlang 23.2.3 With Rascal version >=17, I get the error No channels left to allocate after initializing some subscriptions, whereas with version 16.x, this error doesn't occur

Rascal.Broker.create(Rascal.withDefaultConfig(this.config), function (err, broker) {
...
_.each(self.subscriptionNames, function (subscriptionName) {
  ...
  broker.subscribe(subscriptionName, { prefetch: 3 }, function (err, subscription) {
                      if (err) {
                          logger.debug(`[BS] Rascal.Broker.subscribe error: ${err}`)
                          process.exit(1);
                      }
  ...
   }
...
}
cressie176 commented 1 year ago

Hi @pico21

It's possible https://github.com/onebeyond/rascal/issues/219 might be related. Can you share how you were specifying the connection parameters, and whether you previously set a value for channelMax?

cressie176 commented 1 year ago

Based on my comments in https://github.com/onebeyond/rascal/issues/219 I suspect you are using a connection url in the config, and not specifying a channelMax. Prior to v17 rascal ignored the default channelMax in this case. I made the decision from v17 onwards to apply the default values if they were not overiden in the connection url. If this sounds like it might explain the problem, then add a url request parameter channelMax=65535 to restore the previous behaviour. You might also be able to specify channelMax=0 but I'm not 100% sure without testing.

pico21 commented 1 year ago

thank you, it work also with channelMax=0