Skip to content

Commit

Permalink
outbound handle null value
Browse files Browse the repository at this point in the history
  • Loading branch information
SM4991 committed Mar 31, 2023
1 parent 1d76e4a commit f5047ca
Showing 1 changed file with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,30 @@ public void accept(Throwable e) {
}).subscribe(new Consumer<XMessage>() {
@Override
public void accept(XMessage xMessage) {
XMessageDAO dao = XMessageDAOUtils.convertXMessageToDAO(xMessage);
if(xMessage.getApp() != null) {
XMessageDAO dao = XMessageDAOUtils.convertXMessageToDAO(xMessage);

redisCacheService.setXMessageDaoCache(xMessage.getTo().getUserID(), dao);
redisCacheService.setXMessageDaoCache(xMessage.getTo().getUserID(), dao);

xMessageRepo
.insert(dao)
.doOnError(new Consumer<Throwable>() {
@Override
public void accept(Throwable e) {
redisCacheService.deleteXMessageDaoCache(xMessage.getTo().getUserID());
log.error("Exception in xMsg Dao Save:"+e.getMessage());
}
})
.subscribe(new Consumer<XMessageDAO>() {
@Override
public void accept(XMessageDAO xMessageDAO) {
log.info("XMessage Object saved is with sent user ID >> " + xMessageDAO.getUserId());
}
});
} else {
log.info("XMessage -> app is empty");
}

xMessageRepo
.insert(dao)
.doOnError(new Consumer<Throwable>() {
@Override
public void accept(Throwable e) {
redisCacheService.deleteXMessageDaoCache(xMessage.getTo().getUserID());
log.error("Exception in xMsg Dao Save:"+e.getMessage());
}
})
.subscribe(new Consumer<XMessageDAO>() {
@Override
public void accept(XMessageDAO xMessageDAO) {
log.info("XMessage Object saved is with sent user ID >> " + xMessageDAO.getUserId());
}
});
}
});
}
Expand Down

0 comments on commit f5047ca

Please sign in to comment.