-
Notifications
You must be signed in to change notification settings - Fork 1.1k
INT-2426: Add Idempotent Receiver EIP pattern
#1286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Pushed the fix according to Travis complaint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand what you are doing here but when skipDuplicate is false this is really a transformer not a filter.
It makes me feel a bit queasy.
Maybe we can work around it with the namespace ?
<int:idempotent-consumer filter="true|false" />
rather than <idempotent-filter/> as mentioned in the JIRA.
|
Thanks for feedback. You confirmed my concerns. |
|
Actually, do we really need to use an MGS at all? We don't really need to store the whole message, just the key. |
|
Yes, I thought about that too. But it might be really usefull for end application to analize messages in store for cases like Idempotent Receiver. I'm working now under solution to retrieve message from group by filter... |
|
Yes, but remember the MGS has 3 tables; we really only need one table for this use case. |
|
Maybe a |
|
OK. Let's implement it just with |
|
Pushed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a ConcurrentMetadataStore to support concurrency and clustered environments. Use putIfAbsent() for atomicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good.
Let me know if everything other is Ok and I'll add docs tomorrow
|
All ok; except my previous comment about it not really being a filter when |
Yes, as you see I renamed that option to the |
|
|
|
Perhaps it should be an advice rather than a discrete component.
Since we're adding behavior to an endpoint rather than defining a receiver as a component. |
|
Hey! That's cool! Thanks. Will do tomorrow! |
JIRA: https://jira.spring.io/browse/INT-2426 Conflicts: spring-integration-core/src/main/java/org/springframework/integration/IntegrationMessageHeaderAccessor.java
* Move `Idempotent Filtering` logic to the `IdempotentReceiverInterceptor`, which should be applied as a regular AOP `Advice` to the `MessageHandler#handleMessage` * Provide an xml component `<idempotent-receiver>` * Introduce `IdempotentReceiverAutoProxyCreator` to get deal with `IdempotentReceiverInterceptor` and `MessageHandler`s. The `Proxying` logic is based on the mapping between interceptor and `consumer endpoint` `ids` * Introduce `MetadataStoreSelector` along side with `MetadataKeyStrategy` and `ExpressionMetadataKeyStrategy` implementation
|
Pushed. See commit comments. Thank you help anyway! |
|
The annotation support will be soon |
Add `IdempotentReceiverIntegrationTests` in the JMX module to be sure that all proxying works well.
|
Pushed @MessageEndpoint
class MyService {
@ServiceActivator(inputChannel="testChannel")
public Object service(Object payload) {
....
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interceptor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also document that, if not set, the message will proceed with the duplicate message header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I did in the class level JavaDocs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However I see your point: copy/paste artefact 😄
* Rename `IdempotentReceiverAutoProxyCreatorInitializer` * Add support for several `IRI` for the one `MH` * Polishing JavaDocs
|
Pushed. |
|
Pushed Docs |
|
Ready to merge after you review my doc polishing: garyrussell@6bff6b9 |
|
More polish: garyrussell@48d4fe5 |
|
Merged as ff2b15e |
JIRA: https://jira.spring.io/browse/INT-2426
DO NOT MERGE YET
It's just an initial commit, like a PoC to review before further work.