本文整理了Java中com.rabbitmq.client.Connection.setId()
方法的一些代码示例,展示了Connection.setId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Connection.setId()
方法的具体详情如下:
包路径:com.rabbitmq.client.Connection
类名称:Connection
方法名:setId
暂无
代码示例来源:origin: com.github.combinedmq/combinedmq
@Override
public void setId(String id) {
connection.setId(id);
}
代码示例来源:origin: spring-projects/spring-amqp
private Connection getConnection(ConnectionFactory connectionFactory) throws IOException, TimeoutException {
Connection connection = connectionFactory.newConnection();
connection.setId(generateId());
return connection;
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit-junit
private Connection getConnection(ConnectionFactory connectionFactory) throws IOException, TimeoutException {
Connection connection = connectionFactory.newConnection();
connection.setId(generateId());
return connection;
}
代码示例来源:origin: spring-projects/spring-amqp
/**
* Remove any test queues that were created by an
* {@link #isRunningWithEmptyQueues(String...)} method.
* @param additionalQueues additional queues to remove that might have been created by
* tests.
*/
public void removeTestQueues(String... additionalQueues) {
List<String> queuesToRemove = Arrays.asList(this.queues);
if (additionalQueues != null) {
queuesToRemove = new ArrayList<>(queuesToRemove);
queuesToRemove.addAll(Arrays.asList(additionalQueues));
}
logger.debug("deleting test queues: " + queuesToRemove);
Connection connection = null; // NOSONAR (closeResources())
Channel channel = null;
try {
connection = getConnection(getConnectionFactory());
connection.setId(generateId() + ".queueDelete");
channel = connection.createChannel();
for (String queue : queuesToRemove) {
channel.queueDelete(queue);
}
}
catch (Exception e) {
logger.warn("Failed to delete queues", e);
}
finally {
closeResources(connection, channel);
}
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit-junit
/**
* Remove any test queues that were created by an
* {@link #isRunningWithEmptyQueues(String...)} method.
* @param additionalQueues additional queues to remove that might have been created by
* tests.
*/
public void removeTestQueues(String... additionalQueues) {
List<String> queuesToRemove = Arrays.asList(this.queues);
if (additionalQueues != null) {
queuesToRemove = new ArrayList<>(queuesToRemove);
queuesToRemove.addAll(Arrays.asList(additionalQueues));
}
logger.debug("deleting test queues: " + queuesToRemove);
Connection connection = null; // NOSONAR (closeResources())
Channel channel = null;
try {
connection = getConnection(getConnectionFactory());
connection.setId(generateId() + ".queueDelete");
channel = connection.createChannel();
for (String queue : queuesToRemove) {
channel.queueDelete(queue);
}
}
catch (Exception e) {
logger.warn("Failed to delete queues", e);
}
finally {
closeResources(connection, channel);
}
}
代码示例来源:origin: spring-projects/spring-amqp
/**
* Delete arbitrary exchanges from the broker.
* @param exchanges the exchanges to delete.
*/
public void deleteExchanges(String... exchanges) {
Connection connection = null; // NOSONAR (closeResources())
Channel channel = null;
try {
connection = getConnection(getConnectionFactory());
connection.setId(generateId() + ".exchangeDelete");
channel = connection.createChannel();
for (String exchange : exchanges) {
channel.exchangeDelete(exchange);
}
}
catch (Exception e) {
logger.warn("Failed to delete queues", e);
}
finally {
closeResources(connection, channel);
}
}
代码示例来源:origin: spring-projects/spring-amqp
/**
* Delete arbitrary queues from the broker.
* @param queues the queues to delete.
*/
public void deleteQueues(String... queues) {
Connection connection = null; // NOSONAR (closeResources())
Channel channel = null;
try {
connection = getConnection(getConnectionFactory());
connection.setId(generateId() + ".queueDelete");
channel = connection.createChannel();
for (String queue : queues) {
channel.queueDelete(queue);
}
}
catch (Exception e) {
logger.warn("Failed to delete queues", e);
}
finally {
closeResources(connection, channel);
}
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit-junit
/**
* Delete arbitrary exchanges from the broker.
* @param exchanges the exchanges to delete.
*/
public void deleteExchanges(String... exchanges) {
Connection connection = null; // NOSONAR (closeResources())
Channel channel = null;
try {
connection = getConnection(getConnectionFactory());
connection.setId(generateId() + ".exchangeDelete");
channel = connection.createChannel();
for (String exchange : exchanges) {
channel.exchangeDelete(exchange);
}
}
catch (Exception e) {
logger.warn("Failed to delete queues", e);
}
finally {
closeResources(connection, channel);
}
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit-junit
/**
* Delete arbitrary queues from the broker.
* @param queues the queues to delete.
*/
public void deleteQueues(String... queues) {
Connection connection = null; // NOSONAR (closeResources())
Channel channel = null;
try {
connection = getConnection(getConnectionFactory());
connection.setId(generateId() + ".queueDelete");
channel = connection.createChannel();
for (String queue : queues) {
channel.queueDelete(queue);
}
}
catch (Exception e) {
logger.warn("Failed to delete queues", e);
}
finally {
closeResources(connection, channel);
}
}
内容来源于网络,如有侵权,请联系作者删除!