Skip to content

Commit

Permalink
feat($Starter): integrate RabbitMQ
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
johnnymillergh committed Mar 9, 2021
1 parent 414880d commit 9022f77
Show file tree
Hide file tree
Showing 35 changed files with 174 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ spring:
redis:
host: maf.redis.development-docker
port: 6379
password: 123456
password: maf@redis
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ spring:
redis:
host: localhost
port: 6379
password: 123456
password: maf@redis
2 changes: 1 addition & 1 deletion api-gateway/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ spring:
redis:
host: maf.redis.production
port: 6379
password: 123456
password: maf@redis
2 changes: 1 addition & 1 deletion api-gateway/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ spring:
redis:
host: maf.redis.stage
port: 6379
password: 123456
password: maf@redis
2 changes: 1 addition & 1 deletion api-gateway/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ spring:
redis:
host: maf.redis.test
port: 6379
password: 123456
password: maf@redis
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.development-docker
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.development-docker
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: localhost
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: localhost
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

logging:
# Configure logging level for SFTP/JSCH
Expand Down
7 changes: 6 additions & 1 deletion auth-center/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.production
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.production
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
7 changes: 6 additions & 1 deletion auth-center/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.stage
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.stage
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
7 changes: 6 additions & 1 deletion auth-center/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.test
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.test
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
2 changes: 1 addition & 1 deletion auth-center/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ spring:
url-pattern: /druid/*
reset-enable: false
login-username: root
login-password: 123456
login-password: maf_druid_password
allow:
redis:
database: 0
Expand Down
2 changes: 2 additions & 0 deletions docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ MAF_MYSQL_USER=maf_mysql_rw
MAF_MYSQL_PASSWORD=maf@mysql
MAF_ELASTICSEARCH_PASSWORD=maf@elasticsearch
MAF_TIMEZONE=Asia/Hong_Kong
MAF_RABBITMQ_USER=maf_rabbitmq_su
MAF_RABBITMQ_PASSWORD=maf@rabbitmq
2 changes: 1 addition & 1 deletion docker/config/redis/redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ acllog-max-len 128
# AUTH <password> as usually, or more explicitly with AUTH default <password>
# if they follow the new protocol: both will work.
#
requirepass 123456
requirepass maf@redis

# Command renaming (DEPRECATED).
#
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ services:
- ./plugin/rabbitmq/rabbitmq_delayed_message_exchange-3.8.9-0199d11c.ez:/plugins/rabbitmq_delayed_message_exchange-3.8.9-0199d11c.ez
- ./plugin/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins
environment:
RABBITMQ_DEFAULT_USER: rabbitmq_su
RABBITMQ_DEFAULT_PASS: rabbitmq_password
RABBITMQ_DEFAULT_USER: ${MAF_RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${MAF_RABBITMQ_PASSWORD}
networks:
muscle_and_fitness_network:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.development-docker
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.development-docker
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: localhost
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: localhost
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
7 changes: 6 additions & 1 deletion exercise-mis/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.production
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.production
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
7 changes: 6 additions & 1 deletion exercise-mis/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.stage
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.stage
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
7 changes: 6 additions & 1 deletion exercise-mis/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.test
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.test
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
2 changes: 1 addition & 1 deletion exercise-mis/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ spring:
url-pattern: /druid/*
reset-enable: false
login-username: root
login-password: 123456
login-password: maf_druid_password
allow:
redis:
database: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.development-docker
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.development-docker
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: localhost
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: localhost
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

logging:
level:
Expand Down
7 changes: 6 additions & 1 deletion muscle-mis/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.production
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.production
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
7 changes: 6 additions & 1 deletion muscle-mis/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.stage
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.stage
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
7 changes: 6 additions & 1 deletion muscle-mis/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.test
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.test
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

sftp:
client:
Expand Down
2 changes: 1 addition & 1 deletion muscle-mis/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spring:
url-pattern: /druid/*
reset-enable: false
login-username: root
login-password: 123456
login-password: maf_druid_password
allow:
redis:
database: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.development-docker
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.development-docker
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

maf:
configuration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: localhost
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: localhost
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

maf:
configuration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.production
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.production
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

maf:
configuration:
Expand Down
7 changes: 6 additions & 1 deletion spring-boot-admin/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.stage
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.stage
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

maf:
configuration:
Expand Down
7 changes: 6 additions & 1 deletion spring-boot-admin/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ spring:
redis:
host: maf.redis.test
port: 6379
password: 123456
password: maf@redis
rabbitmq:
host: maf.rabbitmq.test
port: 5672
username: maf_rabbitmq_su
password: maf@rabbitmq

maf:
configuration:
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spring:
url-pattern: /druid/*
reset-enable: false
login-username: root
login-password: 123456
login-password: maf_druid_password
allow:
redis:
database: 0
Expand Down
9 changes: 9 additions & 0 deletions spring-cloud-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
SftpConfiguration.class,
WebSecurityConfiguration.class,
RestTemplateConfiguration.class,
AsyncConfiguration.class
AsyncConfiguration.class,
RabbitmqConfiguration.class
})
public class MafAutoConfiguration {
@PostConstruct
Expand Down
Loading

0 comments on commit 9022f77

Please sign in to comment.