Upgrade to Spring Boot 1.4
This commit upgraded all places where Spring Cloud Task explicitly references Spring Boot 1.4 Resolves spring-cloud/spring-cloud-task#166 Updated the jar version numbers in the adocs to 1.1.0
This commit is contained in:
committed by
Glenn Renfro
parent
9f0377df0b
commit
551a4bc53a
@@ -27,7 +27,7 @@ $ ./mvnw clean install
|
||||
|
||||
[source,shell,indent=2]
|
||||
----
|
||||
$ java -jar target/batch-events-1.0.3.BUILD-SNAPSHOT.jar --spring.cloud.stream.bindings.batch-events.contentType=application/json
|
||||
$ java -jar target/batch-events-1.1.0.BUILD-SNAPSHOT.jar --spring.cloud.stream.bindings.batch-events.contentType=application/json
|
||||
----
|
||||
|
||||
For example you can listen for specific job execution events on a specified channel with a Spring Cloud Stream Sink
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<version>1.4.0.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -61,6 +61,10 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -22,5 +22,5 @@ $ mvn clean package
|
||||
|
||||
[source,shell,indent=2]
|
||||
----
|
||||
$ java -jar target/batch-job-1.0.3.BUILD-SNAPSHOT.jar
|
||||
$ java -jar target/batch-job-1.1.0.BUILD-SNAPSHOT.jar
|
||||
----
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<version>1.4.0.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -22,7 +22,7 @@ $ export spring_datasource_url=jdbc:mysql://localhost:3306/<your database>
|
||||
$ export spring_datasource_username=<your username>
|
||||
$ export spring_datasource_password=<your password>
|
||||
$ export spring_datasource_driverClassName=org.mariadb.jdbc.Driver
|
||||
$ java -jar -Dspring.profiles.active=master target/partitioned-batch-job-1.0.3.BUILD-SNAPSHOT.jar
|
||||
$ java -jar -Dspring.profiles.active=master target/partitioned-batch-job-1.1.0.BUILD-SNAPSHOT.jar
|
||||
----
|
||||
|
||||
NOTE: This example will use require a MySql RDBMS repository and currently uses the mariadb jdbc driver to connect.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<version>1.4.0.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.task.paritioner;
|
||||
package org.springframework.cloud.task.partitioner;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import javax.sql.DataSource;
|
||||
@@ -27,7 +27,7 @@ import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.task.repository.TaskExecution;
|
||||
import org.springframework.cloud.task.repository.TaskExplorer;
|
||||
import org.springframework.cloud.task.repository.support.SimpleTaskExplorer;
|
||||
@@ -44,7 +44,7 @@ import org.springframework.util.SocketUtils;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = {TaskPartitionerTests.TaskLauncherConfiguration.class})
|
||||
@SpringBootTest(classes = {TaskPartitionerTests.TaskLauncherConfiguration.class})
|
||||
public class TaskPartitionerTests {
|
||||
|
||||
private static String DATASOURCE_URL;
|
||||
@@ -55,7 +55,6 @@ public class TaskPartitionerTests {
|
||||
private TaskExplorer taskExplorer;
|
||||
|
||||
@Autowired
|
||||
|
||||
private DataSource dataSource;
|
||||
|
||||
@Autowired
|
||||
@@ -99,8 +98,8 @@ public class TaskPartitionerTests {
|
||||
|
||||
Page<TaskExecution> taskExecutions = taskExplorer.findAll(new PageRequest(0, 10));
|
||||
assertEquals("Five rows are expected", 5, taskExecutions.getTotalElements());
|
||||
assertEquals("Only One master is expected", 1, taskExplorer.getTaskExecutionCountByTaskName("batchEvents:master:0"));
|
||||
assertEquals("4 partitions is expected", 4, taskExplorer.getTaskExecutionCountByTaskName("batchEvents:worker:0"));
|
||||
assertEquals("Only One master is expected", 1, taskExplorer.getTaskExecutionCountByTaskName("Partitioned Batch Job Task:master:0"));
|
||||
assertEquals("4 partitions is expected", 4, taskExplorer.getTaskExecutionCountByTaskName("Partitioned Batch Job Task:worker:0"));
|
||||
for (TaskExecution taskExecution : taskExecutions) {
|
||||
assertEquals("return code should be 0", 0, taskExecution.getExitCode().intValue());
|
||||
}
|
||||
@@ -17,7 +17,7 @@ $ ./mvnw clean install
|
||||
|
||||
[source,shell,indent=2]
|
||||
----
|
||||
$ java -jar target/task-events-1.0.3.BUILD-SNAPSHOT.jar --spring.cloud.stream.bindings.task-events.contentType=application/json
|
||||
$ java -jar target/task-events-1.1.0.BUILD-SNAPSHOT.jar --spring.cloud.stream.bindings.task-events.contentType=application/json
|
||||
----
|
||||
|
||||
You can listen for the events on the task-events channel with a Spring Cloud Stream Sink
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<version>1.4.0.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<version>1.4.0.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<version>1.4.0.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -22,5 +22,5 @@ $ mvn clean package
|
||||
|
||||
[source,shell,indent=2]
|
||||
----
|
||||
$ java -jar target/timestamp-task-1.0.3.BUILD-SNAPSHOT.jar
|
||||
$ java -jar target/timestamp-task-1.1.0.BUILD-SNAPSHOT.jar
|
||||
----
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<version>1.4.0.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
Reference in New Issue
Block a user