Package org.apache.qpid.amqp_1_0.jms.impl

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl


            executorService.execute(new Runnable() {
                @Override
                public void run() {

                    try {
                        final ConnectionFactoryImpl connectionFactory = new ConnectionFactoryImpl("localhost", port, "admin", "password", null, isUseSslConnector());
                        Connection connection = connectionFactory.createConnection();
                        connection.start();
                        connection.close();
                    } catch (JMSException e) {
                        e.printStackTrace();
                    }
View Full Code Here


        connection.close();
    }

    private Connection createAMQPConnection(int testPort, boolean useSSL) throws JMSException {
        LOG.debug("In createConnection using port {} ssl? {}", testPort, useSSL);
        final ConnectionFactoryImpl connectionFactory = new ConnectionFactoryImpl("localhost", testPort, "admin", "password", null, useSSL);
        final Connection connection = connectionFactory.createConnection();
        connection.setExceptionListener(new ExceptionListener() {
            @Override
            public void onException(JMSException exception) {
                exception.printStackTrace();
            }
View Full Code Here

        connection.close();
    }

    private Connection createAMQPConnection(int testPort, boolean useSSL) throws JMSException {
        LOG.debug("In createConnection using port {} ssl? {}", testPort, useSSL);
        final ConnectionFactoryImpl connectionFactory = new ConnectionFactoryImpl("localhost", testPort, "admin", "password", null, useSSL);
        connectionFactory.setSyncPublish(true);
        final Connection connection = connectionFactory.createConnection();
        connection.setExceptionListener(new ExceptionListener() {
            @Override
            public void onException(JMSException exception) {
                exception.printStackTrace();
            }
View Full Code Here

    protected Connection createConnection(String clientId, boolean syncPublish, boolean useSsl) throws JMSException {

        int brokerPort = getBrokerPort();
        LOG.debug("Creating connection on port {}", brokerPort);
        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", brokerPort, "admin", "password", null, useSsl);

        factory.setSyncPublish(syncPublish);
        factory.setTopicPrefix("topic://");
        factory.setQueuePrefix("queue://");

        final Connection connection = factory.createConnection();
        if (clientId != null && !clientId.isEmpty()) {
            connection.setClientID(clientId);
        }
        connection.setExceptionListener(new ExceptionListener() {
            @Override
View Full Code Here

        createBroker(false);
    }

    private Connection createAMQPConnection() throws JMSException {
        LOG.debug(">>> In createConnection using port {}", port);
        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
        final Connection connection = factory.createConnection();
        connection.setExceptionListener(new ExceptionListener() {
            @Override
            public void onException(JMSException exception) {
                exception.printStackTrace();
            }
View Full Code Here

        super.setUp();
    }

    @Test(timeout = 1 * 60 * 1000)
    public void testSendWithMultipleConsumers() throws Exception {
        ConnectionFactory connectionFactory = new ConnectionFactoryImpl("localhost", port, "admin", "admin");
        Connection connection = connectionFactory.createConnection();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        String destinationName = "topic://AMQ4920Test" + System.currentTimeMillis();
        Destination destination = session.createTopic(destinationName);
        connection.start();

View Full Code Here

    @Override
    public Boolean call() throws Exception {
        LOG.debug(consumerName + " starting");
        Connection connection=null;
        try {
            ConnectionFactory connectionFactory = new ConnectionFactoryImpl("localhost", port, "admin", "admin");
            connection = connectionFactory.createConnection();
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            Destination destination = session.createTopic(destinationName);
            MessageConsumer consumer = session.createConsumer(destination);
            connection.start();
View Full Code Here

        BrokerView adminView = this.brokerService.getAdminView();
        int durableSubscribersAtStart = adminView.getDurableTopicSubscribers().length;
        int inactiveSubscribersAtStart = adminView.getInactiveDurableTopicSubscribers().length;
        LOG.debug(">>>> At Start, durable Subscribers {} inactiveDurableSubscribers {}", durableSubscribersAtStart, inactiveSubscribersAtStart);

        TopicConnectionFactory factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
        Topic topic = new TopicImpl("topic://" + TOPIC_NAME);
        TopicConnection subscriberConnection = factory.createTopicConnection();
        subscriberConnection.setClientID(durableClientId);
        TopicSession subscriberSession = subscriberConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicSubscriber messageConsumer = subscriberSession.createDurableSubscriber(topic, durableSubscriberName);

        assertNotNull(messageConsumer);
View Full Code Here

    @Override
    public void createConnectionFactory(String name) {
        try {
            LOG.debug("Creating a connection factory using port {}", port);
            final ConnectionFactory factory = new ConnectionFactoryImpl("localhost", port, null, null, null, true);
            context.bind(name, factory);
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    }

    @Override
    public void createConnectionFactory(String name) {
        try {
            final ConnectionFactory factory = new ConnectionFactoryImpl("localhost", port, null, null);
            context.bind(name, factory);
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl

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.