<@U9Z4DNM7W> Thank you for your comment : Can your...
# spring
k
@sandjelkovic Thank you for your comment : Can your example code be runnable like a daemon in background ?
s
It is intended to be run as such, CommandLineRunners run as part of your application, but if you’re scheduling a background job I would also schedule it as a cancelable task, in order to not keep the CLR thread blocked or preocupied. In my case, this is done by Reactor itself. I’m not sure I understand your second question about
HttpServletRequest.outputStream
, but if it helps, code inside a CLR is as if you have a mini main method that executes after Spring context has finished initializing, you don’t specifically get Web infrastructure. Unless you inject the Beans you need in the function (or Bean definition), for example a Serializer or configuration or an input and output targets from which you can open streams.