当一个消费者取消订阅时的回调接口;取消消费者订阅队列时除了使用{@linkChannel#basicCancel}之外的所有方式都会调用该回调方法
CancelCallback是一个函数式接口,具体的实现需要开发者自己实现:
@FunctionalInterface
public interface CancelCallback {
/**
* Called when the consumer is cancelled for reasons other than by a call to
* {@link Channel#basicCancel}. For example, the queue has been deleted.
* See {@link Consumer#handleCancelOk} for notification of consumer
* cancellation due to {@link Channel#basicCancel}.
* @param consumerTag the consumer tag associated with the consumer
* @throws IOException
*/
void handle(String consumerTag) throws IOException;
}
GitHub地址:https://githucom/mingyang66/spring-parent/blob/master/spring-boot-control-通达信交易接口的前世,rabbitmq-service/RabbitMQ%E6%B6%88%E8%B4%B9%E7%AB%AFCancelCallback%E5%9B%9E%E8%B0%83%E6%8E%A5%E5%8F%A3%E8%AF%A6%E8%A7%Amd
文章为作者独立观点,不代表股票交易接口观点