Skip to content

Commit

Permalink
bugfix fix found 2 dataQueue bean when not config common.queue param (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsun28 authored Aug 25, 2023
1 parent 100d958 commit 5e12e34
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 10 deletions.
9 changes: 0 additions & 9 deletions collector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,6 @@
</activation>
<build>
<finalName>hertzbeat-collector</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>META-INF/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author tom
*/
@Configuration
@ConditionalOnProperty(prefix = "common.queue", name = "type", havingValue = "netty", matchIfMissing = true)
@ConditionalOnProperty(prefix = "common.queue", name = "type", havingValue = "netty")
@Slf4j
public class NettyDataQueue implements CommonDataQueue {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import java.util.HashMap;
import java.util.Map;
Expand All @@ -38,6 +39,7 @@
@Configuration
@ConditionalOnProperty(prefix = "common.queue", name = "type", havingValue = "memory", matchIfMissing = true)
@Slf4j
@Primary
public class InMemoryCommonDataQueue implements CommonDataQueue, DisposableBean {

private final LinkedBlockingQueue<Alert> alertDataQueue;
Expand Down
5 changes: 5 additions & 0 deletions script/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,8 @@ common:
servers: 127.0.0.1:9092
metrics-data-topic: async-metrics-data
alerts-data-topic: async-alerts-data

scheduler:
server:
enabled: true
port: 1158
15 changes: 15 additions & 0 deletions script/docker-compose/hertzbeat-mysql-iotdb/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,18 @@ warehouse:
host: 127.0.0.1
port: 6379
password: 123456

common:
queue:
# memory or kafka
type: memory
# properties when queue type is kafka
kafka:
servers: 127.0.0.1:9092
metrics-data-topic: async-metrics-data
alerts-data-topic: async-alerts-data

scheduler:
server:
enabled: true
port: 1158
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ services:
- ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml
ports:
- "1157:1157"
- "1158:1158"
networks:
- hertzbeat

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ services:
- ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml
ports:
- "1157:1157"
- "1158:1158"
networks:
- hertzbeat
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,18 @@ warehouse:
host: 127.0.0.1
port: 6379
password: 123456

common:
queue:
# memory or kafka
type: memory
# properties when queue type is kafka
kafka:
servers: 127.0.0.1:9092
metrics-data-topic: async-metrics-data
alerts-data-topic: async-alerts-data

scheduler:
server:
enabled: true
port: 1158
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ services:
- ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml
ports:
- "1157:1157"
- "1158:1158"
networks:
- hertzbeat
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,18 @@ warehouse:
host: 127.0.0.1
port: 6379
password: 123456

common:
queue:
# memory or kafka
type: memory
# properties when queue type is kafka
kafka:
servers: 127.0.0.1:9092
metrics-data-topic: async-metrics-data
alerts-data-topic: async-alerts-data

scheduler:
server:
enabled: true
port: 1158
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ services:
- ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml
ports:
- "1157:1157"
- "1158:1158"
networks:
- hertzbeat

0 comments on commit 5e12e34

Please sign in to comment.