Examples of exchangeDeclare()


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

            Channel ch = conn.createChannel();

            if (exchange == null) {
                exchange = "amq.topic";
            } else {
                ch.exchangeDeclare(exchange, "topic");
            }

            System.out.println("Sending to exchange " + exchange + ", prefix: " + topicPrefix);

            int thisTimeCount = 0;
View Full Code Here

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

            final Channel channel = conn.createChannel();

            if (exchange == null) {
                exchange = "amq.topic";
            } else {
                channel.exchangeDeclare(exchange, "topic");
            }

            if (queue == null) {
                queue = channel.queueDeclare().getQueue();
            } else {
View Full Code Here

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

    try {
      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){
View Full Code Here

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

    }
    if (routingKey == null) {
        System.err.println("Please supply routing key pattern to bind to (-k)");
        System.exit(2);
    }
    ch.exchangeDeclare(exchange, exchangeType);
    ch.queueBind(queueName, exchange, routingKey);
      }

            QueueingConsumer consumer = new QueueingConsumer(ch);
            ch.basicConsume(queueName, consumer);
View Full Code Here

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

        conn.close();
        // Test what happens when we provoke an error
        conn = new ConnectionFactory(){{setUri(uri);}}.newConnection();
        ch = conn.createChannel();
        try {
            ch.exchangeDeclare("mumble", "invalid");
            throw new RuntimeException("expected shutdown");
        } catch (IOException e) {
        }
        // Test what happens when we just kill the connection
        conn = new ConnectionFactory(){{setUri(uri);}}.newConnection();
View Full Code Here

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

  // The thrown runtime exception should get intercepted by the
  // 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
View Full Code Here

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

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

            ch.exchangeDeclare(exchange, exchangeType);
            ch.basicPublish(exchange, routingKey, null, message.getBytes());
            ch.close();
            conn.close();
        } catch (Exception e) {
            System.err.println("Main thread caught exception: " + e);
View Full Code Here

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

                System.out.println("starting consumer #" + i);
                Connection conn = factory.newConnection();
                consumerConnections[i] = conn;
                Channel channel = conn.createChannel();
                if (consumerTxSize > 0) channel.txSelect();
                channel.exchangeDeclare(exchangeName, exchangeType);
                String qName =
                        channel.queueDeclare(queueName,
                                             flags.contains("persistent"),
                                             exclusive, autoDelete,
                                             null).getQueue();
View Full Code Here

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

                producerConnections[i] = conn;
                Channel channel = conn.createChannel();
                producerChannels[i] = channel;
                if (producerTxSize > 0) channel.txSelect();
                if (confirm >= 0) channel.confirmSelect();
                channel.exchangeDeclare(exchangeName, exchangeType);
                final Producer p = new Producer(channel, exchangeName, id,
                                                flags, producerTxSize,
                                                rateLimit, minMsgSize, timeLimit,
                                                confirm, stats);
                channel.addReturnListener(p);
View Full Code Here

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

        String exchange = "ttl.exchange";
        String queue = "ttl.queue";

        // exchange
        channel.exchangeDeclare(exchange, "direct");

        // queue
        channel.queueDeclare(queue, true, false, false, Collections.singletonMap("x-message-ttl", (Object) 30000L));
        channel.queueBind(queue, exchange, queue, null);
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.