org.springframework.amqp.core.QueueBuilder Java Examples

The following examples show how to use org.springframework.amqp.core.QueueBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RabbitConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public Queue retryQueue2() {
    return QueueBuilder.nonDurable("retry-queue-2")
        .deadLetterExchange("")
        .deadLetterRoutingKey("retry-wait-ended-queue")
        .build();
}
 
Example #2
Source File: RabbitTemplateMessageQueueFactory.java    From elasticactors with Apache License 2.0 5 votes vote down vote up
private void ensureQueueExists(String queueName) {
    // ensure we have the queue created on the broker
    Queue queue = QueueBuilder.durable(queueName).build();
    amqpAdmin.declareQueue(queue);
    // and bound to the exchange
    DirectExchange exchange = ExchangeBuilder.directExchange(exchangeName).build();
    amqpAdmin.declareBinding(BindingBuilder.bind(queue).to(exchange).with(queueName));
}
 
Example #3
Source File: SimpleDLQAmqpConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
Queue messagesQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES)
      .withArgument("x-dead-letter-exchange", "")
      .withArgument("x-dead-letter-routing-key", QUEUE_MESSAGES_DLQ)
      .build();
}
 
Example #4
Source File: RabbitConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public Queue retryQueue3() {
    return QueueBuilder.nonDurable("retry-queue-3")
        .deadLetterExchange("")
        .deadLetterRoutingKey("retry-wait-ended-queue")
        .build();
}
 
Example #5
Source File: RabbitConfiguration.java    From fw-cloud-framework with MIT License 5 votes vote down vote up
/**
 * 创建delay_queue_per_message_ttl队列
 */
@Bean
Queue delayQueuePerMessageTTL() {
	return QueueBuilder.durable(PAY_NOTIFY_DELAY_PRE_MESSAGE_TTL).withArgument(
			"x-dead-letter-exchange", PAY_NOTIFY_DELAY_EXCHANGE) // DLX,dead letter发送到的exchange
			.withArgument("x-dead-letter-routing-key", PAY_NOTIFY_DELAY_QUENU_NAME)
			// dead letter携带的routing key
			.build();
}
 
Example #6
Source File: RabbitConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public Queue retryQueue1() {
    return QueueBuilder.nonDurable("retry-queue-1")
        .deadLetterExchange("")
        .deadLetterRoutingKey("retry-wait-ended-queue")
        .build();
}
 
Example #7
Source File: RabbitConfiguration.java    From fw-cloud-framework with MIT License 5 votes vote down vote up
/**
 * 创建delay_queue_per_queue_ttl队列
 */
@Bean
Queue delayQueuePerQueueTTL() {
	return QueueBuilder.durable(PAY_NOTIFY_DELAY_QUENU_ALL_TTL).withArgument(
			"x-dead-letter-exchange", PAY_NOTIFY_DELAY_EXCHANGE) // DLX
			.withArgument("x-dead-letter-routing-key", PAY_NOTIFY_DELAY_QUENU_NAME)
			// dead letter携带的routing key
			.withArgument("x-message-ttl", QUEUE_EXPIRATION)
			// 设置队列的过期时间
			.build();
}
 
Example #8
Source File: SimpleDLQAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue deadLetterQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES_DLQ).build();
}
 
Example #9
Source File: ListenerErrorHandlerAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue messagesQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES)
      .build();
}
 
Example #10
Source File: RoutingKeyDLQAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue deadLetterQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES_DLQ).build();
}
 
Example #11
Source File: RoutingKeyDLQAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue messagesQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES)
      .withArgument("x-dead-letter-exchange", DLX_EXCHANGE_MESSAGES)
      .build();
}
 
Example #12
Source File: DLXCustomAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue deadLetterQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES_DLQ).build();
}
 
Example #13
Source File: DLXCustomAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue messagesQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES)
      .withArgument("x-dead-letter-exchange", DLX_EXCHANGE_MESSAGES)
      .build();
}
 
Example #14
Source File: FatalExceptionStrategyAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue messagesQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES)
      .build();
}
 
Example #15
Source File: DLXParkingLotAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue deadLetterQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES_DLQ).build();
}
 
Example #16
Source File: DLXParkingLotAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue messagesQueue() {
    return QueueBuilder.durable(QUEUE_MESSAGES)
      .withArgument("x-dead-letter-exchange", DLX_EXCHANGE_MESSAGES)
      .build();
}
 
