- 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.
- 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
When using Spring Boot, the id of the application context can be a colon
delimited string of values. By default, Spring Cloud Task uses this
value as the task name. However, when using JMX, this can cause issues.
This commit updates the SimpleTaskNameResolver to clense the colons and
replace them with underscores.
Resolves#280
resolves#115
* Fixes bug where if the user set the environment variable and commandline args a unique constraint would fire.
* Updated docs
* Removed deprecation
* Fixed version number for integration test.
Added integration tests for externally generated task executions
Add externalExecutionId
resolves#80
resolves#115
* Fixes bug where if the user set the environment variable and commandline args a unique constraint would fire.
* Updated docs
* Removed deprecation
* Fixed version number for integration test.
Added integration tests for externally generated task executions
* We had a discussion on this sometime back and it was decided at that time to keep these type of trims and verification in the Repository.
* Fixed bug where trimming was taking 1 character too many
* Updated ExitMessage maxSize test to verify size
* Added ErrorMessage maxSize Test
* While adding taskExplorer to the test noticed it was missing 2 basic tests and added those as well
To provide the ability to control task orchestration via the exit
message, we moved the stack trace storage to a new field. This means
that exit message is now a field we can use similar to how exit code is
in batch, and still have the stack trace of an unsuccessful task
execution stored.
Resolvesspring-cloud/spring-cloud-task#186
Disabled integration tests by default
Just some cleanup on merge
In testing and other use cases, the ability to keep a context open
beyond the end of a task can be useful. This change provides the
ability to keep the context alive once a task has completed while also
explicitly shutting the context down (by default) once a task has ended.
Resolvesspring-cloud/spring-cloud-task#102
This commit changes the starting point of a task from the point when the
ApplicationContext issues the ContextRefreshedEvent to
SmartLifecycle#start. This is a more accurate point of start for a task
in that all beans should now be available. It also allows us to clean
up many ApplicationContext hacks that were present to get around the
fact that many beans were not ready when a Task was attempting to begin.
Resolvesspring-cloud/spring-cloud-task#107
This PR removes the use of SLF4J from all non-test code. SLF4J is still
directly referenced in the unit tests because of the mocking
functionality we're using. We can explore refactoring that in a later
PR.
Resolvesspring-cloud/spring-cloud-task#101
Added the ability to implement TaskExecutionListener functionality without
implementing the TaskExecutionListener interface.
resolvesspring-cloud/spring-cloud-task#95
When using Spring Boot's datasource initialization features, there was
the possibility that the datasource used by the TaskLifecycleListener
was not ready by the time it was needed for regular injection. This
commit addresses that by obtaining the datasource at the last possible
moment.
Resolvesspring-cloud/spring-cloud-task#83
Updates per code review
TaskLifecycleListener will set a TaskExecution's exitCode to null upon taskStart in the repository.
Only at the end of the execution will it store the exitCode.
resolvesspring-cloud/spring-cloud-task#82
This commit introduces the `TaskRepositoryInitializer` component. This
component will initialize the `DataSource` when appropriate and silently do
nothing otherwise. It can be customized to initialize a specific
`DataSource` as required.
Resolvesspring-cloud/spring-cloud-task#84
Spring Boot now provides the result of an ExitCodeExceptionMapper via an
event called ExitCodeEvent. This commit takes advantage of this new
event.
Resolvesspring-cloud/spring-cloud-task#48
TaskNameResolver allows the ability to customize how a task is named.
During normal use cases, the provided SimpleTaskNameResolver should
suffice.
resolvesspring-cloud/spring-cloud-task#54
This change removes the Spring Cloud Task dependency upon a
CommandLineRunner from boot and moves the handling of the task lifecycle
closer to the "edge" of a Spring Boot application.
With this change, now a developer simply adds @EnableTask to their
configuration somewhere and the task lifecycle will be recorded.
Resolvesspring-cloud/spring-cloud-task#39
* Supports SimpleTaskExplorer that accepts a TaskExecutionDao.
* Updated Dao's to support the explorer query requirements
* Added tests.
This resolvesspring-cloud/spring-cloud-task#7
* `DefaultTaskConfigurer` returns only one `SimpleTaskRepository` all others have been removed
* `SimpleTaskRepository` can use `JdbcTaskExecutionDao` or a `MapTaskExecutionDao`
* Add `Jdbc` and Map` `TaskRepositoryFactoryBeans` to support the creation of the correct type of `SimpleTaskRepository`
* `TaskDatabaseInitializer` will initialize a database if a datasource is found and if they have not disabled it using the `spring.task.initialize.enable`
* Add tests
* Added Transaction Support
* Re-add the samples to `pom.xml`
* Samples pom skips install and deploy lifecycle targets.