Bolts and Spouts are created by Storm and not known to Spring Context. You need to manually add them to SpringContext, there are few methods available i.e.
SpringContext.getContext().getAutowireCapableBeanFactory().autowireBeanProperties(this, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, false); SpringContext is my own class where i have injected SpringContext so SpringContext.getContext() returns the actuall Spring Context Ravi. On Tue, Sep 29, 2015 at 1:03 PM, Ankur Garg <[email protected]> wrote: > Hi , > > I am building a Storm topology with set of Spouts and Bolts and also using > Spring for Dependency Injection . > > Unfortunately , none of my fields are getting autowired even though I have > declared all my spouts and Bolts as @Components . > > However the place where I am declaring my topology , Spring is working fine > . > > Is it because cluster.submitTopology("test", conf, > builder.createTopology()) > submits the topology to a cluster (locally it spawns different thread for > Spouts and Bolts) that Autowiring is not working? > > Please suggest . >
