@PostConstruct public void init() { DirectExchange exchange = new DirectExchange(PAY_NOTIFY_EXCHANGE_NAME); exchange.setDelayed(true); Queue queue = new Queue(PAY_NOTIFY_QUEUE_NAME); Binding binding = BindingBuilder.bind(queue).to(exchange).withQueueName(); amqpAdmin.declareExchange(exchange); amqpAdmin.declareQueue(queue); amqpAdmin.declareBinding(binding); }
@Override protected void doDeclares() { AmqpAdmin admin = getAdmin(); if (admin != null && this.queue != null && admin.getQueueProperties(this.queue.getName()) == null) { admin.declareQueue(this.queue); } }
@Override protected void doDeclares() { AmqpAdmin admin = getAdmin(); if (admin != null && admin.getQueueProperties(this.queue.getName()) == null) { admin.declareQueue(this.queue); } }
@Override protected void doDeclares() { AmqpAdmin admin = getAdmin(); if (admin != null) { if (admin.getQueueProperties(this.queue.getName()) == null) { admin.declareQueue(this.queue); } if (this.exchange != null) { admin.declareExchange(this.exchange); } if (this.binding != null) { admin.declareBinding(this.binding); } } }
/** * An example application that only configures the AMQP broker */ public static void main(String[] args) throws Exception { ApplicationContext context = new ClassPathXmlApplicationContext("rabbitConfiguration.xml"); AmqpAdmin amqpAdmin = context.getBean(AmqpAdmin.class); Queue helloWorldQueue = new Queue("hello.world.queue"); amqpAdmin.declareQueue(helloWorldQueue); }
@Bean public Queue queue() { Queue queue = QueueBuilder.durable("OrderEvents").build(); admin.declareQueue(queue); return queue; }
@Bean public Queue queue() { Queue queue = QueueBuilder.durable("CustomerEvents").build(); admin.declareQueue(queue); return queue; }
@Bean public Queue queue() { Queue queue = QueueBuilder.durable("MenuEvents").build(); admin.declareQueue(queue); return queue; }
protected Queue declareQueue() { //Determine queue arguments, including vendor extensions Map<String, Object> queueArguments = new HashMap<String, Object>(); if(endpoint.getTimeToLive() != null) queueArguments.put(TTL_QUEUE_ARGUMENT, endpoint.getTimeToLive()); if(endpoint.isHa() ) queueArguments.put(HA_POLICY_ARGUMENT, "all"); //Declare queue Queue queue = new Queue(this.endpoint.queueName, this.endpoint.durable, this.endpoint.exclusive, this.endpoint.autodelete, queueArguments); this.endpoint.getAmqpAdministration().declareQueue(queue); LOG.info("Declared queue {} for endpoint {}.", queue.getName(), endpoint); return queue; }
protected Queue declareQueue() { //Determine queue arguments, including vendor extensions Map<String, Object> queueArguments = new HashMap<String, Object>(); if(endpoint.getTimeToLive() != null) queueArguments.put(TTL_QUEUE_ARGUMENT, endpoint.getTimeToLive()); if(endpoint.isHa() ) queueArguments.put(HA_POLICY_ARGUMENT, "all"); //Declare queue Queue queue = new Queue(this.endpoint.queueName, this.endpoint.durable, this.endpoint.exclusive, this.endpoint.autodelete, queueArguments); this.endpoint.getAmqpAdministration().declareQueue(queue); LOG.info("Declared queue {} for endpoint {}.", queue.getName(), endpoint); return queue; }
@Override protected void doDeclares() { AmqpAdmin admin = getAdmin(); if (admin != null && this.queue != null && admin.getQueueProperties(this.queue.getName()) == null) { admin.declareQueue(this.queue); } }
@Override protected void doDeclares() { AmqpAdmin admin = getAdmin(); if (admin != null && admin.getQueueProperties(this.queue.getName()) == null) { admin.declareQueue(this.queue); } }
@Before public void setup() { admin.declareQueue(myQueue); }
@Bean public Queue hystrixStreamQueue() { Map<String, Object> args = new HashMap<>(); args.put("x-message-ttl", 60000); //TODO: configure TTL Queue queue = new Queue(Constants.HYSTRIX_STREAM_NAME, false, false, false, args); amqpAdmin.declareQueue(queue); amqpAdmin.declareBinding(BindingBuilder.bind(queue).to(hystrixStreamExchange()).with("")); return queue; }
@Override protected void doDeclares() { AmqpAdmin admin = getAdmin(); if (admin != null) { if (admin.getQueueProperties(this.queue.getName()) == null) { admin.declareQueue(this.queue); } if (this.exchange != null) { admin.declareExchange(this.exchange); } if (this.binding != null) { admin.declareBinding(this.binding); } } }
@Autowired public void defineExchange(AmqpAdmin admin) { Queue tradesQueue = QueueBuilder.durable("trades").build(); Exchange tradingExchange = ExchangeBuilder.topicExchange("trading-engine-events").build(); admin.declareExchange(tradingExchange); admin.declareQueue(tradesQueue); admin.declareBinding(BindingBuilder.bind(tradesQueue) .to(tradingExchange) .with("#") .noargs()); }
private void sendData(String queueName, Object msg) { Queue queue = new Queue(queueName, true, false, true); amqpAdmin.declareQueue(queue); Binding binding = BindingBuilder.bind(queue).to(dataExchange).with(queueName); amqpAdmin.declareBinding(binding); amqpTemplate.convertAndSend(dataExchange.getName(),queueName, msg); }
private void sendNoftify(String queueName, Object msg) { Queue queue = new Queue(queueName, true, false, true); amqpAdmin.declareQueue(queue); Binding binding = BindingBuilder.bind(queue).to(notifyExchange).withQueueName(); amqpAdmin.declareBinding(binding); amqpTemplate.convertAndSend(notifyExchange.getName(),queueName, msg); }