Package play.modules.rabbitmq

Examples of play.modules.rabbitmq.RabbitMQPlugin


        if ((producer == null) && (this.exchangeName == null)) {
          throw new RuntimeException("Please define annotation @RabbitMQProducer.");
        }

        // Create Channel
        RabbitMQPlugin plugin = Play.plugin(RabbitMQPlugin.class);
        channel = plugin.createPublishersChannel(this.exchangeName);
        if (channel == null) {
          throw new RuntimeException("Error creating a communication channel with RabbitMQ. Please verify the health of your RabbitMQ node and check your configuration.");
        }

        // Publish Message - to an exchange
        channel.basicPublish(this.exchangeName, this.routingKey, plugin.getBasicProperties(), this.getBytes());

        // Execution Time
        executionTime = new java.util.Date().getTime() - start;
        Logger.info("Message %s has been published to exchange %s with routing key %s (execution time: %s ms)", this.message, this.exchangeName , this.routingKey, executionTime);
View Full Code Here


  /**
   * Go get her son.
   */
  private void goGetHerSon() {
    // Get Plugin
    RabbitMQPlugin plugin = Play.plugin(RabbitMQPlugin.class);

    // Define Channel
    Channel channel = null;
    QueueingConsumer consumer = null;
    Long deliveryTag = null;
View Full Code Here

        if ((producer == null) && (this.queueName == null)) {
          throw new RuntimeException("Please define annotation @RabbitMQProducer.");
        }

        // Create Channel
        RabbitMQPlugin plugin = Play.plugin(RabbitMQPlugin.class);
        channel = plugin.createChannel(this.queueName, this.routingKey);
        if (channel == null) {
          throw new RuntimeException("Error creating a communication channel with RabbitMQ. Please verify the health of your RabbitMQ node and check your configuration.");
        }

        // Publish Message
        channel.basicPublish(this.queueName, this.routingKey, plugin.getBasicProperties(), this.getBytes());

        // Execution Time
        executionTime = new java.util.Date().getTime() - start;
        Logger.info("Message %s has been published to queue %s (execution time: %s ms)", this.message, this.queueName, executionTime);
View Full Code Here

TOP

Related Classes of play.modules.rabbitmq.RabbitMQPlugin

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.