我们有7个微服务通过eventbus进行通信.我们有一个实时的交易顺序:
服务1-> service2-> service3(依此类推.)直到交易被视为已完成
我们必须确保所有交易都发生.
当然,我们可以在任何时候出现失败.因此,我们正在考虑将机制设备重播为"半成品"交易.
这变得棘手.我们考虑的两种方式:
拥有另一个服务(主管服务),它将在我们的实时序列中记录每个部分,并且在交易未完成时(时间超时)足够聪明,以了解我们如何从左点继续
缺点:一个中央服务上有很多"智能"逻辑
每个服务都有重试机制,而每个服务都有自己的服务,并重播它自己直到成功或被解雇
缺点:每个服务上有很多重试重复代码
你有什么专家的想法?
谢谢
java architecture transactions event-driven-design microservices
如何在 Spark 2.2.0 中将字符串数组展平为数据帧的多行?
输入行["foo", "bar"]
val inputDS = Seq("""["foo", "bar"]""").toDF
Run Code Online (Sandbox Code Playgroud)
inputDS.printSchema()
root
|-- value: string (nullable = true)
Run Code Online (Sandbox Code Playgroud)
输入数据集inputDS
inputDS.show(false)
value
-----
["foo", "bar"]
Run Code Online (Sandbox Code Playgroud)
预期输出数据集outputDS
value
-------
"foo" |
"bar" |
Run Code Online (Sandbox Code Playgroud)
我尝试了explode如下所示的功能,但效果不佳
inputDS.select(explode(from_json(col("value"), ArrayType(StringType))))
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
org.apache.spark.sql.AnalysisException: cannot resolve 'jsontostructs(`value`)' due to data type mismatch: Input schema string must be a struct or an array of structs
Run Code Online (Sandbox Code Playgroud)
还尝试了以下方法
inputDS.select(explode(col("value")))
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
org.apache.spark.sql.AnalysisException: cannot resolve 'explode(`value`)' due to data type mismatch: input to function explode should be …Run Code Online (Sandbox Code Playgroud) Skiasharp 可以使用以下方法操作触摸事件:
private void OnTouch(object sender, SKTouchEventArgs args)
Run Code Online (Sandbox Code Playgroud)
通过这种方法,我只能处理一个触摸点坐标:
args.Location.X, args.Location.Y
Run Code Online (Sandbox Code Playgroud)
但如何检测多点触控事件呢?
例如,Android 本机 API 使您能够管理两个手指位置以检测多点触控。
如何使用 SkiaSharp 实现这一目标?
apache-spark ×1
architecture ×1
arrays ×1
java ×1
json ×1
multi-touch ×1
skiasharp ×1
transactions ×1
xamarin ×1