Skip to content

Commit 38e1141

Browse files
authored
Merge pull request #28 from Pinit-Scheduler/feat/RabbitMQ-큐-정의
Feat/rabbit mq 큐 정의
2 parents 6ada373 + 174bef3 commit 38e1141

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package me.gg.pinit.pinittask.infrastructure.events.schedule;
2+
3+
import org.springframework.amqp.core.DirectExchange;
4+
import org.springframework.amqp.core.ExchangeBuilder;
5+
import org.springframework.context.annotation.Bean;
6+
import org.springframework.context.annotation.Configuration;
7+
8+
/**
9+
* Declares the schedule event exchange so event publishing succeeds even on a fresh broker.
10+
*/
11+
@Configuration
12+
public class ScheduleRabbitMQConfig {
13+
14+
@Bean
15+
public DirectExchange scheduleDirectExchange() {
16+
return ExchangeBuilder.directExchange(ScheduleMessaging.DIRECT_EXCHANGE)
17+
.durable(true)
18+
.build();
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package me.gg.pinit.pinittask.infrastructure.events.task;
2+
3+
import org.springframework.amqp.core.DirectExchange;
4+
import org.springframework.amqp.core.ExchangeBuilder;
5+
import org.springframework.context.annotation.Bean;
6+
import org.springframework.context.annotation.Configuration;
7+
8+
/**
9+
* Declares the task event exchange so publishers don't fail when the broker is empty.
10+
*/
11+
@Configuration
12+
public class TaskRabbitMQConfig {
13+
14+
@Bean
15+
public DirectExchange taskDirectExchange() {
16+
return ExchangeBuilder.directExchange(TaskMessaging.DIRECT_EXCHANGE)
17+
.durable(true)
18+
.build();
19+
}
20+
}

0 commit comments

Comments
 (0)