Package com.rabbitmq.client

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


            } else {
                channel.exchangeDeclare(exchange, "topic");
            }

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

            channel.queueBind(queue, exchange, topicPattern);
View Full Code Here


            }

            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

      conn = new ConnectionFactory()
          {{setUri(uri);}}.newConnection();
      Channel setup = conn.createChannel();

      setup.exchangeDeclare(EXCHANGE, "direct");
      setup.queueDeclare(QUEUE, false, false, false, null);
      setup.queueBind(QUEUE,EXCHANGE, "");
     
      setup.close();
    } catch(Exception e){
      e.printStackTrace();
View Full Code Here

            cfconn.setUri(uri);
            Connection conn = cfconn.newConnection();

            Channel ch1 = conn.createChannel();

            String queueName = ch1.queueDeclare().getQueue();
            ch1.queueBind(queueName, exchange, "#");

            QueueingConsumer consumer = new QueueingConsumer(ch1);
            ch1.basicConsume(queueName, true, consumer);
            while (true) {
View Full Code Here

            final Channel ch = conn.createChannel();

            String queueName =
    (requestedQueueName.equals("")
     ? ch.queueDeclare()
     : ch.queueDeclare(requestedQueueName,
                                   false, false, false, null)).getQueue();

      if (exchange != null || routingKey != null) {
    if (exchange == null) {
View Full Code Here

            final Channel ch = conn.createChannel();

            String queueName =
    (requestedQueueName.equals("")
     ? ch.queueDeclare()
     : ch.queueDeclare(requestedQueueName,
                                   false, false, false, null)).getQueue();

      if (exchange != null || routingKey != null) {
    if (exchange == null) {
        System.err.println("Please supply exchange name to bind to (-e)");
View Full Code Here

  // consumer exception handler, and result in a clean shut down.
  public void testCloseWithFaultyConsumer() throws Exception{
    SpecialConnection connection = new SpecialConnection();
    Channel channel = connection.createChannel();
    channel.exchangeDeclare("x", "direct");
    channel.queueDeclare("q", false, false, false, null);
    channel.queueBind("q", "x", "k");

    channel.basicConsume("q", true, new DefaultConsumer(channel){
        @Override
        public void handleDelivery(String consumerTag,
View Full Code Here

            for (int x = 0; x < maxQueueExp; x++) {

                final int maxQueues = pow(params.base, x);

                for (; q < maxQueues; q++) {
                    AMQP.Queue.DeclareOk ok = channel.queueDeclare();
                    queues.push(ok.getQueue());
                    for (int b = 0; b < maxBindings; b++) {
                        channel.queueBind(ok.getQueue(), "amq.direct", routingKeys[b]);
                    }
                }
View Full Code Here

            Connection conn = cfconn.newConnection();

            Channel ch = conn.createChannel();

            if (exchange.equals("")) {
                ch.queueDeclare(routingKey, false, false, false, null);
            }
            ch.basicPublish(exchange, routingKey, null, message.getBytes());
            ch.close();
            conn.close();
        } catch (Exception e) {
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.