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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ Alternatively you can provide a custom path to the properties file using `-Dprop
If your Kafka is secured you will need to enable the security configuration options in your properties file.

To increase the logging level to debug provide a system property at start time: `-Dlog.level=debug`.

To increase the Kafka client logging level to info provide a system property at start time: `-Dlog.level.kafka=info`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come this line states the Kafka client but the previous line doesn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log.level is a general level for the whole app, the log.level.kafka just changes the kafka client level

1 change: 0 additions & 1 deletion kafka.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ bootstrap.servers=localhost:9092
###################################################################
group.id=my_group
auto.offset.reset=earliest
enable.auto.commit=false
key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
value.deserializer=org.apache.kafka.common.serialization.StringDeserializer

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/kafka/vertx/demo/WebSocketServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.vertx.ext.web.handler.StaticHandler;
import io.vertx.kafka.client.common.TopicPartition;
import io.vertx.kafka.client.consumer.KafkaConsumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -44,6 +45,8 @@ public void start(Promise<Void> startPromise) {
String propertiesPath = System.getProperty(Main.PROPERTIES_PATH_ENV_NAME, Main.DEFAULT_PROPERTIES_PATH);
Main.loadKafkaConfig(vertx, propertiesPath)
.compose(config -> {
// Auto commit as this is a demo app
config.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, true);
kafkaConfig = config.mapTo(HashMap.class);
return startWebSocket(router);
})
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<logger name="io.netty" level="warn"/>
<logger name="io.vertx" level="info"/>
<logger name="org.apache.kafka" level="error"/>
<logger name="org.apache.kafka" level="${log.level.kafka:-error}"/>
<logger name="org.apache.kafka.clients.NetworkClient" level="warn"/>

<root level="${log.level:-info}">
Expand Down