本文整理了Java中com.rabbitmq.client.Channel.addShutdownListener()
方法的一些代码示例,展示了Channel.addShutdownListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channel.addShutdownListener()
方法的具体详情如下:
包路径:com.rabbitmq.client.Channel
类名称:Channel
方法名:addShutdownListener
暂无
代码示例来源:origin: apache/incubator-druid
channel.queueDeclare(queue, durable, exclusive, autoDelete, null);
channel.queueBind(queue, exchange, routingKey);
channel.addShutdownListener(
new ShutdownListener()
代码示例来源:origin: spring-projects/spring-amqp
@Override
public void addShutdownListener(ShutdownListener listener) {
this.delegate.addShutdownListener(listener);
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit
@Override
public void addShutdownListener(ShutdownListener listener) {
this.delegate.addShutdownListener(listener);
}
代码示例来源:origin: spring-projects/spring-amqp
public PublisherCallbackChannelImpl(Channel delegate, ExecutorService executor) {
Assert.notNull(executor, "'executor' must not be null");
delegate.addShutdownListener(this);
this.delegate = delegate;
this.executor = executor;
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit
public PublisherCallbackChannelImpl(Channel delegate, ExecutorService executor) {
Assert.notNull(executor, "'executor' must not be null");
delegate.addShutdownListener(this);
this.delegate = delegate;
this.executor = executor;
}
代码示例来源:origin: net.jodah/lyra
public ChannelHandler(ConnectionHandler connectionHandler, Channel delegate, Config config) {
this.connectionHandler = connectionHandler;
this.delegate = delegate;
this.config = config;
ShutdownListener listener = new ChannelShutdownListener();
shutdownListeners.add(listener);
delegate.addShutdownListener(listener);
}
代码示例来源:origin: jhalterman/lyra
public ChannelHandler(ConnectionHandler connectionHandler, Channel delegate, Config config) {
this.connectionHandler = connectionHandler;
this.delegate = delegate;
this.config = config;
ShutdownListener listener = new ChannelShutdownListener();
shutdownListeners.add(listener);
delegate.addShutdownListener(listener);
}
代码示例来源:origin: spring-projects/spring-amqp
private Channel doCreateBareChannel(ChannelCachingConnectionProxy connection, boolean transactional) {
Channel channel = connection.createBareChannel(transactional);
if (this.publisherConfirms || this.simplePublisherConfirms) {
try {
channel.confirmSelect();
}
catch (IOException e) {
logger.error("Could not configure the channel to receive publisher confirms", e);
}
}
if ((this.publisherConfirms || this.publisherReturns)
&& !(channel instanceof PublisherCallbackChannelImpl)) {
channel = new PublisherCallbackChannelImpl(channel, getChannelsExecutor());
}
if (channel != null) {
channel.addShutdownListener(this);
}
return channel; // NOSONAR - Simple connection throws exception
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit
private Channel doCreateBareChannel(ChannelCachingConnectionProxy connection, boolean transactional) {
Channel channel = connection.createBareChannel(transactional);
if (this.publisherConfirms || this.simplePublisherConfirms) {
try {
channel.confirmSelect();
}
catch (IOException e) {
logger.error("Could not configure the channel to receive publisher confirms", e);
}
}
if ((this.publisherConfirms || this.publisherReturns)
&& !(channel instanceof PublisherCallbackChannelImpl)) {
channel = new PublisherCallbackChannelImpl(channel, getChannelsExecutor());
}
if (channel != null) {
channel.addShutdownListener(this);
}
return channel; // NOSONAR - Simple connection throws exception
}
代码示例来源:origin: Atmosphere/atmosphere-extensions
public void init(AtmosphereConfig config) {
factory = RabbitMQConnectionFactory.getFactory(config);
channel = factory.channel();
channel.addShutdownListener(this);
exchangeName = factory.exchangeName();
restartConsumer();
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit
channel.addShutdownListener(shutdownListener);
ClosingRecoveryListener.addRecoveryListenerIfNecessary(channel);
DefaultConsumer consumer = createConsumer(queueName, channel, future,
代码示例来源:origin: spring-projects/spring-amqp
channel.addShutdownListener(shutdownListener);
ClosingRecoveryListener.addRecoveryListenerIfNecessary(channel);
DefaultConsumer consumer = createConsumer(queueName, channel, future,
代码示例来源:origin: Atmosphere/atmosphere-extensions
connection = connectionFactory.newConnection();
channel = connection.createChannel();
channel.addShutdownListener(this);
代码示例来源:origin: spring-projects/spring-amqp
channel.addShutdownListener(shutdownListener);
channel.basicConsume(replyTo, true, consumerTag, this.noLocalReplyConsumer, true, null, consumer);
Message reply = null;
代码示例来源:origin: org.springframework.amqp/spring-rabbit
channel.addShutdownListener(shutdownListener);
channel.basicConsume(replyTo, true, consumerTag, this.noLocalReplyConsumer, true, null, consumer);
Message reply = null;
代码示例来源:origin: jhalterman/lyra
/**
* Migrates the channel's configuration to the given {@code channel}.
*/
private void migrateConfiguration(Channel channel) throws Exception {
channel.setDefaultConsumer(delegate.getDefaultConsumer());
if (flowBlocked)
channel.flowBlocked();
if (basicQos != null)
basicQos.invoke(channel);
if (confirmSelect)
channel.confirmSelect();
if (txSelect)
channel.txSelect();
synchronized (shutdownListeners) {
for (ShutdownListener listener : shutdownListeners)
channel.addShutdownListener(listener);
}
for (ConfirmListener listener : confirmListeners)
channel.addConfirmListener(listener);
for (FlowListener listener : flowListeners)
channel.addFlowListener(listener);
for (ReturnListener listener : returnListeners)
channel.addReturnListener(listener);
}
代码示例来源:origin: net.jodah/lyra
/**
* Migrates the channel's configuration to the given {@code channel}.
*/
private void migrateConfiguration(Channel channel) throws Exception {
channel.setDefaultConsumer(delegate.getDefaultConsumer());
if (flowBlocked)
channel.flowBlocked();
if (basicQos != null)
basicQos.invoke(channel);
if (confirmSelect)
channel.confirmSelect();
if (txSelect)
channel.txSelect();
synchronized (shutdownListeners) {
for (ShutdownListener listener : shutdownListeners)
channel.addShutdownListener(listener);
}
for (ConfirmListener listener : confirmListeners)
channel.addConfirmListener(listener);
for (FlowListener listener : flowListeners)
channel.addFlowListener(listener);
for (ReturnListener listener : returnListeners)
channel.addReturnListener(listener);
}
代码示例来源:origin: io.druid.extensions/druid-rabbitmq
channel.queueDeclare(queue, durable, exclusive, autoDelete, null);
channel.queueBind(queue, exchange, routingKey);
channel.addShutdownListener(
new ShutdownListener()
内容来源于网络,如有侵权,请联系作者删除!