Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions mse-simple-demo/A/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
FROM eclipse-temurin:8-jdk-alpine
# syntax=docker/dockerfile:1.3-labs

FROM maven:3-eclipse-temurin-8-alpine

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

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

COPY <<EOF /root/.m2/settings.xml
<?xml version=\"1.0\"?>
<settings>
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>!*</mirrorOf>
<url>http://0.0.0.0/</url>
</mirror>
</mirrors>
</settings>
EOF

WORKDIR /app
COPY /target/A-1.0.0.jar /app

COPY ./ ./

RUN --mount=type=cache,target=/root/.m2/repository/ \
mvn clean package

EXPOSE 20001
ENTRYPOINT ["sh", "-c"]
CMD ["java -jar /app/A-1.0.0.jar"]
CMD ["java -jar /app/target/A-1.0.0.jar"]
2 changes: 1 addition & 1 deletion mse-simple-demo/A/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<version>1.18.24</version>
</dependency>

<!-- MQ -->
Expand Down
5 changes: 1 addition & 4 deletions mse-simple-demo/C/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
FROM eclipse-temurin:8-jdk-alpine
FROM dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-extended-ga-centos

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

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

WORKDIR /app
COPY /target/C-1.0.0.jar /app

Expand Down
2 changes: 1 addition & 1 deletion mse-simple-demo/C/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<version>1.18.24</version>
</dependency>

<!-- MQ -->
Expand Down
67 changes: 40 additions & 27 deletions mse-simple-demo/gateway/src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,54 @@
<div id="resultSection" style="margin-top: 30px; border-top: 1px solid #eaeaea;">
</div>
</div>
<script charset="utf-8" >
<script charset="utf-8">
let isRequesting = true;

window.addEventListener("keydown", (event) => {
if (event.key === 'Escape') {
isRequesting = false;
}
});

$('#btnStart').click(() => {
const url = $('#inputArea').val();
$('#resultSection').empty();
fetchVal(url);
const url = $('#inputArea').val();
$('#resultSection').empty();
isRequesting = true;
fetchVal(url);
});

const getDateTime = () => {
const myDate = new Date;
const year = myDate.getFullYear(); //获取当前年
const month = myDate.getMonth() + 1; //获取当前月
const date = myDate.getDate(); //获取当前日
const hours = myDate.getHours();
const minutes = myDate.getMinutes();
const seconds = myDate.getSeconds();
return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`;
const myDate = new Date;
const year = myDate.getFullYear(); //获取当前年
const month = myDate.getMonth() + 1; //获取当前月
const date = myDate.getDate(); //获取当前日
const hours = myDate.getHours();
const minutes = myDate.getMinutes();
const seconds = myDate.getSeconds();
return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`;
};

const fetchVal = (url) => {
$.ajax(url, {
$.ajax(url, {

success: (data) => {
$('#resultSection').append(`<p>${getDateTime()} 返回 ${data}</p>`);
setTimeout(() => {
fetchVal(url);
}, 500);
},
error: (errorThrown) => {
$('#resultSection').append(`<p>${getDateTime()} 返回 ${errorThrown.responseText}</p>`);
setTimeout(() => {
fetchVal(url);
}, 500);
},
});
success: (data) => {
$('#resultSection').append(`<pre>${getDateTime()} 返回 ${data}</pre>`);
if (isRequesting) {
setTimeout(() => {
fetchVal(url);
}, 500);
}
},
error: (errorThrown) => {
$('#resultSection').append(`<pre>${getDateTime()} 返回 ${errorThrown.responseText}</pre>`);
if (isRequesting) {
setTimeout(() => {
fetchVal(url);
}, 500);
}
},
});
};
</script>
</script>
</body>
</html>