Package org.apache.qpid.client

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


        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


        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

            String brokerUrl = "amqp://guest:guest@" + virtualHost + "?brokerlist='" + brokerlist + "'";
            try
            {
                AMQConnectionFactory factory = new AMQConnectionFactory(new AMQConnectionURL(brokerUrl));
                _logger.info("connecting to Qpid :" + brokerUrl);
                connection = factory.createConnection();

                // register exception listener
                connection.setExceptionListener(this);

                session = ((AMQConnection) connection).createSession(transacted, ackMode, prefetch);
View Full Code Here

    {
        // in order to trigger the deadlock we need to
        // set a message listener from one thread
        // whilst receiving a message on another thread and on that thread also setting (the same?) message listener
        AMQConnectionFactory acf = new AMQConnectionFactory(connectionString);
        Connection conn = acf.createConnection();
        conn.start();
        sess = conn.createSession(false, org.apache.qpid.jms.Session.NO_ACKNOWLEDGE);
        setSessionListener(topic1, new TestMessageListener());

View Full Code Here

            String brokerUrl = "amqp://guest:guest@" + virtualHost + "?brokerlist='" + brokerlist + "'";
            try
            {
                AMQConnectionFactory factory = new AMQConnectionFactory(new AMQConnectionURL(brokerUrl));
                _logger.info("connecting to Qpid :" + brokerUrl);
                connection = factory.createConnection();

                // register exception listener
                connection.setExceptionListener(this);

                session = ((AMQConnection) connection).createSession(transacted, ackMode, prefetch);
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();

            _connection.setExceptionListener(new ExceptionListener()
            {
                public void onException(JMSException jmse)
                {
View Full Code Here

            String brokerUrl = "amqp://guest:guest@" + virtualHost + "?brokerlist='" + brokerlist + "'";
            try
            {
                AMQConnectionFactory factory = new AMQConnectionFactory(new AMQConnectionURL(brokerUrl));
                _logger.info("connecting to Qpid :" + brokerUrl);
                connection = factory.createConnection();

                // register exception listener
                connection.setExceptionListener(this);

                session = ((AMQConnection) connection).createSession(transacted, ackMode, prefetch);
View Full Code Here

        //Retreive the local factory from the properties file
        // when used with perftest.properties this will be localhost:5672
        AMQConnectionFactory factory = (AMQConnectionFactory) new InitialContext().lookup("default");

        AMQConnection connection = (AMQConnection) factory.createConnection("guest", "guest");

        //Use the AMQConnection Interface to set the prefetch to the number
        // we are sending
        Session session = connection.createSession(false,
                                                   Session.CLIENT_ACKNOWLEDGE,
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

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.