Skip to content

Commit c5683db

Browse files
authored
Merge pull request #95 from robberphex/fix-demo
use dragonwell
2 parents 9e9a55c + ccf157e commit c5683db

File tree

5 files changed

+71
-36
lines changed

5 files changed

+71
-36
lines changed

mse-simple-demo/A/Dockerfile

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,39 @@
1-
FROM eclipse-temurin:8-jdk-alpine
1+
# syntax=docker/dockerfile:1.3-labs
2+
3+
FROM maven:3-eclipse-temurin-8-alpine
24

35
# copy arthas
46
COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas
57

68
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
79
RUN apk add wget unzip tcpdump ngrep iproute2-ss bind-tools
810

11+
COPY <<EOF /root/.m2/settings.xml
12+
<?xml version=\"1.0\"?>
13+
<settings>
14+
<mirrors>
15+
<mirror>
16+
<id>alimaven</id>
17+
<name>aliyun maven</name>
18+
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
19+
<mirrorOf>central</mirrorOf>
20+
</mirror>
21+
<mirror>
22+
<id>maven-default-http-blocker</id>
23+
<mirrorOf>!*</mirrorOf>
24+
<url>http://0.0.0.0/</url>
25+
</mirror>
26+
</mirrors>
27+
</settings>
28+
EOF
29+
930
WORKDIR /app
10-
COPY /target/A-1.0.0.jar /app
31+
32+
COPY ./ ./
33+
34+
RUN --mount=type=cache,target=/root/.m2/repository/ \
35+
mvn clean package
1136

1237
EXPOSE 20001
1338
ENTRYPOINT ["sh", "-c"]
14-
CMD ["java -jar /app/A-1.0.0.jar"]
39+
CMD ["java -jar /app/target/A-1.0.0.jar"]

mse-simple-demo/A/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>org.projectlombok</groupId>
4141
<artifactId>lombok</artifactId>
42-
<version>1.18.12</version>
42+
<version>1.18.24</version>
4343
</dependency>
4444

4545
<!-- MQ -->

mse-simple-demo/C/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
FROM eclipse-temurin:8-jdk-alpine
1+
FROM dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-extended-ga-centos
22

33
# copy arthas
44
COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas
55

6-
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
7-
RUN apk add wget unzip tcpdump ngrep iproute2-ss bind-tools
8-
96
WORKDIR /app
107
COPY /target/C-1.0.0.jar /app
118

mse-simple-demo/C/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>org.projectlombok</groupId>
4242
<artifactId>lombok</artifactId>
43-
<version>1.18.12</version>
43+
<version>1.18.24</version>
4444
</dependency>
4545

4646
<!-- MQ -->

mse-simple-demo/gateway/src/main/resources/templates/index.html

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,54 @@
1515
<div id="resultSection" style="margin-top: 30px; border-top: 1px solid #eaeaea;">
1616
</div>
1717
</div>
18-
<script charset="utf-8" >
18+
<script charset="utf-8">
19+
let isRequesting = true;
20+
21+
window.addEventListener("keydown", (event) => {
22+
if (event.key === 'Escape') {
23+
isRequesting = false;
24+
}
25+
});
26+
1927
$('#btnStart').click(() => {
20-
const url = $('#inputArea').val();
21-
$('#resultSection').empty();
22-
fetchVal(url);
28+
const url = $('#inputArea').val();
29+
$('#resultSection').empty();
30+
isRequesting = true;
31+
fetchVal(url);
2332
});
2433

2534
const getDateTime = () => {
26-
const myDate = new Date;
27-
const year = myDate.getFullYear(); //获取当前年
28-
const month = myDate.getMonth() + 1; //获取当前月
29-
const date = myDate.getDate(); //获取当前日
30-
const hours = myDate.getHours();
31-
const minutes = myDate.getMinutes();
32-
const seconds = myDate.getSeconds();
33-
return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`;
35+
const myDate = new Date;
36+
const year = myDate.getFullYear(); //获取当前年
37+
const month = myDate.getMonth() + 1; //获取当前月
38+
const date = myDate.getDate(); //获取当前日
39+
const hours = myDate.getHours();
40+
const minutes = myDate.getMinutes();
41+
const seconds = myDate.getSeconds();
42+
return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`;
3443
};
3544

3645
const fetchVal = (url) => {
37-
$.ajax(url, {
46+
$.ajax(url, {
3847

39-
success: (data) => {
40-
$('#resultSection').append(`<p>${getDateTime()} 返回 ${data}</p>`);
41-
setTimeout(() => {
42-
fetchVal(url);
43-
}, 500);
44-
},
45-
error: (errorThrown) => {
46-
$('#resultSection').append(`<p>${getDateTime()} 返回 ${errorThrown.responseText}</p>`);
47-
setTimeout(() => {
48-
fetchVal(url);
49-
}, 500);
50-
},
51-
});
48+
success: (data) => {
49+
$('#resultSection').append(`<pre>${getDateTime()} 返回 ${data}</pre>`);
50+
if (isRequesting) {
51+
setTimeout(() => {
52+
fetchVal(url);
53+
}, 500);
54+
}
55+
},
56+
error: (errorThrown) => {
57+
$('#resultSection').append(`<pre>${getDateTime()} 返回 ${errorThrown.responseText}</pre>`);
58+
if (isRequesting) {
59+
setTimeout(() => {
60+
fetchVal(url);
61+
}, 500);
62+
}
63+
},
64+
});
5265
};
53-
</script>
66+
</script>
5467
</body>
5568
</html>

0 commit comments

Comments
 (0)