Package org.apache.qpid.client

Examples of org.apache.qpid.client.AMQConnection


        super.setUp();

        //Verify initially requesting a 0-10 connection still works
        setTestClientSystemProperty(ClientProperties.AMQP_VERSION, "0-10");
        AMQConnection connection = (AMQConnection) getConnection();
        assertEquals("Unexpected protocol version in use", ProtocolVersion.v0_10, connection.getProtocolVersion());
        connection.close();
    }
View Full Code Here


        _jmxUtils.setUp();

        super.setUp();

        _brokerUrl = getBroker().toString();
        _vhost1Connection = new AMQConnection(_brokerUrl, TEST_USER, TEST_PASSWORD, "clientid", TEST_VIRTUALHOST1);
        _vhost2Connection = new AMQConnection(_brokerUrl, TEST_USER, TEST_PASSWORD, "clientid", TEST_VIRTUALHOST2);
        _vhost1Connection.start();
        _vhost2Connection.start();

        _vhost1Session = _vhost1Connection.createSession(true, Session.SESSION_TRANSACTED);
        _vhost2Session = _vhost2Connection.createSession(true, Session.SESSION_TRANSACTED);
View Full Code Here

        _monitor = new LogMonitor(_outputFile);

        super.setUp();

        _brokerUrl = getBroker().toString();
        _conToVhost1 = new AMQConnection(_brokerUrl, USER, USER, "clientid", VHOST_NAME1);
        _conToVhost2 = new AMQConnection(_brokerUrl, USER, USER, "clientid", VHOST_NAME2);
        _conToVhost3 = new AMQConnection(_brokerUrl, USER, USER, "clientid", VHOST_NAME3);

        _conToVhost1.start();
        _conToVhost2.start();
        _conToVhost3.start();
    }
View Full Code Here

    }

    public void setConnectionTuneParameters(ConnectionTuneParameters params)
    {
        _connectionTuneParameters = params;
        AMQConnection con = getAMQConnection();

        con.setMaximumChannelCount(params.getChannelMax());
        con.setMaximumFrameSize(params.getFrameMax());
        _protocolHandler.initHeartbeats((int) params.getHeartbeat());
    }
View Full Code Here

    private static final String EXCHANGE_NAME = "NewExchangeNametoFailLookup";

    public void test() throws Exception
    {

        AMQConnection connection = (AMQConnection) getConnection();

        AMQSession session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // Set no wait true so that we block the connection
        // Also set a different exchange class string so the attempt to declare
        // the exchange causes an exchange.
        ExchangeDeclareBody body = session.getMethodRegistry().createExchangeDeclareBody(session.getTicket(), new AMQShortString(EXCHANGE_NAME), null,
                                                                                         true, false, false, false, true, null);

        AMQFrame exchangeDeclare = body.generateFrame(session.getChannelId());

        try
        {
            // block our thread so that can times out
            connection.getProtocolHandler().syncWrite(exchangeDeclare, ExchangeDeclareOkBody.class);
        }
        catch (Exception e)
        {
            assertTrue("Exception should say the exchange is not known.", e.getMessage().contains("Unknown exchange: " + EXCHANGE_NAME));
        }

        try
        {
            // Depending on if the notification thread has closed the connection
            // or not we may get an exception here when we attempt to close the
            // connection. If we do get one then it should be the same as above
            // an AMQAuthenticationException.
            connection.close();
        }
        catch (Exception e)
        {
            assertTrue("Exception should say the exchange is not known.", e.getMessage().contains("Unknown exchange: " + EXCHANGE_NAME));
        }
View Full Code Here

            "'";
           
            url = String.format(url,QpidBrokerTestCase.DEFAULT_SSL_PORT,
                    KEYSTORE,KEYSTORE_PASSWORD,TRUSTSTORE,TRUSTSTORE_PASSWORD);
           
            AMQConnection con = new AMQConnection(url);
            assertNotNull("connection should be successful", con);
            Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE);
            assertNotNull("create session should be successful", ssn);
        }       
    }
View Full Code Here

            String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:%s?ssl='true''";

            url = String.format(url,QpidBrokerTestCase.DEFAULT_SSL_PORT);
           
            AMQConnection con = new AMQConnection(url);
            assertNotNull("connection should be successful", con);
            Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE);
            assertNotNull("create session should be successful", ssn);
        }       
    }
View Full Code Here

            QpidBrokerTestCase.DEFAULT_SSL_PORT +
            "?ssl='true'&ssl_verify_hostname='true''";
           
            try
            {
                AMQConnection con = new AMQConnection(url);
                fail("Hostname verification failed. No exception was thrown");
            }
            catch (Exception e)
            {
                ByteArrayOutputStream bout = new ByteArrayOutputStream();
View Full Code Here

        {
            String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:" +
            QpidBrokerTestCase.DEFAULT_SSL_PORT +
            "?ssl='true'&ssl_verify_hostname='true''";

            AMQConnection con = new AMQConnection(url);
            assertNotNull("connection should have been created", con);
        }
    }
View Full Code Here

        {
            String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost.localdomain:" +
            QpidBrokerTestCase.DEFAULT_SSL_PORT +
            "?ssl='true'&ssl_verify_hostname='true''";

            AMQConnection con = new AMQConnection(url);
            assertNotNull("connection should have been created", con);
        }       
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.AMQConnection

Copyright © 2018 www.massapicom. 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.