Hi, I have 2 workers with 2 RabbitMq spouts and 4 bolts that processes data. The RabbitMq and other connection factories that I have inside of spouts and bolts are all Singleton instance.
In local mode since the workers are simulated as Threads, I would expect all the Threads to have a single instance of the factory. Is that understanding correct? However, that is not the case from the logs. I have 2 threads of the bolt ( thread id 30 and id 32) and each create an instance of the factory. Thread 30 goes first and creates the factory and when thread 32 finds the factory instance to be NULL. I made all the entry point methods synchronized. Are the workers loaded by different class loaders? Also, from the logs, worker 6700 and worker 6701 both run my bolt on the same thread. On 6700, I find 'Thread-6-my-bolt' getting initialized with a thread ID 32 and on 6701, I find the same thread 'Thread-6-my-bolt' getting initialized with the same thread ID as well. I'm a bit confused. Are these 2 different tasks on the same thread? Can someone please shed some light? Thanks, Sudha
