[Fix-17912] Fix http plugin cannot send json nested types#17911
Merged
ruanwenjun merged 4 commits intoapache:devfrom Jan 29, 2026
Merged
[Fix-17912] Fix http plugin cannot send json nested types#17911ruanwenjun merged 4 commits intoapache:devfrom
ruanwenjun merged 4 commits intoapache:devfrom
Conversation
|
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) |
Member
Please follow the pull request notice and create an issue first. |
SbloodyS
reviewed
Jan 28, 2026
Member
SbloodyS
left a comment
There was a problem hiding this comment.
Please run mvn spotless:apply to format the code. @Alexander1902
added 3 commits
January 28, 2026 17:06
…lert.http.HttpSender#setMsgInRequestBody is compatible with Map<String,Object>
|
❌ The last analysis has failed. |
|
Awesome work, congrats on your first merged pull request! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"}}.
fix #17912
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
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 omittedLog after modification
[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:1200000You can now send Http messages normally
Pull Request Notice
Pull Request Notice
If your pull request contains incompatible change, you should also add it to
docs/docs/en/guide/upgrade/incompatible.md