We had issues with Spring and Storm. What we did is the following: don't do anything on the constructor. Perhaps pass a String with the location of the Spring configuration file. In the prepare or open method (for bolts and spouts respectively) initialize a context with the context file location and from there assign your Spring beans to the internal members of your spouts/bolts.
Regards, Javier On Fri, Aug 21, 2015 at 8:29 PM, Miguel Ángel Fernández Fernández < [email protected]> wrote: > I'm developing a project to testing the feasibility of combine Spring with > Trident (of course, I know https://github.com/granthenke/storm-spring ) > > In the beginning, I have no problem. As you can see ( > https://github.com/miguelangelprogramacion/spring4-storm-cassandra), I > created a simple trident topology with an spout that emits continuous > values parsed from a file. > > In the next level, I wanted to insert some information in cassandra. To > that end, I was inspired by > https://github.com/hmsonline/storm-cassandra-cql, but in my code > I'm trying to include the Spring CassandraTemplates. > > The problem is that Spring framework objects are not serializable, and > once the topology is deployed, Storm seems to lost the Spring Objects ( > java.io.NotSerializableException: > org.springframework.data.cassandra.core.CassandraTemplate) > > Im triying to extend some Spring classes with serializable wrappers, but > it not seems to be a good idea. > > Does anybody have a clue for this problem? > -- Javier González Nicolini
