Skip to content

Commit

Permalink
update ch12
Browse files Browse the repository at this point in the history
  • Loading branch information
IISI-1204003 committed May 2, 2022
1 parent c09b9fb commit 262cbd1
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/.idea/
**/target/
**/.gradle/
**/.gradle/
**/grafana.db
10 changes: 6 additions & 4 deletions chapter-11/udf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ dependencies {
implementation 'io.confluent.ksql:ksqldb-udf:6.0.6'

// Use JUnit Jupiter API for testing.
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'

// Use JUnit Jupiter Engine for testing.
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'

}

// code formatting + error prone
tasks.withType(JavaCompile).configureEach { javaCompile ->
javaCompile.dependsOn 'googleJavaFormat'
options.encoding = 'UTF-8'
javaCompile.dependsOn 'googleJavaFormat'
options.encoding = 'UTF-8'
}

test {
Expand Down
1 change: 1 addition & 0 deletions chapter-12/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./grafna/*
4 changes: 2 additions & 2 deletions chapter-12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ cd ksqldb-tests/
$ docker run \
-v "$(pwd)":/ksqldb/ \
-w /ksqldb \
-ti confluentinc/ksqldb-server:0.14.0 \
-ti confluentinc/ksqldb-server:0.25.1 \
ksql-test-runner -s statements.sql -i input.json -o output.json

# look for "Test passed!" in the output
Expand Down Expand Up @@ -58,7 +58,7 @@ $ docker run \
-Dcom.sun.management.jmxremote.rmi.port=1099 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false" \
-ti confluentinc/ksqldb-server:0.14.0 \
-ti confluentinc/ksqldb-server:0.25.1 \
ksql-server-start /ksqldb/config/server.properties
```

Expand Down
2 changes: 1 addition & 1 deletion chapter-12/app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
build/
bin/
.DS_Store
.vscode
.vscode
16 changes: 8 additions & 8 deletions chapter-12/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ plugins {
id 'com.github.sherter.google-java-format' version '0.9'

// used for containerizing the app
id 'com.google.cloud.tools.jib' version '2.1.0'
id 'com.google.cloud.tools.jib' version '3.2.1'

// for downloading a Prometheus JMX Exporter JAR that can run as a Java agent
id 'de.undercouch.download' version '4.1.1'
id 'de.undercouch.download' version '5.0.5'

// for benchmarking
id 'me.champeau.gradle.jmh' version '0.5.2'
id 'me.champeau.gradle.jmh' version '0.5.3'
}

ext {
kafkaVersion = '2.6.0'
opencensusVersion = '0.26.0'
kafkaVersion = '2.6.2'
opencensusVersion = '0.31.1'
simpleclientVersion = '0.6.0'
prometheusJmxExporterVersion='0.14.0'
prometheusJmxExporterVersion='0.16.1'
}

/**
Expand Down Expand Up @@ -82,7 +82,7 @@ dependencies {
implementation 'ch.qos.logback:logback-classic:1.2.11'

// configuration
implementation "com.typesafe:config:1.4.0"
implementation "com.typesafe:config:1.4.2"

// observability dependencies
implementation "io.prometheus.jmx:jmx_prometheus_httpserver:${prometheusJmxExporterVersion}"
Expand All @@ -92,7 +92,7 @@ dependencies {

// test dependencies
testImplementation "org.apache.kafka:kafka-streams-test-utils:${kafkaVersion}"
testImplementation 'org.assertj:assertj-core:3.15.0'
testImplementation 'org.assertj:assertj-core:3.22.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
public class MyTopology {
public Topology build() {
StreamsBuilder builder = new StreamsBuilder();
builder
.stream("events", Consumed.with(Serdes.String(), Serdes.ByteArray()))
builder.stream("events", Consumed.with(Serdes.String(), Serdes.ByteArray()))
.selectKey(MyTopology::decodeKey)
.to("events-repartitioned");
return builder.build();
Expand Down
4 changes: 3 additions & 1 deletion chapter-12/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: '3'
version: '3.8'

services:
zookeeper:
Expand Down Expand Up @@ -34,6 +34,7 @@ services:

kafka-create-topics:
image: confluentinc/cp-enterprise-kafka:6.0.6
container_name: kafka-create-topics
depends_on:
- kafka
hostname: kafka-create-topics
Expand All @@ -60,6 +61,7 @@ services:
- "3000:3000"
# mounting the grafana directory ensures any dashboard changes we make
# will persist between container restarts
# sudo chown -R 472:472 ./grafana
volumes:
- ./grafana:/var/lib/grafana

Expand Down

0 comments on commit 262cbd1

Please sign in to comment.