You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/03/27 14:36:48 UTC
[incubator-servicecomb-saga] 03/03: SCB-410 Support to build demos
with Spring Boot 2
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git
commit 79e132ca5d088f47a659f682411e7d5c08289d40
Author: Willem Jiang <ji...@huawei.com>
AuthorDate: Tue Mar 27 16:31:16 2018 +0800
SCB-410 Support to build demos with Spring Boot 2
---
.../org/apache/servicecomb/saga/PackStepdefs.java | 14 +++++-----
.../booking/booking/src/main/resources/log4j2.xml | 30 ++++++++++++++++++++++
.../booking/car/src/main/resources/log4j2.xml | 30 ++++++++++++++++++++++
.../booking/hotel/src/main/resources/log4j2.xml | 30 ++++++++++++++++++++++
saga-demo/pom.xml | 22 ++++++++++++++++
5 files changed, 119 insertions(+), 7 deletions(-)
diff --git a/acceptance-tests/acceptance-pack/src/test/java/org/apache/servicecomb/saga/PackStepdefs.java b/acceptance-tests/acceptance-pack/src/test/java/org/apache/servicecomb/saga/PackStepdefs.java
index 9ba2d75..e256be9 100644
--- a/acceptance-tests/acceptance-pack/src/test/java/org/apache/servicecomb/saga/PackStepdefs.java
+++ b/acceptance-tests/acceptance-pack/src/test/java/org/apache/servicecomb/saga/PackStepdefs.java
@@ -65,12 +65,7 @@ public class PackStepdefs implements En {
});
And("^Alpha is up and running$", () -> {
- String infoURI = System.getProperty(INFO_SERVICE_URI);
- if (isEmpty(infoURI)) {
- infoURI = "/info";
- }
- log.info("The service uri is " + infoURI);
- probe(System.getProperty(ALPHA_REST_ADDRESS), infoURI);
+ probe(System.getProperty(ALPHA_REST_ADDRESS));
});
Given("^Install the byteman script ([A-Za-z0-9_\\.]+) to ([A-Za-z]+) Service$", (String script, String service) -> {
@@ -166,7 +161,12 @@ public class PackStepdefs implements En {
}
private void probe(String address) {
- probe(address, "/info");
+ String infoURI = System.getProperty(INFO_SERVICE_URI);
+ if (isEmpty(infoURI)) {
+ infoURI = "/info";
+ }
+ log.info("The info service uri is " + infoURI);
+ probe(address, infoURI);
}
private void probe(String address, String infoURI) {
diff --git a/saga-demo/booking/booking/src/main/resources/log4j2.xml b/saga-demo/booking/booking/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..cae04cb
--- /dev/null
+++ b/saga-demo/booking/booking/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<Configuration status="WARN">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <AsyncRoot level="info">
+ <AppenderRef ref="Console"/>
+ </AsyncRoot>
+ </Loggers>
+</Configuration>
diff --git a/saga-demo/booking/car/src/main/resources/log4j2.xml b/saga-demo/booking/car/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..cae04cb
--- /dev/null
+++ b/saga-demo/booking/car/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<Configuration status="WARN">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <AsyncRoot level="info">
+ <AppenderRef ref="Console"/>
+ </AsyncRoot>
+ </Loggers>
+</Configuration>
diff --git a/saga-demo/booking/hotel/src/main/resources/log4j2.xml b/saga-demo/booking/hotel/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..cae04cb
--- /dev/null
+++ b/saga-demo/booking/hotel/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<Configuration status="WARN">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <AsyncRoot level="info">
+ <AppenderRef ref="Console"/>
+ </AsyncRoot>
+ </Loggers>
+</Configuration>
diff --git a/saga-demo/pom.xml b/saga-demo/pom.xml
index 804f536..7b0e734 100644
--- a/saga-demo/pom.xml
+++ b/saga-demo/pom.xml
@@ -111,4 +111,26 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>spring-boot-2</id>
+ <properties>
+ <spring.boot.version>2.0.0.RELEASE</spring.boot.version>
+ </properties>
+ <!-- Need to add the dependency of log4j2 core -->
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>2.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.lmax</groupId>
+ <artifactId>disruptor</artifactId>
+ <version>3.3.7</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
</project>
--
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.