Does Storm work with Spring

2015-09-29 Thread Ankur Garg
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 , Spr

Re: Does Storm work with Spring

2015-10-06 Thread Ankur Garg
Hi Ravi , I was able to make an Integration with Spring but the problem is that I have to autowire for every bolt and spout . That means that even if i parallelize spout and bolt it will get started to each instance . Is there some way that I only have to do for bolts and spouts once (I mean if I

Re: Does Storm work with Spring

2015-10-09 Thread John Reilly
You can just create the ApplicationConrext using a singleton and make all fields in the bolt or spout code which reference the app context transient. On Fri, Oct 9, 2015 at 08:35 Javier Gonzalez wrote: > IIRC, only if everything you use in your spouts and bolts is serializable. > On Oct 6, 2015 1

Re: Does Storm work with Spring

2015-10-09 Thread John Reilly
Oh yeah... And of course set the transient fields in prepare methods. On Fri, Oct 9, 2015 at 20:04 John Reilly wrote: > You can just create the ApplicationConrext using a singleton and make all > fields in the bolt or spout code which reference the app context transient. > On Fri, Oct 9, 2015 at

Re: Does Storm work with Spring

2015-10-10 Thread Ankur Garg
Also , I think there can be some instances of spouts/bolts running on JVM 1 and some on JVM 2 and so on... Is it possible for spouts and bolts running on same jvm to access same applicationContext . I am thinking that I can make the place where I launch my spring Boot application inside a singl

Re: Does Storm work with Spring

2015-10-11 Thread Ravi Sharma
Yes ur assumption is right Jvm1 will create application contexts say ac1 And jvm2 will create another application instance ac2 And all of it can be done via singleton classes. All bolts and spouts in same jvm instance need to access same application context. I have done same in cluster and it w

Re: Does Storm work with Spring

2015-10-11 Thread Ankur Garg
I think I don't need to Autowire beans inside my spout and bolts . All I want my context to be available . Since I use Spring Boot , I am delegating it to initialise all the beans and set up every bean (reading yml file and create DB connections , connections to Message brokers etc ) . On my loc

Re: Does Storm work with Spring

2015-10-19 Thread Ankur Garg
Hi Ravi , Need your help . So I created a local cluster and deployed my topology to it . Inside my Spout and Bolts , I am launching a Spring Boot application wrapped inside a singleton to initialise my context . Unfortunately , it appears to me that it is not working : and annotations like @E

Re: Does Storm work with Spring

2015-10-19 Thread Ravi Sharma
you may have to tell Spring that ur .yaml file is ur resource file. Ravi. On Mon, Oct 19, 2015 at 3:25 PM, Ankur Garg wrote: > Hi Ravi , > > Need your help . So I created a local cluster and deployed my topology to > it . Inside my Spout and Bolts , I am launching a Spring Boot application > wr

Re: Does Storm work with Spring

2015-10-19 Thread Ankur Garg
Actually its not only yml , infact none of the dependencies are getting injected . Perhaps , it appears to me that it is not able to read Spring Annotations . Btw , do u know how to debug my application deployed on remote cluster remotely from Eclipse. Thanks Ankur On Mon, Oct 19, 2015 at 8:22 P

Re: Does Storm work with Spring

2015-10-19 Thread John Reilly
Where is input.rabbitmq.port defined? I would guess that it is a file that is being read as a resource and that the resource is not available on the worker but I can only guess, not know any specifics about the code in question... On Mon, Oct 19, 2015 at 8:27 AM Ankur Garg wrote: > Actual

Re: Does Storm work with Spring

2015-10-19 Thread Ankur Garg
Hi John , input.rabbitmq.port is being defined inside a yml file placed inside my config folder which is in one of the dependent projects which my project references . Ironically , when I run this on LocalCluster everything works absolutely fine . Only when I send it to the cluster is when the p

Re: Does Storm work with Spring

2015-09-29 Thread Ravi Sharma
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)

Re: Does Storm work with Spring

2015-09-29 Thread Ankur Garg
Hi Ravi , Thanks for your reply . I am using annotation based configuration and using Spring Boot. Any idea how to do it using annotations ? On Tue, Sep 29, 2015 at 6:41 PM, Ravi Sharma wrote: > Bolts and Spouts are created by Storm and not known to Spring Context. You > need to manually add

Re: Does Storm work with Spring

2015-09-29 Thread Ravi Sharma
Yes this is for annotation also... you can call this method in prepare() method of bolt and onOpen() method in every Spout and make sure you don't use any autowire bean before this call. Ravi. On Tue, Sep 29, 2015 at 2:22 PM, Ankur Garg wrote: > Hi Ravi , > > Thanks for your reply . I a