Skip to content

Commit a051c70

Browse files
author
Brian Hawkins
committed
Upated jooby and stork launcher, Fixed issue with logback.xml not getting picked up
1 parent 3d3b84a commit a051c70

File tree

7 files changed

+75
-13
lines changed

7 files changed

+75
-13
lines changed

conf/application.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Application configuration file. See https://github.com/typesafehub/config/blob/master/HOCON.md for more details
22
HOSTNAME = "bh-laptop"
33

4-
topic_monitor.bootstrap_servers = "home-linux:9092"
5-
#topic_monitor.bootstrap_servers = "localhost:9092"
4+
#topic_monitor.bootstrap_servers = "home-linux:9092"
5+
topic_monitor.bootstrap_servers = "localhost:9092"
66

77
topic_monitor.application_id = "kafka_monitor"
88

conf/metrics4j.conf

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ metrics4j {
3232
sinks {
3333
kairos-telnet: {
3434
_class: "org.kairosdb.metrics4j.sinks.TelnetSink"
35-
host: "kairos-server"
35+
host: "localhost"
3636
port: 4242
3737
resolution: "MILLISECONDS"
3838
}
@@ -44,12 +44,16 @@ metrics4j {
4444
sources {
4545

4646
_collector: ["counter", "lastTime"]
47-
_formatter: "template"
4847
_sink: "kairos-telnet"
4948

49+
java {
50+
//jmx metrics are all under here if you want to turn them on.
51+
_disabled: true
52+
}
5053
org {
5154
kairosdb {
5255
kafka {
56+
_formatter: "template"
5357
monitor {
5458
ConsumerStats {
5559
consumeCount {

deploy.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
mvn clean package; mv target/*.jar target/dependency/
1+
mvn clean package
2+
cd target
3+
tar -xf *.tar.gz
4+
25

pom.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<!-- Startup class -->
1616
<application.class>app.App</application.class>
1717

18-
<jooby.version>3.0.9</jooby.version>
18+
<jooby.version>3.1.3</jooby.version>
1919

2020
<maven.compiler.source>17</maven.compiler.source>
2121
<maven.compiler.target>17</maven.compiler.target>
@@ -33,7 +33,7 @@
3333
<dependency>
3434
<groupId>ch.qos.logback</groupId>
3535
<artifactId>logback-classic</artifactId>
36-
<version>1.5.3</version>
36+
<version>1.5.6</version>
3737
</dependency>
3838

3939
<dependency>
@@ -149,7 +149,7 @@
149149
<plugin>
150150
<groupId>com.fizzed</groupId>
151151
<artifactId>stork-maven-plugin</artifactId>
152-
<version>3.0.0</version>
152+
<version>3.1.3</version>
153153
<executions>
154154
<execution>
155155
<id>stork-launcher</id>
@@ -162,7 +162,7 @@
162162
<plugin>
163163
<groupId>com.fizzed</groupId>
164164
<artifactId>stork-maven-plugin</artifactId>
165-
<version>3.0.0</version>
165+
<version>3.1.3</version>
166166
<!-- configuration / execution (see below) -->
167167
<executions>
168168
<execution>

src/main/java/app/App.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public App()
3434
Properties props = new Properties();
3535
props.setProperty("org.quartz.threadPool.threadCount", "4");
3636
MetricsContext metricsContext = MetricSourceManager.getMetricConfig().getContext();
37+
//install(new NullServer());
3738

3839

3940
try
@@ -43,9 +44,9 @@ public App()
4344
m_scheduler.setJobFactory(this);
4445

4546
install(new KTMGuiceModule(new KafkaModule()));
46-
get("/", ctx -> "Welcome to Jooby!");
47+
//get("/", ctx -> "Welcome to Jooby!");
4748

48-
onStarting(() ->
49+
onStarted(() ->
4950
{
5051
metricsContext.registerTrigger("kafka-monitor-trigger", require(MetricsTrigger.class));
5152
metricsContext.addTriggerToPath("kafka-monitor-trigger", Collections.EMPTY_LIST);

src/main/java/app/NullServer.java

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package app;
2+
3+
4+
import edu.umd.cs.findbugs.annotations.NonNull;
5+
import io.jooby.Jooby;
6+
import io.jooby.Server;
7+
import io.jooby.ServerOptions;
8+
9+
import java.util.ArrayList;
10+
import java.util.Collections;
11+
import java.util.List;
12+
13+
public class NullServer extends Server.Base
14+
{
15+
private List<Jooby> m_applications = new ArrayList<>();
16+
17+
@NonNull
18+
@Override
19+
public Server setOptions(@NonNull ServerOptions options)
20+
{
21+
return this;
22+
}
23+
24+
@NonNull
25+
@Override
26+
public String getName()
27+
{
28+
return "NullServer";
29+
}
30+
31+
@NonNull
32+
@Override
33+
public ServerOptions getOptions()
34+
{
35+
return new ServerOptions();
36+
}
37+
38+
@NonNull
39+
@Override
40+
public Server start(@NonNull Jooby application)
41+
{
42+
m_applications.add(application);
43+
fireReady(m_applications);
44+
return this;
45+
}
46+
47+
@NonNull
48+
@Override
49+
public Server stop()
50+
{
51+
fireStop(m_applications);
52+
return this;
53+
}
54+
}

src/main/launchers/stork.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ working_dir_mode: APP_HOME
3838
# Users can either entirely override it at runtime with the environment variable
3939
# JAVA_ARGS or append extra arguments with the EXTRA_JAVA_ARGS enviornment variable
4040
# or by passing them in on the command-line too.
41-
java_args: "-DMETRICS4J_CONFIG=conf/metrics4j.conf"
41+
java_args: "-DMETRICS4J_CONFIG=conf/metrics4j.conf -Dlogback.configurationFile=conf/logback.xml"
4242

4343
# Minimum version of java required (system will be searched for acceptable jvm)
4444
# Defaults to Java 1.6.
45-
min_java_version: "1.8"
45+
min_java_version: "17"
4646

4747
# Maximum version of java required (system will be searched for acceptable jvm)
4848
# Defaults to empty (all)

0 commit comments

Comments
 (0)