INT-4489: MessageHistory: Allow runtime beans

JIRA: https://jira.spring.io/browse/INT-4489

Make `MessageHistoryConfigurer` as a `BeanPostProcessor` and apply
tracking logic to processed beans if it is already started.

**Cherry-pick to 5.0.x**
This commit is contained in:
Artem Bilan
2018-06-22 13:26:08 -04:00
committed by Gary Russell
parent e6a35c4a60
commit 07c32ae93b
3 changed files with 75 additions and 47 deletions

View File

@@ -73,8 +73,7 @@ This feature might be useful to temporarily turn on history to analyze a system.
The MBean's object name is `"<domain>:name=messageHistoryConfigurer,type=MessageHistoryConfigurer"`.
IMPORTANT: If multiple beans (declared by `@EnableMessageHistory` and/or `<message-history/>`) they all must have identical component name patterns (when trimmed and sorted).
*Do not use a generic
`<bean/>` definition for the `MessageHistoryConfigurer`*.
*Do not use a generic `<bean/>` definition for the `MessageHistoryConfigurer`*.
NOTE: Remember that by definition the Message History header is immutable (you can't re-write history, although some try).
Therefore, when writing Message History values, the components are either creating brand new Messages (when the component is an origin), or they are copying the history from a request Message, modifying it and setting the new list on a reply Message.