Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Configuration
- public class serverConfiguration {
- private String queueName;
- ...
- @Bean
- public Queue buildQueue() {
- Queue queue = new Queue(this.queueName, false, false, true, getQueueArguments());
- buildRabbitAdmin().declareQueue(queue);
- return queue;
- }
- ...
- }
- @Configuration
- public class serverConfiguration {
- private String queueName;
- ...
- @Bean
- @Scope("prototype")
- public Queue buildQueue() {
- Queue queue = new Queue(this.queueName, false, false, true, getQueueArguments());
- buildRabbitAdmin().declareQueue(queue);
- return queue;
- }
- ...
- }
- Map<String, Queue> queueBeans = ((ListableBeanFactory) applicationContext).getBeansOfType(Queue.class);
- name of the method := the last created instance.
- context.getBeanFactory().registerSingleton("foo", new Queue("foo"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement