Skip to content

Commit

Permalink
Merge pull request #4 from piyush280599/piyush280599-patch-4
Browse files Browse the repository at this point in the history
Update EventMeshHttpConsumer.java
  • Loading branch information
piyush280599 authored Feb 27, 2023
2 parents dad245d + 3faec22 commit 8e5e460
Showing 1 changed file with 4 additions and 4 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 (ret.getRetCode() != EventMeshRetCode.SUCCESS.getRetCode()) {
throw new EventMeshException(Object.requireNonNull(ret).getRetCode(), Object.requireNonNull(ret).getRetMsg());
if (Object.requireNonNull(ret).getRetCode() != EventMeshRetCode.SUCCESS.getRetCode()) {
throw new EventMeshException(ret.getRetCode(),ret.getRetMsg());
}
SUBSCRIPTIONS.addAll(topicList);
} catch (Exception ex) {
Expand Down Expand Up @@ -130,7 +130,7 @@ public void heartBeat(final List<SubscriptionItem> topicList, final String subsc
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(Object.requireNonNull(ret).getRetCode(), Object.requireNonNull(ret).getRetMsg());
throw new EventMeshException(ret.getRetCode(),ret.getRetMsg());
}
} catch (Exception e) {
log.error("send heartBeat error", e);
Expand Down Expand Up @@ -158,7 +158,7 @@ public void unsubscribe(final List<String> topicList, final String unSubscribeUr
final EventMeshRetObj ret = JsonUtils.parseObject(unSubRes, EventMeshRetObj.class);

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

0 comments on commit 8e5e460

Please sign in to comment.