Can't find the the request for http://127.0.0.1:8080/... 's Observer

解决HTTP请求加载CXF和Spring配置文件错误
本文详细阐述了如何解决在尝试加载HTTP请求时遇到的CXF和Spring配置文件未正确加载的问题,提供了排查步骤和解决方案。

Can't find the the request for http://127.0.0.1:8080/... 's Observer

//没有正确加载cxf和spring配置文件

这些代码是我其中的一个服务 @Override public void pageFindNotificationRule(MessageCenter.PageNotificationRuleRequest request, StreamObserver<MessageCenter.PageResponse> responseStreamObserver) { try { List<PushNotificationRule> notificationRuleList = notificationRuleService.pageFindNotificationRuleForMsgCenter(request.getPage(), request.getPageSize()); if (CollectionUtils.isEmpty(notificationRuleList)) { log.info("The PushNotificationRule List is empty, Could not find PushNotificationRule"); MessageCenter.PageResponse emptyResponse = MessageCenter.PageResponse.newBuilder().setHasMore(false).build(); responseStreamObserver.onNext(emptyResponse); responseStreamObserver.onCompleted(); return; } List<MessageCenter.NotificationRuleGrpc> ruleGrpcList = new ArrayList<>(); for (PushNotificationRule notificationRule : notificationRuleList) { ruleGrpcList.add(convertToGrpcRule(notificationRule)); } boolean hasMore = hasMoreData(request.getPage(), request.getPageSize(), notificationRuleList.size()); MessageCenter.PageResponse response = convertToGrpcPageResponse(ruleGrpcList, hasMore); responseStreamObserver.onNext(response); responseStreamObserver.onCompleted(); } catch (IllegalArgumentException e) { log.warn("Page request parameters are invalid", e); responseStreamObserver.onError(Status.INVALID_ARGUMENT.withDescription(e.getMessage()).asRuntimeException()); } catch (Exception e) { log.error("Internal server error", e); responseStreamObserver.onError(Status.INTERNAL.withDescription("Internal server error").asRuntimeException()); } } @Override public void retrieveNotificationRule(MessageCenter.NotificationRuleRequest request, StreamObserver<MessageCenter.NotificationRuleGrpc> rulePOStreamObserver) { try { // 1. 校验请求参数 if (StringUtils.isBlank(request.getAppCategory()) || StringUtils.isBlank(request.getNotificationType())) { throw new IllegalArgumentException("app_category 和 notification_type 不能为空"); } PushNotificationRule pushNotificationRule = notificationRuleService.findNotificationRuleForMsgCenter( request.getNotificationType(), Scenario.PERSISTENT_NOTIFICATION, request.getAppCategory()); // 2. 调用业务层查询规则 MessageCenter.NotificationRuleGrpc notificationRuleGrpc = convertToGrpcRule(pushNotificationRule); rulePOStreamObserver.onNext(notificationRuleGrpc); rulePOStreamObserver.onCompleted(); } catch (Exception e) { log.error("Failed to retrieve notification rule", e); rulePOStreamObserver.onError(Status.INTERNAL.withDescription("服务器错误").asRuntimeException()); } } @Override public void findOneNotificationConfigByNotificationType(MessageCenter.FindOneNotificationRuleRequest request, StreamObserver<MessageCenter.NotificationConfig> observer) { try { if (StringUtils.isBlank(request.getNotificationType())) { throw new IllegalArgumentException("app_category 和 notification_type 不能为空"); } NotificationConfig notificationConfig = notificationRuleService.findNotificationRuleConfigByNotificationType(request.getNotificationType()); MessageCenter.NotificationConfig configGrpc = convertToGrpcConfig(notificationConfig); observer.onNext(configGrpc); observer.onCompleted(); } catch (Exception e) { log.error("Internal server error", e); observer.onError(Status.INTERNAL.withDescription("Internal server error").asRuntimeException()); } }。那我的另一个服务怎么调用这几个接口?
最新发布
09-28
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值