Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active May 7, 2017 17: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 garystafford/aa3db2abcd1ca02f7a927c8f7bb0bfd8 to your computer and use it in GitHub Desktop.
Save garystafford/aa3db2abcd1ca02f7a927c8f7bb0bfd8 to your computer and use it in GitHub Desktop.
package com.voterapi.candidate.configuration;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CandidateConfig {
@Bean
public Queue queue() {
return new Queue("voter.rpc.requests");
}
@Bean
public DirectExchange exchange() {
return new DirectExchange("voter.rpc");
}
@Bean
public Binding binding(DirectExchange exchange, Queue queue) {
return BindingBuilder.bind(queue).to(exchange).with("rpc");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment