mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-08-22 19:28:34 +00:00
fix: Rabbitmq deployment
This commit is contained in:
parent
9f9707ddf1
commit
269ffc7587
@ -17,8 +17,8 @@
|
|||||||
"RedisHostName": "redis",
|
"RedisHostName": "redis",
|
||||||
"RabbitMQ": {
|
"RabbitMQ": {
|
||||||
"Host": "rabbitmq",
|
"Host": "rabbitmq",
|
||||||
"Username": "guest",
|
"Username": "admin",
|
||||||
"Password": "guest",
|
"Password": "DOIA9234JF",
|
||||||
"Enabled": "True"
|
"Enabled": "True"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ public sealed class FanoutEventHandler : IFanoutEventHandler
|
|||||||
RabbitMqHandler rabbitMqHandler)
|
RabbitMqHandler rabbitMqHandler)
|
||||||
{
|
{
|
||||||
_rabbitMqHandler = rabbitMqHandler;
|
_rabbitMqHandler = rabbitMqHandler;
|
||||||
|
_rabbitMqHandler.InitializeExchange(Messaging.ExchangeNameNotifications);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<DomainEvent> HandleDomainEventAsync(DomainEvent @event)
|
public Task<DomainEvent> HandleDomainEventAsync(DomainEvent @event)
|
||||||
|
@ -65,7 +65,8 @@ Running the container
|
|||||||
|
|
||||||
1. Change the ConnectionString in the appsettings.json to `Server=clean-architecture-db-service;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#`
|
1. Change the ConnectionString in the appsettings.json to `Server=clean-architecture-db-service;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#`
|
||||||
2. Change the RedisHostName in the appsettings.json to `redis-service`
|
2. Change the RedisHostName in the appsettings.json to `redis-service`
|
||||||
3. Build the docker image and push it to the docker hub (Change the image name in the `k8s-deployment.yml` to your own)
|
3. Change the RabbitMQ Host in the appsettings.json to `rabbitmq-service`
|
||||||
|
4. Build the docker image and push it to the docker hub (Change the image name in the `k8s-deployment.yml` to your own)
|
||||||
Apply the deployment file: `kubectl apply -f k8s-deployment.yml` (Delete: `kubectl delete -f k8s-deployment.yml`)
|
Apply the deployment file: `kubectl apply -f k8s-deployment.yml` (Delete: `kubectl delete -f k8s-deployment.yml`)
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,10 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
db:
|
||||||
|
condition: service_started
|
||||||
|
rabbitmq:
|
||||||
|
condition: service_healthy
|
||||||
links:
|
links:
|
||||||
- db
|
- db
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@ -38,13 +41,18 @@ services:
|
|||||||
rabbitmq:
|
rabbitmq:
|
||||||
image: "rabbitmq:3-management"
|
image: "rabbitmq:3-management"
|
||||||
ports:
|
ports:
|
||||||
- "5672:5672"
|
- 5672:5672
|
||||||
- "15672:15672"
|
- 15672:15672
|
||||||
environment:
|
environment:
|
||||||
- RABBITMQ_DEFAULT_USER=guest
|
- RABBITMQ_DEFAULT_USER=admin
|
||||||
- RABBITMQ_DEFAULT_PASS=guest
|
- RABBITMQ_DEFAULT_PASS=DOIA9234JF
|
||||||
volumes:
|
volumes:
|
||||||
- rabbitmq_data:/var/lib/rabbitmq
|
- rabbitmq_data:/var/lib/rabbitmq
|
||||||
|
healthcheck:
|
||||||
|
test: rabbitmq-diagnostics -q ping
|
||||||
|
interval: 10s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
rabbitmq_data:
|
rabbitmq_data:
|
||||||
|
@ -142,9 +142,9 @@ spec:
|
|||||||
- containerPort: 15672
|
- containerPort: 15672
|
||||||
env:
|
env:
|
||||||
- name: RABBITMQ_DEFAULT_USER
|
- name: RABBITMQ_DEFAULT_USER
|
||||||
value: guest
|
value: admin
|
||||||
- name: RABBITMQ_DEFAULT_PASS
|
- name: RABBITMQ_DEFAULT_PASS
|
||||||
value: guest
|
value: DOIA9234JF
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: rabbitmq-data
|
- name: rabbitmq-data
|
||||||
mountPath: /var/lib/rabbitmq
|
mountPath: /var/lib/rabbitmq
|
||||||
@ -161,9 +161,11 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
app: rabbitmq
|
app: rabbitmq
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- name: rabbitmq-port
|
||||||
|
protocol: TCP
|
||||||
port: 5672
|
port: 5672
|
||||||
targetPort: 5672
|
targetPort: 5672
|
||||||
- protocol: TCP
|
- name: rabbitmq-management-port
|
||||||
|
protocol: TCP
|
||||||
port: 15672
|
port: 15672
|
||||||
targetPort: 15672
|
targetPort: 15672
|
||||||
|
Loading…
Reference in New Issue
Block a user