You might find https://storm.apache.org/releases/2.0.0-SNAPSHOT/Understanding-the-parallelism-of-a-Storm-topology.html informational.
The executors invoke nextTuple. As you have configured your topology, you will have 3 tasks (unless you set it explicitly, you get the same number of tasks as executors), 3 executors, 1 worker. This means there will be 3 instances of your spout, run by 3 threads in one worker JVM. NextTuple will be called in parallel by the 3 threads, where each thread has one separate instance of your spout. Just to be clear, nextTuple on one instance of the spout will always be invoked by only 1 thread. You only have to worry about concurrency issues in nextTuple if you share state between the spout instances, e.g. through static fields or some shared resource (a file for example). Den tir. 26. mar. 2019 kl. 14.34 skrev Jayant Sharma < [email protected]>: > Hi, > > We are using *apache storm 1.2.1. *In reference to this link > > https://stackoverflow.com/questions/48719370/apachestorm-who-calls-spout-nexttuple > Suppose we have spout parallelism as 3, and topology workers as 1 so that > all threads are in one worker. Will nextTuple() be called on all these > threads in parallel (simultaneously at the same moment) or will the spout > executor thread will call these nextTuple() one by one after the previous > call had returned? > > Thanks, > Jayant Sharma >
