File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
src/main/java/me/gg/pinit/pinittask/infrastructure/events Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments