Integration of Spach Trident and Kafka Spout

I can not find good documentation for the proper integration of Kafka with Apache Storm Trident. I tried to study related questions posted earlier here, but there is not enough information.

I would like to associate Trident with Kafka as OpaqueTridentKafkaSpout. Here is an example of code that currently works

GlobalPartitionInformation globalPartitionInformation  = new GlobalPartitionInformation(properties.getProperty("topic", "mytopic"));
Broker brokerForPartition0 = new Broker("IP1",9092);
Broker brokerForPartition1 = new Broker("IP2", 9092);
Broker brokerForPartition2 = new Broker("IP3:9092");

globalPartitionInformation.addPartition(0, brokerForPartition0);//mapping from partition 0 to brokerForPartition0
globalPartitionInformation.addPartition(1, brokerForPartition1);//mapping from partition 1 to brokerForPartition1
globalPartitionInformation.addPartition(2, brokerForPartition2);//mapping from partition 2 to brokerForPartition2
StaticHosts staticHosts = new StaticHosts(globalPartitionInformation);
TridentKafkaConfig tridentKafkaConfig = new TridentKafkaConfig(hosts,properties.getProperty("topic", "mytopic"));
tridentKafkaConfig.scheme = new SchemeAsMultiScheme(new StringScheme());
OpaqueTridentKafkaSpout kafkaSpout = new OpaqueTridentKafkaSpout(tridentKafkaConfig);

With this, I can generate threads for my topology, as shown in the code below

TridentTopology topology = new TridentTopology();
Stream analyticsStream  = topology.newStream("spout", kafkaSpout).parallelismHint(Integer.valueOf(properties.getProperty("spout","6")))

Although I provided parallelism and my sections, only 1 Kafka Spout artist works, and therefore I cannot scale it well.

Can someone advise me on the best ways to integrate Apache Storm Trident (2.0.0) with Apache Kafka (1.0) with 3 node clusters each?

In addition, as soon as he finishes reading from Kafka, I constantly receive these magazines

2018-04-09 14:17:34.119 o.a.s.k.KafkaUtils Thread-15-spout-spout-executor[79 79] [INFO] Metrics Tick: Not enough data to calculate spout lag.  2018-04-09 14:17:34.129 o.a.s.k.KafkaUtils Thread-21-spout-spout-executor[88 88] [INFO] Metrics Tick: Not enough data to calculate spout lag.

Storm . Ticks?

+4

Source: https://habr.com/ru/post/1695989/


All Articles