You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "Alexander1902 (via GitHub)" <gi...@apache.org> on 2026/01/27 11:39:27 UTC

[PR] fix Modify HttpSender.bodyParams generic type to Map [dolphinscheduler]

Alexander1902 opened a new pull request, #17911:
URL: https://github.com/apache/dolphinscheduler/pull/17911

   <!--Thanks very much for contributing to Apache DolphinScheduler, we are happy that you want to help us improve DolphinScheduler! -->
   
   ## Purpose of the pull request
   The original HTTP plugin cannot send JSON nested types. For example, the HTTP plugin can only send JSON like {"msgtype": "text", "content": "test"}, but cannot send JSON like {"msgtype": "text", "text": {"content": "test"}}. 
   
   ## Brief change log
   
   Modify the type of org.apache.dolphinscheduler.plugin.alert.http.HttpSender#bodyParams to Map<String, Object>
   
   ## Verify this pull request
   *Modify the previous log*
   ```shell
   java.lang.IllegalArgumentException: Parse json: {"msgtype":"text", "text":{"content":"测试"}} to type: java.util.Map<java.lang.String, java.lang.String> failed
           at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:295)
           at org.apache.dolphinscheduler.common.utils.JSONUtils.toMap(JSONUtils.java:251)
           at org.apache.dolphinscheduler.plugin.alert.http.HttpSender.paramsValidator(HttpSender.java:72)
           at org.apache.dolphinscheduler.plugin.alert.http.HttpSender.<init>(HttpSender.java:51)
           at org.apache.dolphinscheduler.plugin.alert.http.HttpAlertChannel.process(HttpAlertChannel.java:37) 
           at org.apache.dolphinscheduler.alert.service.AbstractEventSender.syncTestSend(AbstractEventSender.java:166)
           at org.apache.dolphinscheduler.alert.rpc.AlertOperatorImpl.sendTestAlert(AlertOperatorImpl.java:52)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.apache.dolphinscheduler.extract.base.server.ServerMethodInvokerImpl.invoke(ServerMethodInvokerImpl.java:47)
           at org.apache.dolphinscheduler.extract.base.server.JdkDynamicServerHandler.lambda$processReceived$0(JdkDynamicServerHandler.java:117)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:748)
   Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)
    at [Source: (String)"{"msgtype":"text", "text":{"content":"测试"}}"; line: 1, column: 27] (through reference chain: java.util.LinkedHashMap["text"])
           at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
           at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1741)
           at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1515)
           at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1420)
           at com.fasterxml.jackson.databind.DeserializationContext.extractScalarFromObject(DeserializationContext.java:932)
           at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:62)
           at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:11)
           at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:609)
           at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:437)
           at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:32)
           at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
           at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4674)
           at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3629)
           at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3612)
           at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:293)
           ... 15 common frames omitted
   ```
   *Log after modification*
   ```shell
   [INFO] 2026-01-27 19:35:49.761 +0800 org.apache.dolphinscheduler.plugin.alert.http.HttpSender:[166] - sending http alert post request, url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=ea529f1d-f509-4af5-a83e-76d9d642d6bf, header: {Content-Type=application/json}, requestBody: {msgtype=text, text={content=测试}}, contentType: application/json,timeout:1200000
   ```
   You can now send Http messages normally
   ## Pull Request Notice
   [Pull Request Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
   
   If your pull request contains incompatible change, you should also add it to `docs/docs/en/guide/upgrade/incompatible.md`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix Modify HttpSender.bodyParams generic type to Map [dolphinscheduler]

Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on PR #17911:
URL: https://github.com/apache/dolphinscheduler/pull/17911#issuecomment-3808643160

   > Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
   
   Please follow the pull request notice and create an issue first.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix Modify HttpSender.bodyParams generic type to Map [dolphinscheduler]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #17911:
URL: https://github.com/apache/dolphinscheduler/pull/17911#issuecomment-3804689876

   Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix-17912] Fix http plugin cannot send json nested types [dolphinscheduler]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17911:
URL: https://github.com/apache/dolphinscheduler/pull/17911#issuecomment-3815054387

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=17911) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=17911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=17911&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=17911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [66.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=17911&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=17911&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=17911)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix-17912] Fix http plugin cannot send json nested types [dolphinscheduler]

Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun merged PR #17911:
URL: https://github.com/apache/dolphinscheduler/pull/17911


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix-17912] Fix http plugin cannot send json nested types [dolphinscheduler]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17911:
URL: https://github.com/apache/dolphinscheduler/pull/17911#issuecomment-3815054491

   ❌ The last analysis has failed.
   
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=17911)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix-17912] Fix http plugin cannot send json nested types [dolphinscheduler]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #17911:
URL: https://github.com/apache/dolphinscheduler/pull/17911#issuecomment-3815868936

   Awesome work, congrats on your first merged pull request!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org