Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Quando rodo o FraudService me gera 2 erros: java.io.IOException: Map failed e Broker may not be available

[main] WARN org.apache.kafka.clients.NetworkClient - [Consumer clientId=consumer-FraudDetectorService-1, groupId=FraudDetectorService] Connection to node 0 (NB26752S.mshome.net/172.29.186.193:9092) could not be established. Broker may not be available.
java.io.IOException: Map failed
        at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:938)
        at kafka.log.AbstractIndex.<init>(AbstractIndex.scala:125)
        at kafka.log.TimeIndex.<init>(TimeIndex.scala:54)
        at kafka.log.LazyIndex$.$anonfun$forTime$1(LazyIndex.scala:75)
        at kafka.log.LazyIndex.$anonfun$get$1(LazyIndex.scala:59)
        at kafka.log.LazyIndex.get(LazyIndex.scala:56)
        at kafka.log.LogSegment.timeIndex(LogSegment.scala:67)
        at kafka.log.LogSegment.resizeIndexes(LogSegment.scala:78)
        at kafka.log.Log.loadSegments(Log.scala:711)
        at kafka.log.Log.<init>(Log.scala:297)
        at kafka.log.Log$.apply(Log.scala:2463)
        at kafka.log.LogManager.$anonfun$getOrCreateLog$1(LogManager.scala:760)
        at kafka.log.LogManager.getOrCreateLog(LogManager.scala:715)
        at kafka.cluster.Partition.createLog(Partition.scala:308)
        at kafka.cluster.Partition.createLogIfNotExists(Partition.scala:292)
        at kafka.cluster.Partition.$anonfun$makeLeader$1(Partition.scala:489)
        at kafka.cluster.Partition.makeLeader(Partition.scala:478)
        at kafka.server.ReplicaManager.$anonfun$makeLeaders$5(ReplicaManager.scala:1360)
        at scala.collection.mutable.HashMap$Node.foreach(HashMap.scala:581)
        at scala.collection.mutable.HashMap.foreach(HashMap.scala:469)
        at kafka.server.ReplicaManager.makeLeaders(ReplicaManager.scala:1358)
        at kafka.server.ReplicaManager.becomeLeaderOrFollower(ReplicaManager.scala:1248)
        at kafka.server.KafkaApis.handleLeaderAndIsrRequest(KafkaApis.scala:221)
        at kafka.server.KafkaApis.handle(KafkaApis.scala:132)
        at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:70)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: Map failed
        at sun.nio.ch.FileChannelImpl.map0(Native Method)
        at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:935)
        ... 25 more
2 respostas

obs.: o consumer não identifica nenhuma msg do producer (quando utilizo o comando:

.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic ECOMMERCE_NEW_ORDER --from-beginning

)

solução!

"Resolvi "o problema com uma outra abordagem.

Subi o kafka e o zookeeper em um container docker e rodei com o docker-compose.