Aerospike Kafka connector throwing error max connections 25 would be exceeded


Aerospike connect to Kafka from time to time throwing the following error when running in standalone mode as below

$KAFKA_HOME/bin/ etc/ etc/

This is the error:

Caused by: com.aerospike.client.AerospikeException$Connection: Error Code -7: Node BB96D5801CA8B7C 3000 event loop 2 max connections 25 would be exceeded.
        at com.aerospike.client.cluster.Node.getAsyncConnection(*
        at com.aerospike.client.async.NettyCommand.executeCommand(
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(
        at io.netty.util.concurrent.SingleThreadEventExecutor$

I have seen similar case for Java client. Is there a default hard limit or this is bug please?


That is the underlying java client’s hard connection limit. Assuming you are using 12 event loops and the default ClientPolicy.maxConnsPerNode (300), there will be 25 connections available per node/event loop (300/12 = 25).

If you were using the java client directly, you could either increase maxConnsPerNode or just disable the limit by setting EventPolicy.maxCommandsInProcess to 25 for each event loop. That way, only 25 concurrent commands are allowed per event loop and excess commands are queued for later execution when slots become available.

Unfortunately, there does not seem to be a way to configure these java client variables from the current Aerospike Kafka connector.

Like Brian says, the current Kafka connector does not allow setting these values aside from the default. The next major release has a reworking of the configs that give better options that effect policy in the client which includes these variables.

Thanks Joe and Brian.