Package org.apache.qpid.client

Examples of org.apache.qpid.client.AMQConnectionFactory.createConnection()


        catch(Exception e)
        {
            // ignore
        }
       
        AMQConnection con3 = (AMQConnection)factory.createConnection();
        assertEquals("Usernames used is different from the one in URL","guest",con3.getConnectionURL().getUsername());
        assertEquals("Password used is different from the one in URL","guest",con3.getConnectionURL().getPassword());
    }
   
}
View Full Code Here


        String newUrl = String.format(newUrlFormat, origBrokerDetails.getHost(), origBrokerDetails.getPort(),
                                                    retries, connectdelay, cycleCount);

        ConnectionFactory connectionFactory = new AMQConnectionFactory(newUrl);
        AMQConnection connection = (AMQConnection) connectionFactory.createConnection("admin", "admin");
        connection.setConnectionListener(this);
        return connection;
    }

    /**
 
View Full Code Here

            _contextHelper = new InitialContextHelper(null);
            InitialContext ctx = _contextHelper.getInitialContext();

            //then create a connection using the AMQConnectionFactory
            AMQConnectionFactory cf = (AMQConnectionFactory) ctx.lookup("local");
            _connection = cf.createConnection();

            //create a transactional session
            _session = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);

            //lookup the example queue and use it
View Full Code Here

            _contextHelper = new InitialContextHelper(null);
            InitialContext ctx = _contextHelper.getInitialContext();

            //then create a connection using the AMQConnectionFactory
            AMQConnectionFactory cf = (AMQConnectionFactory) ctx.lookup("local");
            _connection = cf.createConnection();

            //create a transactional session
            _session = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);

            //lookup the example queue and use it
View Full Code Here

    {
        AMQConnectionFactory factory = new AMQConnectionFactory();

        try
        {
            factory.createConnection();
            fail("Expected exception not thrown");
        }
        catch(JMSException e)
        {
            assertEquals("Unexpected exception", AMQConnectionFactory.NO_URL_CONFIGURED, e.getMessage());
View Full Code Here

       
        String brokerUrl = getBroker().toString();
        String URL = "amqp://guest:guest@clientID/test?brokerlist='" + brokerUrl + "'";
        AMQConnectionFactory factory = new AMQConnectionFactory(URL);
       
        AMQConnection con = (AMQConnection)factory.createConnection();
        assertEquals("Usernames used is different from the one in URL","guest",con.getConnectionURL().getUsername());
        assertEquals("Password used is different from the one in URL","guest",con.getConnectionURL().getPassword());
    
        try
        {
View Full Code Here

        assertEquals("Usernames used is different from the one in URL","guest",con.getConnectionURL().getUsername());
        assertEquals("Password used is different from the one in URL","guest",con.getConnectionURL().getPassword());
    
        try
        {
            AMQConnection con2 = (AMQConnection)factory.createConnection("user","pass");
            assertEquals("Usernames used is different from the one in URL","user",con2.getConnectionURL().getUsername());
            assertEquals("Password used is different from the one in URL","pass",con2.getConnectionURL().getPassword());
        }
        catch(Exception e)
        {
View Full Code Here

        catch(Exception e)
        {
            // ignore
        }
       
        AMQConnection con3 = (AMQConnection)factory.createConnection();
        assertEquals("Usernames used is different from the one in URL","guest",con3.getConnectionURL().getUsername());
        assertEquals("Password used is different from the one in URL","guest",con3.getConnectionURL().getPassword());
    }

    /**
 
View Full Code Here

        String url = "amqp://guest:guest@clientID/test?brokerlist='" + broker + "'";

        AMQConnectionFactory factory = new AMQConnectionFactory();
        factory.setConnectionURLString(url);

        Connection con = factory.createConnection();
        con.close();
    }
}
View Full Code Here

        String newUrl = String.format(newUrlFormat, origBrokerDetails.getHost(), origBrokerDetails.getPort(),
                                                    retries, connectdelay, cycleCount);

        ConnectionFactory connectionFactory = new AMQConnectionFactory(newUrl);
        AMQConnection connection = (AMQConnection) connectionFactory.createConnection("admin", "admin");
        connection.setConnectionListener(this);
        return connection;
    }

    /**
 
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.