Example #17
Source File: DLXParkingLotAmqpConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
Queue parkingLotQueue() {
    return QueueBuilder.durable(QUEUE_PARKING_LOT).build();
}
 
Example #18
Source File: RabbitConfig.java    From POC with Apache License 2.0 4 votes vote down vote up
@Bean
Queue ordersQueue() {
	return QueueBuilder.durable(QUEUE_ORDERS).withArgument("x-dead-letter-exchange", "")
			.withArgument("x-dead-letter-routing-key", QUEUE_DEAD_ORDERS).withArgument("x-message-ttl", 5000)
			.build();
}
 
Example #19
Source File: RabbitConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
public Queue retryWaitEndedQueue() {
    return QueueBuilder.nonDurable("retry-wait-ended-queue")
        .build();
}
 
Example #20
Source File: RabbitConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
public Queue nonBlockingQueue() {
    return QueueBuilder.nonDurable("non-blocking-queue")
        .build();
}
 
Example #21
Source File: RabbitConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
public Queue blockingQueue() {
    return QueueBuilder.nonDurable("blocking-queue")
        .build();
}
 
Example #22
Source File: AmqpReactiveController.java    From tutorials with MIT License 4 votes vote down vote up
private Queue createTopicQueue(DestinationsConfig.DestinationInfo destination) {

        Exchange ex = ExchangeBuilder.topicExchange(destination.getExchange())
          .durable(true)
          .build();

        amqpAdmin.declareExchange(ex);

        Queue q = QueueBuilder.nonDurable()
          .build();

        amqpAdmin.declareQueue(q);

        Binding b = BindingBuilder.bind(q)
          .to(ex)
          .with(destination.getRoutingKey())
          .noargs();

        amqpAdmin.declareBinding(b);

        return q;
    }
 
Example #23
Source File: AmqpReactiveController.java    From tutorials with MIT License 3 votes vote down vote up
@PostConstruct
public void setupQueueDestinations() {

    log.info("[I48] Creating Destinations...");

    destinationsConfig.getQueues()
        .forEach((key, destination) -> {

            log.info("[I54] Creating directExchange: key={}, name={}, routingKey={}", key, destination.getExchange(), destination.getRoutingKey());

            Exchange ex = ExchangeBuilder.directExchange(destination.getExchange())
                .durable(true)
                .build();

            amqpAdmin.declareExchange(ex);

            Queue q = QueueBuilder.durable(destination.getRoutingKey())
                .build();

            amqpAdmin.declareQueue(q);

            Binding b = BindingBuilder.bind(q)
                .to(ex)
                .with(destination.getRoutingKey())
                .noargs();

            amqpAdmin.declareBinding(b);

            log.info("[I70] Binding successfully created.");

        });
}
 
Example #24
Source File: RabbitConfig.java    From POC with Apache License 2.0 2 votes vote down vote up
/**
 * We may want to send invalid messages to a separate queue so that we can inspect and
 * reprocess them later. We can use DLQ concept to automatically do it instead of we
 * manually write the code to handle such scenarios. Now try to send an invalid JSON
 * message to orders-queue, it will be sent to dead-orders-queue.
 * @return rabbitMQ Queue.
 */
@Bean
Queue deadLetterQueue() {
	return QueueBuilder.durable(QUEUE_DEAD_ORDERS).build();
}
 
Example #25
Source File: RabbitConfiguration.java    From fw-cloud-framework with MIT License 2 votes vote down vote up
/**
 * 创建pay_notify_delay_quenu队列,也就是实际消费队列
 *
 * @return
 */
@Bean
Queue delayProcessQueue() {
	return QueueBuilder.durable(PAY_NOTIFY_DELAY_QUENU_NAME).build();
}
 
Example #26
Source File: AmqpConfiguration.java    From hawkbit-examples with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates the receiver queue from update server for receiving message from
 * update server.
 *
 * @return the queue
 */
@Bean
Queue receiverConnectorQueueFromHawkBit(final AmqpProperties amqpProperties) {
    return QueueBuilder.nonDurable(amqpProperties.getReceiverConnectorQueueFromSp()).autoDelete()
            .withArguments(getTTLMaxArgs()).build();
}
 
Example #27
Source File: AmqpConfiguration.java    From hawkbit with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Create the DMF API receiver queue for authentication requests called by
 * 3rd party artifact storages for download authorization by devices.
 *
 * @return the receiver queue
 */
@Bean
public Queue authenticationReceiverQueue() {
    return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete()
            .withArguments(getTTLMaxArgsAuthenticationQueue()).build();
}