Examples of queueDeclare()


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

    factory.setHost("localhost");
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "direct");
    String queueName = channel.queueDeclare().getQueue();
   
    if (argv.length < 1){
      System.err.println("Usage: ReceiveLogsDirect [info] [warning] [error]");
      System.exit(1);
    }
View Full Code Here

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

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost("localhost");
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();
   
    channel.queueDeclare(TASK_QUEUE_NAME, true, false, false, null);
   
    String message = getMessage(argv);
   
    channel.basicPublish( "", TASK_QUEUE_NAME,
                MessageProperties.PERSISTENT_TEXT_PLAIN,
View Full Code Here

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

      factory.setHost("localhost");
 
      connection = factory.newConnection();
      channel = connection.createChannel();
     
      channel.queueDeclare(RPC_QUEUE_NAME, false, false, false, null);
 
      channel.basicQos(1);
 
      QueueingConsumer consumer = new QueueingConsumer(channel);
      channel.basicConsume(RPC_QUEUE_NAME, false, consumer);
View Full Code Here

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

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost("localhost");
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.queueDeclare(QUEUE_NAME, false, false, false, null);
    String message = "Hello World!";
    channel.basicPublish("", QUEUE_NAME, null, message.getBytes());
    System.out.println(" [x] Sent '" + message + "'");
   
    channel.close();
View Full Code Here

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

 
      connection = factory.newConnection();
      channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");
      String queueName = channel.queueDeclare().getQueue();
      if (argv.length < 1){
        System.err.println("Usage: ReceiveLogsTopic [binding_key]...");
        System.exit(1);
      }
View Full Code Here

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

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost("localhost");
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.queueDeclare(QUEUE_NAME, false, false, false, null);
    System.out.println(" [*] Waiting for messages. To exit press CTRL+C");
   
    QueueingConsumer consumer = new QueueingConsumer(channel);
    channel.basicConsume(QUEUE_NAME, true, consumer);
   
View Full Code Here

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

        headers.put(argv[i], argv[i+1]);
        System.out.println("Binding header " + argv[i] + " and value " + argv[i + 1] + " to queue " + queueInputName);
        i++;
      }

      String queueName = channel.queueDeclare(queueInputName, true, false, false, null).getQueue();
      channel.queueBind(queueName, EXCHANGE_NAME, routingKeyFromUser, headers);
   
      System.out.println(" [*] Waiting for messages. To exit press CTRL+C");

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

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

    factory.setHost("localhost");
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "fanout");
    String queueName = channel.queueDeclare().getQueue();
    channel.queueBind(queueName, EXCHANGE_NAME, "");
   
    System.out.println(" [*] Waiting for messages. To exit press CTRL+C");

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

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

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

            final Channel ch = conn.createChannel();

            ch.queueDeclare(queueName, false, false, false, null);

            QueueingConsumer consumer = new QueueingConsumer(ch);
            ch.basicConsume(queueName, consumer);
            while (true) {
                QueueingConsumer.Delivery delivery = consumer.nextDelivery();
View Full Code Here

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

  static final int THREADS = 5;

  public void testNThreadShutdown() throws Exception{
    Channel channel = connection.createChannel();
    final QueueingConsumer c = new QueueingConsumer(channel);
    channel.queueDeclare(QUEUE, false, true, true, null);
    channel.basicConsume(QUEUE, c);
    final AtomicInteger count = new AtomicInteger(THREADS);
    final CountDownLatch latch = new CountDownLatch(THREADS);

    for(int i = 0; i < THREADS; i++){
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.