Is it possible add a global @SingleUse for spring boot application?
See original GitHub issueHope add global definition for spring-boot application. For example, if I add annotation at spring boot launch class, will guard all task execute once in nodes:
@SpringBootAppliction
@EnableScheduling
@SingleUse
Thanks for any reply
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Developing with Spring Boot
Spring Boot favors Java-based configuration. Although it is possible to use SpringApplication with XML sources, we generally recommend that your ...
Read more >Topical Guide | Spring Security Architecture
In a Spring Boot application, you can @Autowired the global one into another bean, but you cannot do that with the local one...
Read more >Spring Boot Reference Documentation
Spring Boot dependencies can be declared by using the org.springframework.boot group . Typically, your project declares dependencies to one or more “Starters”.
Read more >20. Developer tools - Spring
20.4 Global settings ... You can configure global devtools settings by adding a file named .spring-boot-devtools.properties to your $HOME folder (note that the ......
Read more >24. Externalized Configuration - Spring
Spring Boot lets you externalize your configuration so that you can work with the same application code in different environments. You can use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, thanks for feedback and sorry for the delay. If I understand you correctly, you want to add one annotation which would automatically put lock on all scheduled tasks? It is quite easy to implement but I am afraid that it’s a bit dangerous. We need a name for each lock and the only way to generated it automatically is to use method signature - ClassName.methodName(). In my opinion it’s quite fragile since you can rename the class or the method and when you deploy the change only to part of the cluster, the task will be executed twice. That’s why I hesitate to add it.
@zHaytam , yes it would and this is NOT the desired behaviour indeed. I have misread / misunderstood the initial request, so ignore my comment above.