Package com.rabbitmq.client

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


            }

            if (queue == null) {
                queue = channel.queueDeclare().getQueue();
            } else {
              channel.queueDeclare(queue, false, false, false, null);
            }

            channel.queueBind(queue, exchange, topicPattern);

            System.out.println("Listening to exchange " + exchange + ", pattern " + topicPattern +
View Full Code Here


            ConnectionFactory connFactory = new ConnectionFactory();
            connFactory.setUri(uri);
            Connection conn = connFactory.newConnection();
            final Channel ch = conn.createChannel();

            ch.queueDeclare("Hello", false, false, false, null);
            JsonRpcServer server =
                new JsonRpcServer(ch, "Hello", HelloJsonService.class,
                                  new HelloJsonService() {
                                      public String greeting(String name) {
                                          return "Hello, "+name+", from JSON-RPC over AMQP!";
View Full Code Here

                long startTime = System.currentTimeMillis();

                // Setup
                Connection conn = connectionFactory.newConnection();
                Channel ch = conn.createChannel();
                ch.queueDeclare(QUEUE_NAME, true, false, false, null);
                ch.confirmSelect();

                // Publish
                for (long i = 0; i < msgCount; ++i) {
                    ch.basicPublish("", QUEUE_NAME,
View Full Code Here

    private static final int COMMIT_COUNT = 1500;

    public static void main(String[] args) throws IOException, InterruptedException {
        final Connection connection = new ConnectionFactory().newConnection();
        final Channel channel = connection.createChannel();
        String queueName = channel.queueDeclare().getQueue();
        execute("Transactional and Channel pooling", createChannelPoolSharingThreads(connection, queueName));
        queueName = refreshQueue(channel, queueName);
        execute("Transactional, new Channel per tx", createChannelCreatingThreads(connection, queueName, true));
        queueName = refreshQueue(channel, queueName);
        execute("Non-transactional, new Channel per tx", createChannelCreatingThreads(connection, queueName, false));
View Full Code Here

      /**
       * make exchange and queue non-durable
       */
      channel.exchangeDeclare(exchangeName, "direct", true);
      if(!getQueue) {
         channel.queueDeclare(queueName, false, true, true, null);
      } else {
         queueName = channel.queueDeclare().getQueue();
      }
      channel.queueBind(queueName, exchangeName, routingKey);

View Full Code Here

       */
      channel.exchangeDeclare(exchangeName, "direct", true);
      if(!getQueue) {
         channel.queueDeclare(queueName, false, true, true, null);
      } else {
         queueName = channel.queueDeclare().getQueue();
      }
      channel.queueBind(queueName, exchangeName, routingKey);

      boolean noAck = false;
      QueueingConsumer consumer = new QueueingConsumer(channel);
View Full Code Here

                getChannel().basicAck(deliveryTag, false);
            }
        };

        String queueName = channel.queueDeclare().getQueue();

        channel.queueBind(queueName, exchangeName, routingKey);
        channel.basicConsume(queueName, cons);

        long id = consumerSeq++;
View Full Code Here

            try {           
                ConnectionFactory factory = new ConnectionFactory();
                factory.setHost("localhost");
                Connection connection = factory.newConnection();
                Channel channel = connection.createChannel();
                channel.queueDeclare(QUEUE_NAME,false,false,false,null);
                consumer = new QueueingConsumer(channel);

                channel.basicConsume(QUEUE_NAME, true,consumer);
               
                while(true){
View Full Code Here

        final Connection connection = m_connFactory.newConnection();
        final Channel channel = connection.createChannel();

        try {
            channel.exchangeDeclare("testExchange", "topic", true);
            String dataQueue = channel.queueDeclare().getQueue();
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE2.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_REPLICATED_TABLE.#");
            String doneQueue = channel.queueDeclare().getQueue();
            channel.queueBind(doneQueue, "testExchange", "EXPORT_DONE_TABLE.#");
View Full Code Here

            channel.exchangeDeclare("testExchange", "topic", true);
            String dataQueue = channel.queueDeclare().getQueue();
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE2.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_REPLICATED_TABLE.#");
            String doneQueue = channel.queueDeclare().getQueue();
            channel.queueBind(doneQueue, "testExchange", "EXPORT_DONE_TABLE.#");

            // Setup callback for data stream
            channel.basicConsume(dataQueue, false, createConsumer(channel));
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.