Skip to content

Commit

Permalink
fixes #2113 split the ServerInfoConfig to a info-config module (#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehu authored Feb 11, 2024
1 parent 5527805 commit f8b4af3
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 1 deletion.
2 changes: 1 addition & 1 deletion health-config/src/main/resources/config/health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ useJson: ${health.useJson:false}
timeout: ${health.timeout:2000}

# For some of the services like light-proxy, http-sidecar and kafka-sidecar, we might need to check the down
# stream API before return the health status to the invoker. By default it is not enabled.
# stream API before return the health status to the invoker. By default, it is not enabled.

# if the health check needs to invoke down streams API. It is false by default.
downstreamEnabled: ${health.downstreamEnabled:false}
Expand Down
58 changes: 58 additions & 0 deletions info-config/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!--
~ Copyright (c) 2016 Network New Technologies Inc.
~
~ Licensed 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.
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.networknt</groupId>
<artifactId>light-4j</artifactId>
<version>2.1.32-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>info-config</artifactId>
<packaging>jar</packaging>
<description>A server info configuration module shared with light-aws-lambda</description>

<dependencies>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>utility</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
12 changes: 12 additions & 0 deletions info-config/src/main/java/module-info.j
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module com.networknt.info {
exports com.networknt.info;

requires com.networknt.config;
requires com.networknt.handler;
requires com.networknt.security;
requires com.networknt.status;
requires com.networknt.utility;

requires undertow.core;
requires org.slf4j;
}
File renamed without changes.
49 changes: 49 additions & 0 deletions info-config/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2016 Network New Technologies Inc.
~
~ Licensed 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>
<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Marker>PROFILER</Marker>
<!--<OnMatch>DENY</OnMatch>-->
<OnMatch>NEUTRAL</OnMatch>
</turboFilter>

<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5marker %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<appender name="log" class="ch.qos.logback.core.FileAppender">
<File>target/test.log</File>
<Append>false</Append>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %class{36}:%L %M - %msg%n</Pattern>
</layout>
</appender>

<root level="trace">
<appender-ref ref="stdout"/>
</root>

<logger name="com.networknt" level="trace">
<appender-ref ref="log"/>
</logger>

</configuration>
4 changes: 4 additions & 0 deletions info/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
<groupId>com.networknt</groupId>
<artifactId>handler</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>info-config</artifactId>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<module>audit</module>
<module>audit-config</module>
<module>dump</module>
<module>info-config</module>
<module>info</module>
<module>health-config</module>
<module>health</module>
Expand Down Expand Up @@ -247,6 +248,11 @@
<artifactId>dump</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>info-config</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>info</artifactId>
Expand Down

0 comments on commit f8b4af3

Please sign in to comment.