Commit 6c60bd03 authored by 赵威's avatar 赵威

add try

parent 30105256
...@@ -45,7 +45,6 @@ object Main extends LazyLogging { ...@@ -45,7 +45,6 @@ object Main extends LazyLogging {
"172.16.44.25:9092,172.16.44.31:9092,172.16.44.45:9092" "172.16.44.25:9092,172.16.44.31:9092,172.16.44.45:9092"
) )
// TODO remove test
val kafkaConsumer = new FlinkKafkaConsumer[UserInfo]( val kafkaConsumer = new FlinkKafkaConsumer[UserInfo](
"gm-portrait-update-device", "gm-portrait-update-device",
new UserInfoDeserializationSchema, new UserInfoDeserializationSchema,
......
...@@ -13,20 +13,23 @@ object DingTalk { ...@@ -13,20 +13,23 @@ object DingTalk {
msg: Map[String, String], msg: Map[String, String],
contentType: String = "msg", contentType: String = "msg",
mobiles: List[String] = List.empty[String] mobiles: List[String] = List.empty[String]
): Unit = { ): Unit =
val url = mkUrl(contentType) try {
val builder = StringBuilder.newBuilder val url = mkUrl(contentType)
builder.append("StreamingUserPortrait:\n") val builder = StringBuilder.newBuilder
builder.append("StreamingUserPortrait:\n")
for ((k, v) <- msg) { for ((k, v) <- msg) {
builder.append(k) builder.append(k)
builder.append(": ") builder.append(": ")
builder.append(v) builder.append(v)
builder.append("\n") builder.append("\n")
} }
makeRequest(builder.toString, contentType) makeRequest(builder.toString, contentType)
} } catch {
case e: Throwable => e.printStackTrace()
}
def makeRequest(msg: String, contentType: String): Unit = def makeRequest(msg: String, contentType: String): Unit =
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment