Package org.springframework.integration.amqp.outbound

Examples of org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint


  private AmqpOutboundEndpoint buildOutboundEndpoint(final String name, RabbitPropertiesAccessor properties) {
    String queueName = properties.getPrefix(this.defaultPrefix) + name;
    String partitionKeyExtractorClass = properties.getPartitionKeyExtractorClass();
    Expression partitionKeyExpression = properties.getPartitionKeyExpression();
    AmqpOutboundEndpoint queue = new AmqpOutboundEndpoint(rabbitTemplate);
    if (partitionKeyExpression == null && !StringUtils.hasText(partitionKeyExtractorClass)) {
      declareQueueIfNotPresent(new Queue(queueName));
      queue.setRoutingKey(queueName); // uses default exchange
    }
    else {
      queue.setRoutingKeyExpression(buildPartitionRoutingExpression(queueName));
      for (int i = 0; i < properties.getPartitionCount(); i++) {
        this.rabbitAdmin.declareQueue(new Queue(queueName + "-" + i));
      }
    }
    configureOutboundHandler(queue, properties);
View Full Code Here


      Properties properties) {
    validateProducerProperties(name, properties, SUPPORTED_PUBSUB_PRODUCER_PROPERTIES);
    RabbitPropertiesAccessor accessor = new RabbitPropertiesAccessor(properties);
    String exchangeName = accessor.getPrefix(this.defaultPrefix) + "topic." + name;
    declareExchangeIfNotPresent(new FanoutExchange(exchangeName));
    AmqpOutboundEndpoint fanout = new AmqpOutboundEndpoint(rabbitTemplate);
    fanout.setExchangeName(exchangeName);
    configureOutboundHandler(fanout, accessor);
    doRegisterProducer(name, moduleOutputChannel, fanout, accessor);
  }
View Full Code Here

    }
    validateProducerProperties(name, properties, SUPPORTED_REQUESTING_PRODUCER_PROPERTIES);
    Assert.isInstanceOf(SubscribableChannel.class, requests);
    RabbitPropertiesAccessor accessor = new RabbitPropertiesAccessor(properties);
    String queueName = name + ".requests";
    AmqpOutboundEndpoint queue = this.buildOutboundEndpoint(queueName, accessor);
    queue.setBeanFactory(this.getBeanFactory());

    String replyQueueName = accessor.getPrefix(this.defaultPrefix) + name + ".replies."
        + this.getIdGenerator().generateId();
    this.doRegisterProducer(name, requests, queue, replyQueueName, accessor);
    Queue replyQueue = new Queue(replyQueueName, false, false, true); // auto-delete
View Full Code Here

    RabbitPropertiesAccessor accessor = new RabbitPropertiesAccessor(properties);
    Queue requestQueue = new Queue(accessor.getPrefix(this.defaultPrefix) + name + ".requests");
    declareQueueIfNotPresent(requestQueue);
    this.doRegisterConsumer(name, requests, requestQueue, accessor, false);

    AmqpOutboundEndpoint replyQueue = new AmqpOutboundEndpoint(rabbitTemplate);
    replyQueue.setRoutingKeyExpression("headers['" + AmqpHeaders.REPLY_TO + "']");
    configureOutboundHandler(replyQueue, accessor);
    doRegisterProducer(name, replies, replyQueue, accessor);
  }
View Full Code Here

    }
    if (!bindNewProducerDirectlyIfPossible(name, (SubscribableChannel) moduleOutputChannel, accessor)) {
      if (logger.isInfoEnabled()) {
        logger.info("declaring queue for outbound: " + name);
      }
      AmqpOutboundEndpoint queue = this.buildOutboundEndpoint(name, accessor);
      doRegisterProducer(name, moduleOutputChannel, queue, accessor);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.