Hey Balazs- The StreamTask is initialized via reflection and so can't have anything but the default constructor ( https://github.com/apache/incubator-samza/blob/master/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala#L417). For any resources the StreamTask needs, initialize them by implementing the InitableTask interface( https://github.com/apache/incubator-samza/blob/master/samza-api/src/main/java/org/apache/samza/task/InitableTask.java), which will get called before processing begins. You may need to refactor a bit, but this should provide the same functionality.
-Jakob On Tue, Aug 26, 2014 at 1:15 AM, Balazs Mester <[email protected]> wrote: > Hello! > > Is there a best practice how to initialise a StreamTask instance if it has > a constructor that takes an argument? I would like to inject its > dependencies but I don't know how the framework will instantiate this task. > > -- > Balazs Mester > Senior Java Developer @ Basepointmedia > > E-mail: [email protected] > Web: http://b <http://pulilab.com/>asepointmedia.com > Skype: balazs_mester >
