You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/01/26 00:38:23 UTC
[GitHub] sijie commented on a change in pull request #1112: Broker schema registry (1/3)
sijie commented on a change in pull request #1112: Broker schema registry (1/3)
URL: https://github.com/apache/incubator-pulsar/pull/1112#discussion_r164008682
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
##########
@@ -422,52 +428,59 @@ protected void handleSubscribe(final CommandSubscribe subscribe) {
}
}
- service.getTopic(topicName).thenCompose(topic -> topic.subscribe(ServerCnx.this, subscriptionName,
- consumerId, subType, priorityLevel, consumerName, isDurable, startMessageId, metadata))
- .thenAccept(consumer -> {
- if (consumerFuture.complete(consumer)) {
- log.info("[{}] Created subscription on topic {} / {}", remoteAddress, topicName,
- subscriptionName);
- ctx.writeAndFlush(Commands.newSuccess(requestId), ctx.voidPromise());
- } else {
- // The consumer future was completed before by a close command
- try {
- consumer.close();
- log.info("[{}] Cleared consumer created after timeout on client side {}",
- remoteAddress, consumer);
- } catch (BrokerServiceException e) {
- log.warn("[{}] Error closing consumer created after timeout on client side {}: {}",
- remoteAddress, consumer, e.getMessage());
- }
- consumers.remove(consumerId, consumerFuture);
- }
-
- }) //
- .exceptionally(exception -> {
- if (exception.getCause() instanceof ConsumerBusyException) {
- if (log.isDebugEnabled()) {
- log.debug(
- "[{}][{}][{}] Failed to create consumer because exclusive consumer is already connected: {}",
- remoteAddress, topicName, subscriptionName,
- exception.getCause().getMessage());
- }
- } else {
- log.warn("[{}][{}][{}] Failed to create consumer: {}", remoteAddress, topicName,
- subscriptionName, exception.getCause().getMessage(), exception);
- }
+ service.getTopic(topicName).thenCompose(topic ->
Review comment:
Can I confirm that the change here is only adding a `thenApply` to convert `Consumer` to `TopicConsumer`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services