Skip to content

Instantly share code, notes, and snippets.

@timpamungkasudemy
Created September 9, 2019 09:51
Show Gist options
  • Save timpamungkasudemy/e98f884d3d6de447c3c0c7266977f108 to your computer and use it in GitHub Desktop.
Save timpamungkasudemy/e98f884d3d6de447c3c0c7266977f108 to your computer and use it in GitHub Desktop.
Create Fanout Exchange using single method that return `Declarables`
// Create Fanout Exchange using single method that return `Declarables`
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.Binding.DestinationType;
import org.springframework.amqp.core.Declarables;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class RabbitmqSchemaConfig_Two {
@Bean
public Declarables createRabbitmqSchema() {
return new Declarables(
new FanoutExchange("x.another-dummy", true, false),
new Queue("q.another-dummy"),
new Binding("q.another-dummy", DestinationType.QUEUE, "x.another-dummy", "", null)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment