Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mateuszmrozewski
Created September 27, 2016 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mateuszmrozewski/d6cf6fca0b11502529c23beb43420e0a to your computer and use it in GitHub Desktop.
Save mateuszmrozewski/d6cf6fca0b11502529c23beb43420e0a to your computer and use it in GitHub Desktop.
@Bean
public List<Declarable> queueDeclarations()
{
boolean durable = true;
boolean autoDelete = false;
boolean exclusive = false;
Map<String, Object> args = new HashMap<>();
args.put("x-dead-letter-exchange", "dl.exchange");
args.put("x-dead-letter-queue", "dl.queue");
return Arrays.asList(
new FanoutExchange("dl.exchange", durable, autoDelete),
new DirectExchange("my.exchange", durable, autoDelete),
new Queue("my.queue", durable, exclusive, autoDelete, args),
new Queue("dl.queue", durable),
new Binding("dl.queue", Binding.DestinationType.QUEUE, "dl.exchange", "dl.queue", null),
new Binding("my.queue", Binding.DestinationType.QUEUE, "my.exchange", "my.queue", null)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment