Package com.rabbitmq.client

Examples of com.rabbitmq.client.Channel.exchangeDeclare()


      ConnectionFactory factory = new ConnectionFactory();
      factory.setHost(_mqServer);
      connection = factory.newConnection();
      Channel channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");
      String queueName = channel.queueDeclare().getQueue();

      String bindingKey = _partition;
      channel.queueBind(queueName, EXCHANGE_NAME, bindingKey);
View Full Code Here


        // http://www.rabbitmq.com/api-guide.html
        // channel.exchangeDeclare(exchangeName, "direct", true);
        // String queueName = channel.queueDeclare().getQueue();
        // channel.queueBind(queueName, exchangeName, routingKey);
       
        channel.exchangeDeclare(queue, plugin.getExchangeType(), true);
        channel.queueDeclare(queue, plugin.isDurable(), false, false, null);
        channel.queueBind(queue, queue, routingKey);

        // Log Debug
        Logger.info("RabbitMQ Task Channel Available: " + channel);
View Full Code Here

      Logger.debug("Retry " + attempts);

      // Get Next Delivery Message
      try {
        // http://www.rabbitmq.com/api-guide.html
        channel.exchangeDeclare(exchangeName, plugin.getExchangeType(), true);
        channel.queueDeclare(queue, plugin.isDurable(), false, false, null);
        channel.queueBind(queue, exchangeName, routingKey);

        // Log Debug
        Logger.info("RabbitMQ Task Channel Available: " + channel);
View Full Code Here

      Logger.debug("Retry " + attempts);

      // Get Next Delivery Message
      try {
        // http://www.rabbitmq.com/api-guide.html
        channel.exchangeDeclare(exchangeName, plugin.getExchangeType(), true);

        // Log Debug
        Logger.info("RabbitMQ Task Channel Available: " + channel);

        // Return Channel
View Full Code Here

        if (channel != null) {
          AMQP.Exchange.DeclareOk outcome = null;
          if (passive) {
            outcome = channel.exchangeDeclarePassive (exchange);
          } else {
            outcome = channel.exchangeDeclare (exchange, eType.getAmqpName (), durable, autoDelete, null);
          }
          succeeded = (outcome != null);
        }
        return succeeded;
      }
View Full Code Here

        System.out.println("starting consumer #" + i);
        Connection conn = consumerConnections[i%connectionCount];
        Channel channel = conn.createChannel();
        if (consumerTxSize > 0)
          channel.txSelect();
        channel.exchangeDeclare(exchangeName, exchangeType);
        String queueName = channel.queueDeclare("", flags.contains("persistent"), true, false, null).getQueue();
        QueueingConsumer consumer = new QueueingConsumer(channel);
        if (prefetchCount > 0)
          channel.basicQos(prefetchCount);
        channel.basicConsume(queueName, autoAck, consumer);
View Full Code Here

        Connection conn = factory.newConnection();
        producerConnections[i] = conn;
        Channel channel = conn.createChannel();
        if (producerTxSize > 0)
          channel.txSelect();
        channel.exchangeDeclare(exchangeName, exchangeType);
        final Producer p = new Producer(channel, exchangeName, id, flags, producerTxSize,
            1000L * samplingInterval, rateLimit, minMsgSize, timeLimit, messageCount);
        channel.addReturnListener(p);
        Thread t = new Thread(p);
        producerThreads[i] = t;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.