本文整理匯總了Java中org.springframework.amqp.rabbit.connection.CachingConnectionFactory.setPassword方法的典型用法代碼示例。如果您正苦於以下問題:Java CachingConnectionFactory.setPassword方法的具體用法?Java CachingConnectionFactory.setPassword怎麽用?Java CachingConnectionFactory.setPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.amqp.rabbit.connection.CachingConnectionFactory
的用法示例。
在下文中一共展示了CachingConnectionFactory.setPassword方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAmqpConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
ConnectionFactory getAmqpConnectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host, port);
LOGGER.info("Creating AMQP connection factory on host {}:{}", host, port);
if (!username.isEmpty()) {
connectionFactory.setUsername(username);
LOGGER.info("Logging to AMQP with username ", username);
} else {
LOGGER.warn("Logging to AMQP with NO username");
}
if (!password.isEmpty()) {
connectionFactory.setPassword(password);
LOGGER.info("Logging to AMQP with password {}", password.replaceAll(".", "*"));
} else {
LOGGER.warn("Logging to AMQP with NO password");
}
return connectionFactory;
}
示例2: rabbitConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
ConnectionFactory rabbitConnectionFactory(final RabbitMqSetupService rabbitmqSetupService) {
final CachingConnectionFactory factory = new CachingConnectionFactory();
factory.setHost(rabbitmqSetupService.getHostname());
factory.setPort(5672);
factory.setUsername(rabbitmqSetupService.getUsername());
factory.setPassword(rabbitmqSetupService.getPassword());
try {
factory.setVirtualHost(rabbitmqSetupService.createVirtualHost());
// All exception are catched. The BrokerRunning decide if the
// test should break or not
} catch (@SuppressWarnings("squid:S2221") final Exception e) {
Throwables.propagateIfInstanceOf(e, AlivenessException.class);
LOG.error("Cannot create virtual host {}", e.getMessage());
}
return factory;
}
示例3: rabbitConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public ConnectionFactory rabbitConnectionFactory() {
com.rabbitmq.client.ConnectionFactory cf = new com.rabbitmq.client.ConnectionFactory();
cf.setNetworkRecoveryInterval(rabbitNetworkRecoveryInterval);
cf.setRequestedHeartbeat(rabbitHeartbeatInterval);
CachingConnectionFactory connectionFactory = new CachingConnectionFactory(cf);
connectionFactory.setVirtualHost(rabbitVirtualHost);
connectionFactory.setAddresses(rabbitAddresses);
connectionFactory.setUsername(rabbitUsername);
connectionFactory.setPassword(rabbitPassword);
connectionFactory.setPublisherConfirms(publisherConfirms);
connectionFactory.setConnectionTimeout(rabbitConnectionTimeout);
connectionFactory.setChannelCheckoutTimeout(rabbitChannelCheckoutTimeout);
connectionFactory.setCloseTimeout(rabbitCloseTimeout);
return connectionFactory;
}
示例4: rabbitConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public ConnectionFactory rabbitConnectionFactory(
@Value("${rabbitMq.connection.host}") String host,
@Value("${rabbitMq.connection.port}") Integer port,
@Value("${rabbitMq.connection.username:}") String username,
@Value("${rabbitMq.connection.password:}") String password
) {
CachingConnectionFactory connectionFactory =
new CachingConnectionFactory(host, port);
connectionFactory.setUsername(username);
connectionFactory.setPassword(password);
connectionFactory.setChannelCacheSize(1);
List<ChannelListener> listeners = new LinkedList<>();
listeners.add(
(channel, transactional) -> log.info("Channel created; Number: " + channel.getChannelNumber())
);
connectionFactory.setChannelListeners(listeners);
this.connectionFactory = connectionFactory;
return connectionFactory;
}
示例5: connectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public ConnectionFactory connectionFactory() {
final URI ampqUrl;
try {
ampqUrl = new URI(getEnvOrThrow("CLOUDAMQP_URL"));
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
final CachingConnectionFactory factory = new CachingConnectionFactory();
factory.setUsername(ampqUrl.getUserInfo().split(":")[0]);
factory.setPassword(ampqUrl.getUserInfo().split(":")[1]);
factory.setHost(ampqUrl.getHost());
factory.setPort(ampqUrl.getPort());
factory.setVirtualHost(ampqUrl.getPath().substring(1));
factory.setPublisherReturns(true);
return factory;
}
示例6: connectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
ConnectionFactory connectionFactory() {
CachingConnectionFactory factory = new CachingConnectionFactory();
factory.setUsername(username);
factory.setPassword(password);
factory.setAddresses(addresses);
return factory;
}
示例7: getConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean(name = "connectionFactory")
public ConnectionFactory getConnectionFactory() {
CachingConnectionFactory factory = new CachingConnectionFactory();
factory.setHost(rabbitMQProperties.getHost());
factory.setUsername(rabbitMQProperties.getUsername());
factory.setPassword(rabbitMQProperties.getPassword());
factory.setVirtualHost(rabbitMQProperties.getVhost());
factory.setPublisherConfirms(true);
factory.setPublisherReturns(true);
return factory;
}
示例8: rabbitMQConnection
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public CachingConnectionFactory rabbitMQConnection(){
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
return connectionFactory;
}
開發者ID:MarcinStachowiak,項目名稱:spring-integration-dsl-samle,代碼行數:10,代碼來源:AbstractNotificationFlowConfiguration.java
示例9: commandBusConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public ConnectionFactory commandBusConnectionFactory() {
log.info("Creating command bus connection on hostname: {" + this.hostname + "}");
final CachingConnectionFactory connectionFactory = new CachingConnectionFactory(this.hostname, this.port);
connectionFactory.setUsername(this.username);
connectionFactory.setPassword(this.password);
return connectionFactory;
}
示例10: eventBusConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public ConnectionFactory eventBusConnectionFactory() {
log.info("Creating query event bus connection on hostname: {" + this.hostname + "}");
final CachingConnectionFactory connectionFactory = new CachingConnectionFactory(this.hostname, this.port);
connectionFactory.setUsername(this.username);
connectionFactory.setPassword(this.password);
return connectionFactory;
}
示例11: getConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public ConnectionFactory getConnectionFactory() {
log.info("Creating rabbit connection for command bus, publishing, on host: {" + this.hostname + "}");
final CachingConnectionFactory connectionFactory = new CachingConnectionFactory(this.hostname, this.port);
connectionFactory.setUsername(this.username);
connectionFactory.setPassword(this.password);
return connectionFactory;
}
示例12: eventBusConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
@Primary
public ConnectionFactory eventBusConnectionFactory() {
log.info("Creating event bus connection on hostname: {" + this.hostname + "}");
final CachingConnectionFactory connectionFactory = new CachingConnectionFactory(this.hostname, this.port);
connectionFactory.setUsername(this.username);
connectionFactory.setPassword(this.password);
return connectionFactory;
}
示例13: outConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public ConnectionFactory outConnectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host);
connectionFactory.setUsername(userName);
connectionFactory.setPassword(userPassword);
connectionFactory.setVirtualHost(virtualHost);
return connectionFactory;
}
示例14: serverConnectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public ConnectionFactory serverConnectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host);
connectionFactory.setUsername(userName);
connectionFactory.setPassword(userPassword);
connectionFactory.setVirtualHost(virtualHost);
return connectionFactory;
}
示例15: connectionFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; //導入方法依賴的package包/類
@Bean
public CachingConnectionFactory connectionFactory() {
CachingConnectionFactory bean = new CachingConnectionFactory(env.getProperty("rabbitmq.hostname"), Integer.parseInt(env.getProperty("rabbitmq.port")));
bean.setUsername(env.getProperty("rabbitmq.username"));
bean.setPassword(env.getProperty("rabbitmq.password"));
return bean;
}