spring-scheduled Questions

12

I am writing an application that has a cron job that executes every 60 seconds. The application is configured to scale when required onto multiple instances. I only want to execute the task on 1 in...
Baccate asked 8/7, 2015 at 9:36

5

Solved

I have following annotation in my code @Scheduled(fixedDelayString = "${app.delay}") At this case I have to have properties like this app.delay=10000 #10 sec Propery file looks unreadable bec...
Bolero asked 17/1, 2020 at 11:56

2

it's strange, i setup corn as @Scheduled(cron= "0 0/10 * * * ? ") It did trigger every 10 minutes, but the issue is task runs each second.
Kirchner asked 3/4, 2014 at 8:7

3

Solved

In spring boot, can I schedule a spring job by not using @Scheduled annotation to a method? I am working with spring job in the spring boot. I want to schedule a job by using cron expression, but ...
Paleoecology asked 8/7, 2019 at 15:26

2

SpringBoot 1.4.1.RELEASE is used. A simple task is create that runs every 5 seconds. It fetched data from database using Spring Data JPA, sends the data through an API and on success, updates send ...
Ellisellison asked 6/10, 2017 at 8:29

2

I have a Spring Cron Expression like */10 * 9-17 * * MON-FRI I want to find out if the current time or any given time is within the range or not. I know I can use CronExpression class and use the n...
Backwash asked 21/2, 2022 at 8:13

5

I have lots of scheduled tasks in my Spring Boot (ver 1.4.2) application and would like to catch all exceptions from them using one handler like is possible for normal controllers with @ExceptionHa...
Aspergillus asked 8/12, 2016 at 14:13

8

Solved

I am using the @Scheduled annotation from Spring framework to invoke a method. But I have multiple nodes in my setup and I do not want them to all run at exactly the same time. So I'd like to set a...
Sanguine asked 9/1, 2015 at 21:48

6

Solved

I've been thinking around the Java feature that evaluates annotation values in compile-time and it seems to really make difficult externalizing annotation values. However, I am unsure whether it i...
Odense asked 23/7, 2012 at 8:3

8

Solved

Currently I have this : @Scheduled(fixedRate=5000) public void getSchedule(){ System.out.println("in scheduled job"); } I could change this to use a reference to a property @Scheduled(f...
Mylesmylitta asked 31/1, 2013 at 16:29

9

I have a @Scheduled task in my application which is setup using CRON and run every 4 hours. The problem I face is that the CRON job does not start immediately after application startup but it start...
Flower asked 15/2, 2017 at 10:10

2

Solved

I'm investigating using @Scheduled at a fixed rate where in some configurable circumstances the scheduled job should never be run. The documentation doesn't mention this but the default values for...
Fridafriday asked 5/10, 2015 at 10:33

3

I would like to test if my Cron-job will be executed at the given time (1 January 00:00 of each year). Is there a way to test this? Unfortunately every example I could found online, refers to jobs ...
Acetyl asked 17/11, 2020 at 17:58

2

Solved

I use sprint boot 1.3, spring 4.2 In this class @Service public class PaymentServiceImpl implements PaymentService { .... @Transactional @Override public void processPayment() { List<Paym...
Footlights asked 19/5, 2016 at 22:56

2

Solved

My job is running every at the time specified but its running every second of time specified, for example if I set a job to run at 22:54 it will run every second from 22:54:00 until 22:54:59. I wan...
Legpull asked 12/3, 2020 at 23:11

5

Solved

My service (jobExecutor which use main dataSource) works fine when called from spring MVC controller, however all the time throws "TransactionRequiredException: no transaction is in progress" when ...

7

How can I disable the schedule auto-start on Spring Boot IntegrationTest? Thanks.
Willywillynilly asked 18/11, 2016 at 19:45

1

Solved

I have implemented an asynchronous method in a Java 1.8 class using Spring Framework (version 5.0.5.RELEASE): public class ClassToBeTested { @Autowired private MyComponent myComponent; @Async ...
Hillinck asked 17/12, 2018 at 23:33

1

Is there a way to call a spring scheduled method (job) through a user interaction? I need to create a table with shown all jobs and the user should be able to execute them manually. For sure the jo...
Charlton asked 3/5, 2018 at 9:41

3

Solved

I am using spring scheduler.This works fine but when I changed cron.expression value in application.properties every time I need to restart tomcat server.Is there any way that I can make it dynamic...
Parts asked 27/10, 2017 at 8:8

6

I'm trying to have my code execute on a fixed schedule, based on a Spring cron expression. I would like the code to be executed every day at 1:01:am. I tried the following expression, but this didn...
Florin asked 1/10, 2014 at 17:26

2

Solved

I am working on a scheduling project which executes multiple jobs at regular intervals. I am using a cron scheduling as in the example below. The jobs are getting executed successfully no problems...
Diluvial asked 3/5, 2017 at 17:8

1

I am configuring a scheduled task to run in different threads. Here is the configuration code @Configuration @EnableScheduling public class SchedulerConfig implements SchedulingConfigurer { priva...
Chutzpah asked 12/1, 2018 at 20:19

1

Solved

I have configured two different thread pools, one for @Scheduled and other for @Async. However, I notice that the thread-pool for @Async is not being used. Here is the Scheduler configuration @Co...

2

Solved

I have a scheduled job in Spring, I get its cron from my database. Every time it is executed, the next execution time is updated. So, if it is configured to run every 10 minutes, I can change the v...
Snuffbox asked 16/12, 2016 at 14:34

© 2022 - 2024 — McMap. All rights reserved.