Examples of BrokerDetails


Examples of org.apache.qpid.jms.BrokerDetails

        return false;
    }

    public boolean attemptReconnection()
    {
        BrokerDetails broker = null;
        while (_failoverPolicy.failoverAllowed() && (broker = _failoverPolicy.getNextBrokerDetails()) != null)
        {
            try
            {
                makeBrokerConnection(broker);
View Full Code Here

Examples of org.apache.qpid.jms.BrokerDetails

        {
            buf.append("No active broker connection");
        }
        else
        {
            BrokerDetails bd = _failoverPolicy.getCurrentBrokerDetails();
            buf.append("Host: ").append(String.valueOf(bd.getHost()));
            buf.append("\nPort: ").append(String.valueOf(bd.getPort()));
        }

        buf.append("\nVirtual Host: ").append(String.valueOf(_virtualHost));
        buf.append("\nClient ID: ").append(String.valueOf(_clientName));
        buf.append("\nActive session count: ").append((_sessions == null) ? 0 : _sessions.size());
View Full Code Here

Examples of org.apache.qpid.jms.BrokerDetails

        AMQConnection connection;
        AMQConnectionFactory connectionFactory = (AMQConnectionFactory)getConnectionFactory("default");
        ConnectionURL connectionURL = connectionFactory.getConnectionURL();
        connectionURL.setOption(ConnectionURL.OPTIONS_FAILOVER, "singlebroker");
        connectionURL.setOption(ConnectionURL.OPTIONS_FAILOVER_CYCLE, "2");
        BrokerDetails details = connectionURL.getBrokerDetails(0);
        details.setProperty(BrokerDetails.OPTIONS_RETRY, "200");
        details.setProperty(BrokerDetails.OPTIONS_CONNECT_DELAY, "1000");

        connection = (AMQConnection)connectionFactory.createConnection("admin", "admin");
        connection.setConnectionListener(this);
        return connection;
    }
View Full Code Here

Examples of org.apache.qpid.jms.BrokerDetails

    public void testDefaultExchanges() throws Exception
    {
        AMQConnection conn = null;
        try
        {
            BrokerDetails broker = getBroker();
            broker.setProperty(BrokerDetails.OPTIONS_RETRY, "1");
            ConnectionURL url = new AMQConnectionURL("amqp://guest:guest@clientid/test?brokerlist='"
                                     + broker
                                     + "'&defaultQueueExchange='test.direct'"
                                     + "&defaultTopicExchange='test.topic'"
                                     + "&temporaryQueueExchange='tmp.direct'"
View Full Code Here

Examples of org.apache.qpid.jms.BrokerDetails

    public void testPasswordFailureConnection() throws Exception
    {
        AMQConnection conn = null;
        try
        {
            BrokerDetails broker = getBroker();
            broker.setProperty(BrokerDetails.OPTIONS_RETRY, "0");
            conn = new AMQConnection("amqp://guest:rubbishpassword@clientid/test?brokerlist='" + broker + "'");
            fail("Connection should not be established password is wrong.");
        }
        catch (AMQConnectionFailureException amqe)
        {
View Full Code Here

Examples of org.apache.qpid.jms.BrokerDetails

    public void testUnresolvedVirtualHostFailure() throws Exception
    {
        AMQConnection conn = null;
        try
        {
            BrokerDetails broker = getBroker();
            broker.setProperty(BrokerDetails.OPTIONS_RETRY, "0");
            conn = new AMQConnection("amqp://guest:guest@clientid/rubbishhost?brokerlist='" + broker + "'");
            fail("Connection should not be established");
        }
        catch (AMQException amqe)
        {
View Full Code Here

Examples of org.apache.qpid.jms.BrokerDetails

        connection.close();
    }

    public void testUnsupportedSASLMechanism() throws Exception
    {
        BrokerDetails broker = getBroker();
        broker.setProperty(BrokerDetails.OPTIONS_SASL_MECHS, "MY_MECH");

        try
        {
            Connection connection = new AMQConnection(broker.toString(), "guest", "guest",
                    null, "test");
            connection.close();
            fail("The client should throw a ConnectionException stating the" +
                " broker does not support the SASL mech specified by the client");
        }
View Full Code Here

Examples of org.apache.qpid.jms.BrokerDetails

     */
    public void testClientIDVerificationForSameUser() throws Exception
    {
        setTestSystemProperty(ClientProperties.QPID_VERIFY_CLIENT_ID, "true");

        BrokerDetails broker = getBroker();
        try
        {
            Connection con = new AMQConnection(broker.toString(), "guest", "guest",
                                        "client_id", "test");

            Connection con2 = new AMQConnection(broker.toString(), "guest", "guest",
                                        "client_id", "test");

            fail("The client should throw a ConnectionException stating the" +
                    " client ID is not unique");
        }
View Full Code Here

Examples of org.apache.qpid.jms.BrokerDetails

     */
    public void testClientIDVerificationForDifferentUsers() throws Exception
    {
        setTestSystemProperty(ClientProperties.QPID_VERIFY_CLIENT_ID, "true");

        BrokerDetails broker = getBroker();
        try
        {
            Connection con = new AMQConnection(broker.toString(), "guest", "guest",
                                        "client_id", "test");

            Connection con2 = new AMQConnection(broker.toString(), "admin", "admin",
                                        "client_id", "test");
        }
        catch (Exception e)
        {
            fail("Unexpected exception thrown, client id was not unique but usernames were different! " + e.getMessage());
View Full Code Here

Examples of org.apache.qpid.jms.BrokerDetails

    public void testExceptionWhenUserPassIsRequired() throws Exception
    {
        AMQConnection conn = null;
        try
        {
            BrokerDetails broker = getBroker();
            String url = "amqp:///test?brokerlist='" + broker + "?sasl_mechs='PLAIN''";
            conn = new AMQConnection(url);
            conn.close();
            fail("Exception should be thrown as user name and password is required");
        }
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.