-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
103 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...zoo/mqtt-test-kafka/src/main/resources/META-INF/nutz/org.nutz.boot.config.ConfigureLoader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.nutz.boot.config.impl.YamlConfigureLoader |
29 changes: 0 additions & 29 deletions
29
mqtt-zoo/mqtt-test-kafka/src/main/resources/application.properties
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
mqtt-zoo/mqtt-test-kafka/src/main/resources/application.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
nutz: | ||
application: | ||
name: test | ||
|
||
mqttwk: | ||
broker: | ||
kafka: | ||
# 是否启用kafka消息转发 | ||
broker-enabled: false | ||
bootstrap: | ||
# kafka地址 127.0.0.1:9092,127.0.0.1:9093 | ||
servers: 127.0.0.1:9092 | ||
# acks回令 如果必须等待回令,那么设置acks为all,否则,设置为-1,等待回令会有性能损耗 | ||
acks: -1 | ||
# 重试次数 | ||
retries: 3 | ||
batch: | ||
# 批量提交大小 | ||
size: 16384 | ||
linger: | ||
# 提交延迟等待时间(等待时间内可以追加提交) | ||
ms: 1 | ||
buffer: | ||
# 缓存大小 | ||
memory: 33554432 | ||
key: | ||
# 序列化方式 | ||
serializer: org.apache.kafka.common.serialization.StringSerializer | ||
value: | ||
# 序列化方式 | ||
serializer: org.apache.kafka.common.serialization.StringSerializer | ||
partitioner: | ||
class: cn.wizzer.iot.mqtt.server.store.kafka.SimplePartitioner | ||
producer: | ||
# kafka转发的主题 | ||
topic: mqtt_publish | ||
consumer: | ||
topic: mqtt_subscribe | ||
group: | ||
id: mqttwk |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<configuration scan="false" scanPeriod="60000" debug="false"> | ||
|
||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<layout class="ch.qos.logback.classic.PatternLayout"> | ||
<pattern>%highlight(%date{yyyy-MM-dd HH:mm:ss.SSS}) %cyan([%thread]) %yellow(%-5level) %green(%logger{36}).%gray(%M)-%boldMagenta(%line) - %blue(%msg%n)</pattern> | ||
</layout> | ||
</appender> | ||
|
||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
<!-- rollover daily --> | ||
<fileNamePattern>logs/test-%d{yyyy-MM-dd}.%i.txt</fileNamePattern> | ||
<!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB --> | ||
<maxFileSize>50MB</maxFileSize> | ||
<maxHistory>30</maxHistory> | ||
<totalSizeCap>1GB</totalSizeCap> | ||
</rollingPolicy> | ||
<encoder> | ||
<pattern>[%-5level] %d{HH:mm:ss.SSS} %logger - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
|
||
<!-- 异步输出 --> | ||
<appender name ="ASYNC" class= "ch.qos.logback.classic.AsyncAppender"> | ||
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> | ||
<discardingThreshold>0</discardingThreshold> | ||
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> | ||
<queueSize>256</queueSize> | ||
<!-- 添加附加的appender,最多只能添加一个 --> | ||
<appender-ref ref ="FILE"/> | ||
</appender> | ||
|
||
<logger name="java" additivity="false" /> | ||
<logger name="org.eclipse.jetty" level="INFO"> | ||
<appender-ref ref="STDOUT" /> | ||
</logger> | ||
<root level="DEBUG"> | ||
<appender-ref ref="STDOUT" /> | ||
<appender-ref ref="ASYNC" /> | ||
</root> | ||
|
||
</configuration> |