Commit Graph

136 Commits

Author SHA1 Message Date
Glenn Renfro
3102aa0265 Update so that it can be natively compiled by Spring Native 0.11 2021-09-27 11:28:05 -04:00
Işık Erhan
8b4352095d Support multiple task listener beans of same type 2021-08-15 18:23:17 +03:00
Henning Pöttker
723fa1353a Mark TaskRepositoryInitializer as not lazy 2021-06-28 14:37:57 -04:00
Glenn Renfro
17415eaed5 Updating task execution id next val to use sequence for sqlserver
resolves TASK-782

Updated PR to resolve issue when no task tables exist

Updated PR based on review comments.
This does not include updated tests.
This resolves a problem where task would fail because the incrementer selection occured before the tables were created.

Added unit test for SqlServerSequenceIncrementer

updated based on code review
2021-05-28 18:09:35 -04:00
Michael Minella
704b8df2ad Added sort validation
This commit now validates that the value passed via a PageRequest to
sort the results by is a valid value.

Resolves #739

Fixed to allow for all letter cases
2020-11-09 10:30:03 -05:00
Glenn Renfro
b4ea1040de Task tags assigned to all metrics sent by the app
Ensure that Task's org.springframework.cloud.task.configurationorg.springframework.cloud.task.configuration.MetricsAutoConfiguration is configured Before org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration (that in turn is configured Before the CompositeMeterRegistryAutoConfiguration).
Resolves #691
2020-08-11 11:52:52 -04:00
Glenn Renfro
80f39bea84 Removed cfenv from dependencies
Updated tests that used it.

resolves #681
2020-07-08 12:41:56 -04:00
Glenn Renfro
59c9adf047 Updated all Junit tests to 5.x
resolves TASK-675
2020-07-07 10:55:16 -05:00
Glenn Renfro
aba70b468a Changing DataSourceBuilder to EmbeddedDatabaseBuilder. 2020-03-25 11:19:18 -04:00
Michael Minella
00b8acab55 Added support for specifying a TransactionManager
Before this commit, Spring Cloud Task did not correctly configure the
provided PlatformTransactionManager with the TaskRepository.  This
commit addressis this bug.

Resolves #652

Polished PR on Merge
2020-03-25 10:05:16 -04:00
Glenn Renfro
6b336a983c Resolves Task Lock issue with Oracle DB
In short the Oracle CHAR type is blank padded to the end of the field.  So we were not getting an exact match on queries when looking for the LOCK_KEY or CLIENT_ID
2020-01-30 09:17:15 -06:00
Glenn Renfro
7e24e6d4ec Added Flatten-maven-plugin
resolves #633
2019-11-07 12:01:04 -05:00
Glenn Renfro
4f1524a711 OutputCapture should be updated to OutputCaptureRule
resolves #615

In Boot 2.2.x they change the of OutputCapture and thus it was deprecated.
2019-07-15 15:28:50 -04:00
Glenn Renfro
7490f8b820 Initialize values with properties vs value
resolves #SCT-587
2019-07-03 13:24:06 -05:00
Michael Minella
0af72e31ac Polish 2019-07-03 13:09:18 -05:00
Christian Tzolov
d4b51a074b Add Micrometer support for Task applications
- New dependencies
   - micrometer-core
   - java-cfenv - required by the CF tags configuration.
 - Add TaskMetrics configuration that installs two Meters (Timer and LongTaskTimer) that produce the following time-series:
   - spring.cloud.task - shows task duration (updated only after the task has completed).
   - spring.cloud.task.active - provides run time information about the non-completed tasks.
   Both meters are started at TaskExecutionListener#onTaskStartup() and ended at onTaskEnd() or onTaskFailure().
 - Add common Task tags assigned to all time-series produced by the Task (not only the s.c.task and s.c.task.active). This allows to analyze CPU, Memory and other measurements grouped by task/execution ids.
 - Add Cloud Found tags - Activated only for CF target platform.

 Resolves #608
