-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support callback header #1808
Support callback header #1808
Conversation
improve #1793 |
dad8bba
to
f8bd7d7
Compare
添加callback header 添加callback header 添加callback header 添加callback header
f8bd7d7
to
514b8f5
Compare
|
||
object RestUtils extends Logging with WowLog { | ||
def httpClientPost(urlString: String, data: Map[String, String]): HttpResponse = { | ||
def httpClientPost(urlString: String, data: Map[String, String], headers: Map[String, String]): HttpResponse = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR comment 带上issue 号吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是说commit吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment里面有带
} catch { | ||
case _: Exception => | ||
logError(s"callbackHeader should be returned normally in the byzer callback!") | ||
System.exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.exit(1) ? 这里无法assert吗?或者直接抛错?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修复
@@ -178,7 +187,8 @@ class RestController extends ApplicationController with WowLog with Logging { | |||
RestUtils.httpClientPost(urlString, | |||
Map("stat" -> s"""failed""", | |||
"msg" -> (e.getMessage + "\n" + msgBuffer.mkString("\n")), | |||
"jobInfo" -> JSONTool.toJsonStr(jobInfo))), | |||
"jobInfo" -> JSONTool.toJsonStr(jobInfo)), | |||
Map()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的header为什么是个empty map?
val callbackHeaderString = param("callbackHeader") | ||
var callbackHeader = Map[String,String]() | ||
if (callbackHeaderString != null && callbackHeaderString.nonEmpty){ | ||
callbackHeader = JsonUtils.fromJson[Map[String,String]](callbackHeaderString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里fromJson异常的情况是要block run/script的接口流程吗? 还是要catch住,留个容错模式
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该抛出,callbackHeader设置的不对会影响后续的callback
添加callback header支持