我正在使用apache camel-spring dsl连接到kafka主题。在使用非ssl kafka集群时一切正常,但当我将其切换到ssl集群时,jvm堆将继续增加,并最终在一段时间内终止服务。但是,我能够成功地发布和使用消息,但由于堆问题,服务将频繁关闭。我试着将内存从1gb增加到2gb和3gb,但这个过程仍然会消耗所有可用空间。请求帮助解决此问题。
更多详情:
Apache Camel Version: 2.19.0,
Kafka Client: 0.10.1.1,
Spring Version: 4.3.7.RELEASE,
Connecting through spring DSL:
<camel:to uri = "kafka:[[kafka.zookeeper]]?securityProtocol=SSL
&sslProtocol=TLSv1.2&topic=[[kafka.topic]]&groupId=[[kafka.consumer.group.id]]
&brokers=[[kafka.brokers]]&sslTruststoreLocation=path/truststore.jks
&sslTruststorePassword=password&sslKeystoreLocation=path/keystore.jks
&sslKeystorePassword=password&sslKeyPassword=password" />
从日志中获取的错误。
**Uncaught exception in kafka-producer-network-thread | producer-8:
java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57) ~[na:1.8.0_25]
at java.nio.ByteBuffer.allocate(ByteBuffer.java:335) ~[na:1.8.0_25]
at org.apache.kafka.common.network.NetworkReceive.readFromReadableChannel(NetworkReceive.java:93) ~[kafka-clients-0.10.1.1.jar:na]
at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:71) ~[kafka-clients-0.10.1.1.jar:na]
at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:154) ~[kafka-clients-0.10.1.1.jar:na]
at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:135) ~[kafka-clients-0.10.1.1.jar:na]
at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:343) ~[kafka-clients-0.10.1.1.jar:na]
at org.apache.kafka.common.network.Selector.poll(Selector.java:291) ~[kafka-clients-0.10.1.1.jar:na]
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:260) ~[kafka-clients-0.10.1.1.jar:na]
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:236) ~[kafka-clients-0.10.1.1.jar:na]
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:135) ~[kafka-clients-0.10.1.1.jar:na]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_25]
2020-03-31 07:12:00,013--INFO Class:: org.apache.camel.util.CamelLogger Method :: log :159
暂无答案!
目前还没有任何答案,快来回答吧!