public Binding and(Map<String, Object> map) { return new Binding(this.configurer.destination.name, this.configurer.destination.type, this.configurer.exchange, this.routingKey, map); }
public Binding withQueueName() { return new Binding(destination.name, destination.type, exchange, destination.name, Collections.<String, Object>emptyMap()); } }
public Binding with(String routingKey) { return new Binding(destination.name, destination.type, exchange, routingKey, Collections.<String, Object>emptyMap()); }
public Binding noargs() { return new Binding(this.configurer.destination.name, this.configurer.destination.type, this.configurer.exchange, this.routingKey, Collections.<String, Object>emptyMap()); }
public Binding with(String routingKey) { return new Binding(destination.name, destination.type, exchange, routingKey, Collections.<String, Object>emptyMap()); }
public Binding with(Enum<?> routingKeyEnum) { return new Binding(destination.name, destination.type, exchange, routingKeyEnum.toString(), Collections.<String, Object>emptyMap()); } }
public Binding with(Enum<?> routingKeyEnum) { return new Binding(destination.name, destination.type, exchange, routingKeyEnum.toString(), Collections.<String, Object>emptyMap()); }
public Binding exists() { return new Binding(HeadersExchangeMapConfigurer.this.destination.name, HeadersExchangeMapConfigurer.this.destination.type, HeadersExchangeMapConfigurer.this.exchange.getName(), "", createMapForKeys(this.key)); }
public Binding match() { return new Binding(HeadersExchangeMapConfigurer.this.destination.name, HeadersExchangeMapConfigurer.this.destination.type, HeadersExchangeMapConfigurer.this.exchange.getName(), "", this.headerMap); } }
@Override public void bind(final String exchangeName, String destination, DestinationType destinationType, Optional<String> routingKey, Optional<Map<String, Object>> arguments) { rabbitAdmin.declareBinding(new Binding(destination, destinationType, exchangeName, routingKey.orElse(""), arguments.orElse(null))); }
public Binding matches(Object value) { Map<String, Object> map = new HashMap<String, Object>(); map.put(this.key, value); return new Binding(HeadersExchangeMapConfigurer.this.destination.name, HeadersExchangeMapConfigurer.this.destination.type, HeadersExchangeMapConfigurer.this.exchange.getName(), "", map); } }
public Binding exist() { return new Binding(HeadersExchangeMapConfigurer.this.destination.name, HeadersExchangeMapConfigurer.this.destination.type, HeadersExchangeMapConfigurer.this.exchange.getName(), "", this.headerMap); } }
@Nullable private Binding convert(@Nullable BindingInfo bi) { if (bi == null) { return null; } return new Binding(bi.getDestination(), DestinationType.valueOf(bi.getDestinationType().toUpperCase()), bi.getSource(), bi.getRoutingKey(), bi.getArguments()); }
@Nullable private Binding convert(@Nullable BindingInfo bi) { if (bi == null) { return null; } return new Binding(bi.getDestination(), DestinationType.valueOf(bi.getDestinationType().toUpperCase()), bi.getSource(), bi.getRoutingKey(), bi.getArguments()); }
@Bean public Declarables ds() { return new Declarables( new DirectExchange("e4", false, true), new Queue("q4", false, false, true), new Binding("q4", DestinationType.QUEUE, "e4", "k4", null)); }
@Bean public Binding binding() throws IOException { Binding binding = new Binding("foo", DestinationType.QUEUE, exchange().getName(), "foo", null); binding.setAdminsThatShouldDeclare(admin1()); return binding; } }
@Test public void testRemoveBindingWithDefaultExchangeImplicitBinding() throws Exception { String queueName = "test.queue"; final Queue queue = new Queue(queueName, false, false, false); rabbitAdmin.declareQueue(queue); Binding binding = new Binding(queueName, DestinationType.QUEUE, RabbitAdmin.DEFAULT_EXCHANGE_NAME, queueName, null); rabbitAdmin.removeBinding(binding); // Pass by virtue of RabbitMQ not firing a 403 reply code }
@Test public void testSpringWithDefaultExchangeImplicitBinding() throws Exception { Exchange exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME); context.getBeanFactory().registerSingleton("foo", exchange); String queueName = "test.queue"; final Queue queue = new Queue(queueName, false, false, false); context.getBeanFactory().registerSingleton("bar", queue); Binding binding = new Binding(queueName, DestinationType.QUEUE, exchange.getName(), queueName, null); context.getBeanFactory().registerSingleton("baz", binding); rabbitAdmin.afterPropertiesSet(); rabbitAdmin.initialize(); // Pass by virtue of RabbitMQ not firing a 403 reply code for both exchange and binding declaration assertTrue(queueExists(queue)); }
@Test public void testDeclareBindingWithDefaultExchangeImplicitBinding() throws Exception { Exchange exchange = new DirectExchange(RabbitAdmin.DEFAULT_EXCHANGE_NAME); String queueName = "test.queue"; final Queue queue = new Queue(queueName, false, false, false); rabbitAdmin.declareQueue(queue); Binding binding = new Binding(queueName, DestinationType.QUEUE, exchange.getName(), queueName, null); rabbitAdmin.declareBinding(binding); // Pass by virtue of RabbitMQ not firing a 403 reply code for both exchange and binding declaration assertTrue(queueExists(queue)); }