Skip to content

Commit

Permalink
Update EventMeshHttpConsumer.java
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush280599 committed Mar 3, 2023
1 parent 8e5e460 commit 3939f92
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public void subscribe(final List<SubscriptionItem> topicList, final String subsc
try {
final String subRes = HttpUtils.post(httpClient, target, subscribeParam);
final EventMeshRetObj ret = JsonUtils.parseObject(subRes, EventMeshRetObj.class);
if (Object.requireNonNull(ret).getRetCode() != EventMeshRetCode.SUCCESS.getRetCode()) {
throw new EventMeshException(ret.getRetCode(),ret.getRetMsg());
if (Objects.requireNonNull(ret).getRetCode() != EventMeshRetCode.SUCCESS.getRetCode()) {
throw new EventMeshException(ret.getRetCode(), ret.getRetMsg());
}
SUBSCRIPTIONS.addAll(topicList);
} catch (Exception ex) {
Expand Down Expand Up @@ -129,8 +129,8 @@ public void heartBeat(final List<SubscriptionItem> topicList, final String subsc
final String target = selectEventMesh();
final String res = HttpUtils.post(httpClient, target, requestParam);
final EventMeshRetObj ret = JsonUtils.parseObject(res, EventMeshRetObj.class);
if (EventMeshRetCode.SUCCESS.getRetCode() != Object.requireNonNull(ret).getRetCode()) {
throw new EventMeshException(ret.getRetCode(),ret.getRetMsg());
if (EventMeshRetCode.SUCCESS.getRetCode() != Objects.requireNonNull(ret).getRetCode()) {
throw new EventMeshException(ret.getRetCode(), ret.getRetMsg());
}
} catch (Exception e) {
log.error("send heartBeat error", e);
Expand All @@ -157,8 +157,8 @@ public void unsubscribe(final List<String> topicList, final String unSubscribeUr
final String unSubRes = HttpUtils.post(httpClient, target, unSubscribeParam);
final EventMeshRetObj ret = JsonUtils.parseObject(unSubRes, EventMeshRetObj.class);

if (EventMeshRetCode.SUCCESS.getRetCode() != Object.requireNonNull(ret).getRetCode()) {
throw new EventMeshException(ret.getRetCode(),ret.getRetMsg());
if (EventMeshRetCode.SUCCESS.getRetCode() != Objects.requireNonNull(ret).getRetCode()) {
throw new EventMeshException(ret.getRetCode(), ret.getRetMsg());
}
// todo: avoid concurrentModifiedException
SUBSCRIPTIONS.removeIf(item -> topicList.contains(item.getTopic()));
Expand Down

0 comments on commit 3939f92

Please sign in to comment.