-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:a-dubaj/AsynchronousMessaging
- Loading branch information
Showing
3 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 36 additions & 1 deletion
37
src/main/java/com/andrzejdubaj/rabbitmqdemoapp/RabbitMqExchangeConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,51 @@ | ||
package com.andrzejdubaj.rabbitmqdemoapp; | ||
|
||
import org.springframework.amqp.core.Exchange; | ||
import org.springframework.amqp.core.ExchangeBuilder; | ||
import org.springframework.amqp.core.TopicExchange; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
|
||
@Configuration | ||
public class RabbitMqExchangeConfiguration { | ||
|
||
@Bean | ||
Exchange exampleExchange() { | ||
return new TopicExchange("ExampleExchange"); | ||
} | ||
|
||
@Bean | ||
Exchange example2exchange() { | ||
return ExchangeBuilder.directExchange("Example2exchange") | ||
.autoDelete() | ||
.internal() | ||
.build(); | ||
} | ||
|
||
@Bean | ||
Exchange newExchange() { | ||
return ExchangeBuilder.topicExchange("TopicTestExchange") | ||
.autoDelete() | ||
.durable(true) | ||
.internal() | ||
.build(); | ||
} | ||
|
||
@Bean | ||
Exchange fanoutExchange(){ | ||
return ExchangeBuilder.fanoutExchange("FanoutTestExchange") | ||
.autoDelete() | ||
.durable(false) | ||
.internal() | ||
.build(); | ||
} | ||
|
||
@Bean | ||
Exchange headersExchange(){ | ||
return ExchangeBuilder.headersExchange("HeadersTestExchange") | ||
.internal() | ||
.durable(true) | ||
.ignoreDeclarationExceptions() | ||
.build(); | ||
} | ||
} |