My business logic should be able to change the configured group timeout on the aggregator.
The code looks like this:
@Autowired AggregatingMessageHandler messagesAgazilator; Public Zero Settime (integer timeout value) {Expression timeout expression = new spell expense parser (). ParseExpression (timeoutValue.toString ()); MessageAggregator.setGroupTimeoutExpression (timeoutExpression); }
The problem is:
- I want to present the current value to the user, but ...
- Possible solution scenarios :
- Should I put an expression on this vein and change its value,
- Which means, the next time a message group is created, Can re-evaluate the expression with the result?
- Should I expand the aggregating message handle with my own handler in which there is a public setter?
- Or is it a bug and should it be fixed on the next release?
- Should I put an expression on this vein and change its value,
Not sure why you call it a bug, but your requirement Not standard.
Try to come together with some solution!
Since you want to convert group-timeout
to runtime and you actually have a expression
, your value is just integer
You can use org.springframework.integration.expression.ValueExpression
as the value
atomic reference
Code> Bean.
In this case, you just the existing value to the user
:
@Unible Private Atomic References & lt; Value Expression & gt; GroupTimeoutExpression; .... this.groupTimeoutExpression.get (). GetValue ();
For the existing value, use that code for a new value expansion
and AggregatingMessageHandler
.
At the application startup, you should do this for the initial group-timeout
. Or lift; Aggregator & gt; Copy / paste in
and value
in the group-timeout
attribute for AtomicReference Bean.
HH
No comments:
Post a Comment