2019-07-03 13:06:58 -05:00
Glenn Renfro
d2031ff66e Updated the order in which the TaskLifecycleListener is configured
resolves #605
2019-06-25 09:48:21 -05:00
Donovan Muller
915a6ef82f Fix closecontextEnabled property reference
Fixes #561
2019-05-08 14:38:12 -04:00
Glenn Renfro
16f68020fb Update dependency versions 2019-05-07 13:54:00 -04:00
Glenn Renfro
fd8ab15238 Updated all dependencies for M1 RELEASE
Updated to Spring Cloud Build 2.2.0.M1
2019-04-15 15:11:28 -04:00
Glenn Renfro
c8158360b2 Updated test for the new maria error code
resolves #288
2019-04-08 11:28:13 -04:00
Glenn Renfro
ce51987f98 Rebased
Updated to spring-cloud-build 2.2.0.BUILD-SNAPSHOT
Updated Tests to support the changes in the latest H2 database
Must use "-ifNotExists", when using the H2 TCP Server
2019-03-28 16:57:11 -05:00
Glenn Renfro
8a3ac48cc3 Updated all task_lock tables to add NOT NULL to primary keys.
resolves #505
2019-03-22 11:52:57 -04:00
Spring Operator
2bff013b83 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 204 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).

Updated Spring Cloud Build dependency

this was so that we can get the latest spring-cloud-build
2019-03-21 16:34:26 -04:00
Glenn Renfro
960e3c1d46 Treat MariaDB type as MySQL
resolves #514
2019-02-13 15:59:23 -05:00
Glenn Renfro
03d9a980e9 Cleanup from Checkstyle changes
resolves #511

