micronaut-picocli
micronaut-picocli copied to clipboard
CLI app as daemon?
Task List
- [ ] Stacktrace (if present) provided
- [ ] Example that reproduces the problem uploaded to Github
- [x] Full description of the issue provided (see below)
Steps to Reproduce
- Create a CLI app, with picolli
- Create a scheduled bean (a bean with any @Scheduled annotation).
- Run the app
Expected Behaviour
The app should run as daemon.
Actual Behaviour
The app does not find a http server and quits.
Environment Information
- Operating System: Any, but Linux
- Micronaut Version: 1.2.0
- JDK Version: 11 (also tested 1.8), both openjdk-openj9.
Example Application
I think it's easy enough to reproduce.
Well If I leave out Picolli and add http-server-netty as a dependency, it works as expected. But in this case, I'd like to see CLI application which I can start using picolli CLI and the scheduler gets configured through picolli.
Hi @graemerocher
This was not a question. It was a missing feature.
I think you may need the micronaut-runtime
dependency to schedule the jobs
Thanks, hadn't found it in the docs when I opened this issue. I'll look it up and will give feedback soon.
@graemerocher the application will just shutdown if I do not add a while(true) loop.
I have a similar issue now, was this ever followed up or did you find a solution?
@prshnt I interpreted the suggested solution to be adding a while (true) sleep(1000);
loop to make sure the main thread never dies.
@remkop ah okay. thanks.