Examples of exchangeDeclare()


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

        String queueName = "test queue";
        channel.queueDeclare(queueName, true, false, false, null);

        String exchangeName = "test completion";
        channel.exchangeDeclare(exchangeName, "fanout", false, false, null);

        String completionQueue = channel.queueDeclare().getQueue();
        channel.queueBind(completionQueue, exchangeName, "");

        LatencyExperimentConsumer callback = new LatencyExperimentConsumer(channel, queueName);
View Full Code Here

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 + ", topic " + topic);
            ch.basicPublish(exchange, topic, null, message.getBytes());
            ch.close();
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()

        ConnectionFactory cf = new ConnectionFactory();
        cf.setUri(uri);
        Connection conn = cf.newConnection();
        Channel setup = conn.createChannel();

        setup.exchangeDeclare(EXCHANGE, "direct");
        setup.queueDeclare(QUEUE, false, false, false, null);
        setup.queueBind(QUEUE, EXCHANGE, ROUTING_KEY);

        setup.close();
        return conn;
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()

        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

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

        String queueName = "test queue";
        channel.queueDeclare(queueName, true, false, false, null);

        String exchangeName = "test completion";
        channel.exchangeDeclare(exchangeName, "fanout", false, false, null);

        String completionQueue = channel.queueDeclare().getQueue();
        channel.queueBind(completionQueue, exchangeName, "");

        LatencyExperimentConsumer callback = new LatencyExperimentConsumer(channel, queueName);
View Full Code Here

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 + ", topic " + topic);
            ch.basicPublish(exchange, topic, null, message.getBytes());
            ch.close();
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 org.apache.qpid.transport.Session.exchangeDeclare()

    private void declareQueue(String exch, String routkey, String qname) throws Exception
    {
        Connection conn = new Connection();
        conn.connect("localhost", QpidBrokerTestCase.DEFAULT_PORT, "test", "guest", "guest",false);
        Session sess = conn.createSession(0);
        sess.exchangeDeclare(exch, "direct", null, null);
        sess.queueDeclare(qname, null, null);
        sess.exchangeBind(qname, exch, routkey, null);
        sess.sync();
        conn.close();       
    }
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.