* Sets the appropriate copyright dates
* Updates some docs
2019-02-13 12:21:14 -05:00
Marcin Grzejszczak
60f1e21d03 Added checkstyle 2019-02-03 19:27:07 +01:00
Glenn Renfro
9c20e45771 Updated the DB2 Script to fix the not null in primary key.
resolves #500
2019-01-14 16:41:48 -06:00
Glenn Renfro
39a74253b6 closeContextEnable should be closeContextEnabled in docs 2019-01-11 10:24:05 -05:00
Michael Minella
5525382563 Polish 2018-12-13 15:02:42 -06:00
Glenn Renfro
30399dbb57 Established @EnableTask to create instance of TaskLifecycle Bean
resolves #494
2018-12-10 16:07:31 -05:00
wildloop
b4b50e8182 bug-fix: throwable param's required for @FailedTask annotated methods
Lack of this parameter causes:
-  the exception with message: "o.s.c.t.listener.TaskLifecycleListener: taskExecution and throwable parameters are required for @FailedTask annotated methods :While handling this error: java.lang.IllegalStateException: Failed to execute ApplicationRunner" - please, take look at [this](https://github.com/spring-cloud/spring-cloud-task/blob/master/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/listener/annotation/TaskListenerExecutor.java#L113)
- and, as a consequence, a lost lock on the task (record in the table `task_locks`)
2018-12-06 17:10:49 -05:00
Michael Minella
da56c2b08e Polish 2018-12-05 16:53:20 -06:00
Glenn Renfro
2c1e696da2 Add documentation on when to resolve SCT delcared beans.
resolves #491
2018-12-05 16:53:12 -06:00
Janne Valkealahti
de45d1eb47 Rely on spring-cloud-deployer autoconfig
- Deployer core/local uses 2.0.0.BUILD-SNAPSHOT
- Use pring-cloud-deployer-dependencies bom
- Remove ResourceLoadingAutoConfiguration as that is now in
  deployer itself with a way to configure loaders.
- spring-cloud-task-core now depends on spring-cloud-deployer-autoconfigure.
- Rest of deployer modules like support/maven are still defined in deps
  as those are optional in spring-cloud-deployer-autoconfigure.
2018-11-29 15:42:34 +00:00
Glenn Renfro
8e1d38a76a Cleanup code smells reported by Sonar
This is a first pass are removing some of the code smells.
Many reported code smells were ignored in this effort
2018-11-27 16:09:17 -05:00
Glenn Renfro
fa3e4e55c6 Updated tests to remove SQL Bad Grammar warnings
Also replacing the last of the SpringJunit4ClassRunner with SpringRunner
Other cleanup

resolves #482
2018-11-21 11:17:31 -06:00
Glenn Renfro
ab58cdd9df Added discussion on using SmartLifecycle#stop to java docs.
Also updated other docs in the TaskLifecycleListener.

resolves #471
2018-11-21 10:46:05 -06:00
Glenn Renfro
f083d7a7ff Corrects code to remove bug reports from Sonar Report
Resolves #478
2018-11-12 14:54:47 -05:00
Glenn Renfro
f772956680 Binary defaults for conditional metadata now used Binary Type
Before they were of String type

resolves #467
2018-11-02 16:21:01 -04:00
Glenn Renfro
4387d816d1 Updated javadoc to remove ContextRefreshedEvent
Updated it to discuss SmartLifecycle#start() as the agent that kicks off the task.

resolves #447
2018-11-02 14:52:43 -05:00
Ilayaperumal Gopinathan
324abd4e5c Exit code is nullable
- Make exit code nullable and only update of execution status can make it a valid integer
 - Update JDBC create/start task execution queries to have exitCode as `null` values
 - Update tests to validate/verify the appropirate exit code values for create/start/complete task executions

On merge had to add a pause to the TaskLauncherSinkTests to wait for the task to complete successfully   Before we assumed that 0 was a satisfactory result meaning it was either running or completed.    Now with the null being returned it could be zero or null.  So we have to wait for the task to complete.
2018-11-02 14:45:55 -04:00
Michael Minella
7be8b8a105 Polish 2018-11-02 11:56:42 -05:00
Glenn Renfro
c7ef7fbff4 Starting to move to java 11[Do Not Merge]
All version changes are present.

Fixed all Java-Doc Errors and warnings

* Due to the stricter nature of the javadoc compiler we can't wrap <ul> / <ui> in <p>
* We will also need to Push up a test app for taklauncher to work with.   The old one fails to start now.   Or use one of the task starters possibly.
* Built on the work from TASK-439C.   Wait for that merge before merging this one.
* Replaced applicationFailedEvent class attribute with applicaitonFailedException
* Also polished the app used by the taskLauncherSink integration test
2018-11-01 15:23:17 -04:00
Michael Minella
90c88c52e6 Polish 2018-11-01 10:45:15 -05:00
Glenn Renfro
d2bc2530cc Update Task to BOOT 2.1.M1
Migrating to use ApplicationContextRunner or ImportAutoConfiguration with SpringApp.run, instead of SpringApplicationBuilder, because builder does not handle AutoConfiguration properly

SimpleTaskAutoConfiguration now has an annotation AutoConfigureBefore the BatchTaskAutoConfig so that it is processed prior.  THis is so that that BatchTaskAutoConfig can create the appropriate beans

SimpleTaskAutoConfiguration has new annotations so that it is AutoConfigured after BindingServiceConfiguration and after SimpleTaskAutoConfiguration.  This is so that it does not attempt to start emitting messages before stream is ready and it can create the appropriate beans after SimpleTaskAutoConfiguration has run.

Renamed SimpleTaskConfiguration to SimpleTaskAutoConfiguration.

Task version updated to  2.1.0

Added missing headers

Updated documentation.

Deprecated EnableTask

Added ability to disable Task autoconfiguration.

Removed @EnableTask from tests

Resolves #439
Resolves #440
Resolves #448
Resolves #466
2018-11-01 10:43:31 -05:00
Glenn Renfro
d2c90c5256 Updated to add metadata for Conditionals
Also renamed camel-cased properties to cononical format.

resolves #442
2018-10-26 09:42:14 +01:00
David Turanski
cba26ed968 Implement getRunningTaskCount
Expose functionality via TaskExplorer

Polishing on merge
2018-09-05 08:43:55 -04:00
Gunnar Hillert
de1ebfb351 gh-424 Add the ability to retrieve the last TaskExecution for Tasks
- Add the ability to retrieve the last TaskExecution to:
  - MapTaskExecutionDao
  - JdbcTaskExecutionDao
- Refactor `JdbcTaskExecutionDao` and use `NamedParameterJdbcTemplate` for all persistence store calls
- Add the following TaskExecution methods to TaskExplorer:
  - getLatestTaskExecutionsByTaskNames
  - getLatestTaskExecutionForTaskName
- Add Tests
- Ensure that code is JDK7 compatible due to backporting needs
- Ensure commit backports to 1.2.x

Polishing on tests during merge
2018-06-15 16:54:28 -04:00
Glenn Renfro
5672b326ed SimpleTaskConfiguration ignores proxy beans when validating datasources
If a user adds spring-cloud-starter-config to the dependencies it has to add a proxy for the datasource else the Hikari connection pool pukes.

resolves #407
2018-04-13 16:19:52 -05:00