ApiController.java 文件源码

java
阅读 40 收藏 0 点赞 0 评论 0

项目:kafka-webview 作者:
/**
 * GET Details for a specific Topic.
 */
@ResponseBody
@RequestMapping(path = "/cluster/{id}/topic/{topic}/details", method = RequestMethod.GET, produces = "application/json")
public TopicDetails getTopicDetails(@PathVariable final Long id, @PathVariable final String topic) {
    // Retrieve cluster
    final Cluster cluster = clusterRepository.findOne(id);
    if (cluster == null) {
        throw new NotFoundApiException("TopicDetails", "Unable to find cluster");
    }

    // Create new Operational Client
    try (final KafkaOperations operations = createOperationsClient(cluster)) {
        return operations.getTopicDetails(topic);
    } catch (final Exception e) {
        throw new ApiException("TopicDetails", e);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号