Browse Source

fix http alarm msg ignored (#7523)

See https://github.com/apache/dolphinscheduler/issues/7522
3.0.0/version-upgrade
Jiezhi.G 3 years ago committed by GitHub
parent
commit
6562bc9145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java

4
dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java

@ -143,11 +143,11 @@ public final class HttpSender {
* set body params * set body params
*/ */
private void setMsgInRequestBody(String msg) { private void setMsgInRequestBody(String msg) {
try {
ObjectNode objectNode = JSONUtils.parseObject(bodyParams); ObjectNode objectNode = JSONUtils.parseObject(bodyParams);
//set msg content field //set msg content field
objectNode.put(contentField, msg); objectNode.put(contentField, msg);
try { StringEntity entity = new StringEntity(JSONUtils.toJsonString(objectNode), DEFAULT_CHARSET);
StringEntity entity = new StringEntity(bodyParams, DEFAULT_CHARSET);
((HttpPost) httpRequest).setEntity(entity); ((HttpPost) httpRequest).setEntity(entity);
} catch (Exception e) { } catch (Exception e) {
logger.error("send http alert msg exception : {}", e.getMessage()); logger.error("send http alert msg exception : {}", e.getMessage());

Loading…
Cancel
Save