我最近在aggregator
/ choice
块中使用when
时看到了意外的处理器执行顺序。如果我希望choice
块以书面顺序执行,则在aggregator
块之后的处理器将在.process { /* start timer */ }
.choice()
.`when`(somePredicate)
.aggregate(constant(true), someAggregationStrategy)
.completionInterval(1000)
.completeAllOnStop()
.log("post-aggregation") // invoked second
.endChoice()
.otherwise()
// ... some other aggregation strategy
.endChoice()
.end()
.process { /* stop timer */ } // invoked first (and the exchange is not an aggregate exchange)
完成聚合之前被调用。
processor
是否有一种方法可以阻止choice
之后的aggregator
,直到choice
完成为止?我想在when
完成后执行一些常见的逻辑(停止处理计时器),而不必在每个 FileName = filename;
FramesPerSecond = FrameRate;
Codec = Encoder;
this.Quality = Quality;
Height = Screen.PrimaryScreen.WorkingArea.Height;
Width = Screen.PrimaryScreen.WorkingArea.Width;
int moduloHeight = Height % 10;
Height = Height - moduloHeight;
int moduloWidth = Width % 10;
Width = Width - moduloWidth;
块内重复执行。