/** * For compatibility and users used to this kind of constructor */ public ActiveMQConnectionFactory(String url, String user, String password) { this(url); setUser(user).setPassword(password); }
private void setBrokerURL(String brokerURL) { ConnectionFactoryParser cfParser = new ConnectionFactoryParser(); try { URI uri = cfParser.expandURI(brokerURL); serverLocator = ServerLocatorImpl.newLocator(uri); cfParser.populateObject(uri, this); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } if (getUser() == null) { setUser(DefaultConnectionProperties.DEFAULT_USER); } if (getPassword() == null) { setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD); } }
/** * For compatibility and users used to this kind of constructor */ public ActiveMQConnectionFactory(String url, String user, String password) { this(url); setUser(user).setPassword(password); }
/** * For compatibility and users used to this kind of constructor */ public ActiveMQConnectionFactory(String url, String user, String password) { this(url); setUser(user).setPassword(password); }
/** * For compatibility and users used to this kind of constructor */ public ActiveMQConnectionFactory(String url, String user, String password) { this(url); setUser(user).setPassword(password); }
/** * For compatibility and users used to this kind of constructor */ public ActiveMQConnectionFactory(String url, String user, String password) { this(url); setUser(user).setPassword(password); }
private void setBrokerURL(String brokerURL) { ConnectionFactoryParser cfParser = new ConnectionFactoryParser(); try { URI uri = cfParser.expandURI(brokerURL); serverLocator = ServerLocatorImpl.newLocator(uri); cfParser.populateObject(uri, this); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } if (getUser() == null) { setUser(DefaultConnectionProperties.DEFAULT_USER); } if (getPassword() == null) { setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD); } }
private void setBrokerURL(String brokerURL) { ConnectionFactoryParser cfParser = new ConnectionFactoryParser(); try { URI uri = cfParser.expandURI(brokerURL); serverLocator = ServerLocatorImpl.newLocator(uri); cfParser.populateObject(uri, this); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } if (getUser() == null) { setUser(DefaultConnectionProperties.DEFAULT_USER); } if (getPassword() == null) { setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD); } }
private void setBrokerURL(String brokerURL) { ConnectionFactoryParser cfParser = new ConnectionFactoryParser(); try { URI uri = cfParser.expandURI(brokerURL); serverLocator = ServerLocatorImpl.newLocator(uri); cfParser.populateObject(uri, this); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } if (getUser() == null) { setUser(DefaultConnectionProperties.DEFAULT_USER); } if (getPassword() == null) { setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD); } }
private ActiveMQConnectionFactory getActiveMQConnectionFactory(String user, String password) { ActiveMQConnectionFactory activeMQConnection = new ActiveMQConnectionFactory("tcp://localhost:61616"); activeMQConnection.setUser(user); activeMQConnection.setPassword(password); return activeMQConnection; }
private void setBrokerURL(String brokerURL) { ConnectionFactoryParser cfParser = new ConnectionFactoryParser(); try { URI uri = cfParser.expandURI(brokerURL); serverLocator = ServerLocatorImpl.newLocator(uri); cfParser.populateObject(uri, this); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } if (getUser() == null) { setUser(DefaultConnectionProperties.DEFAULT_USER); } if (getPassword() == null) { setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD); } }
private ActiveMQConnectionFactory createConnectionFactory() throws Exception { Map<String, Object> params = new HashMap<>(); params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "1"); final ActiveMQConnectionFactory activeMQConnectionFactory; if (configuration.getUrl() != null) { activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactory(configuration.getUrl(), null); } else { if (configuration.getHost() != null) { params.put(TransportConstants.HOST_PROP_NAME, configuration.getHost()); params.put(TransportConstants.PORT_PROP_NAME, configuration.getPort()); } if (configuration.isHa()) { activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params)); } else { activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params)); } } if (configuration.hasAuthentication()) { activeMQConnectionFactory.setUser(configuration.getUsername()); activeMQConnectionFactory.setPassword(configuration.getPassword()); } // The CF will probably be GCed since it was injected, so we disable the finalize check return activeMQConnectionFactory.disableFinalizeChecks(); } }
private ActiveMQConnectionFactory createConnectionFactory() throws Exception { Map<String, Object> params = new HashMap<>(); params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "1"); final ActiveMQConnectionFactory activeMQConnectionFactory; if (configuration.getUrl() != null) { activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactory(configuration.getUrl(), null); } else { if (configuration.getHost() != null) { params.put(TransportConstants.HOST_PROP_NAME, configuration.getHost()); params.put(TransportConstants.PORT_PROP_NAME, configuration.getPort()); } if (configuration.isHa()) { activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params)); } else { activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params)); } } if (configuration.hasAuthentication()) { activeMQConnectionFactory.setUser(configuration.getUsername()); activeMQConnectionFactory.setPassword(configuration.getPassword()); } // The CF will probably be GCed since it was injected, so we disable the finalize check return activeMQConnectionFactory.disableFinalizeChecks(); } }
factory.setClientID(clientID); factory.setUser(user); factory.setPassword(password); factory.setClientFailureCheckPeriod(clientFailureCheckPeriod); factory.setConnectionTTL(connectionTTL);