-
Notifications
You must be signed in to change notification settings - Fork 1.1k
INT-4570: Add MessageCollectionCallback for Mongo #2675
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
JIRA: https://jira.spring.io/browse/INT-4570 The `MongoDbOutboundGateway` is intended to be used with the `requestMessage` context, however using a plain `CollectionCallback` we don't have access to the `requestMessage` * Deprecate `CollectionCallback` usage in favor of newly introduced `MessageCollectionCallback` and `message-collection-callback` for XML **Cherry-pick to 5.0.x**
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.
One issue for your consideration.
@@ -253,6 +253,21 @@ | |||
</xsd:appinfo> | |||
</xsd:annotation> | |||
</xsd:attribute> | |||
<xsd:attribute name="message-collection-callback" type="xsd:string"> |
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.
Why not make MessageCollectionCallback
a sub-interface of CollectionCallback
? - Then we don't need any schema/parser changes. Just determine the type in the CTOR. It can still be a FunctionalInterface
by overriding the basic doInCollection
with a default
.
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.
OK. Let me play with that!
Thanks
`MessageCollectionCallback<T> extends CollectionCallback<T>`
OK. Now you have less files to review 😄 |
Travis test failures. |
reflection collision
So, now it's green. |
Cherry-pick is not clean, unfortunately. |
* INT-4570: Add MessageCollectionCallback for Mongo JIRA: https://jira.spring.io/browse/INT-4570 The `MongoDbOutboundGateway` is intended to be used with the `requestMessage` context, however using a plain `CollectionCallback` we don't have access to the `requestMessage` * Deprecate `CollectionCallback` usage in favor of newly introduced `MessageCollectionCallback` and `message-collection-callback` for XML **Cherry-pick to 5.0.x** * * Remove `message-collection-callback` in favor of `MessageCollectionCallback<T> extends CollectionCallback<T>` * * Rename a new setter to `setMessageCollectionCallback()` to avoid reflection collision # Conflicts: # spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/outbound/MongoDbOutboundGateway.java # spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/config/MongoDbOutboundGatewayParserTests.java # spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/dsl/MongoDbTests.java # spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/outbound/MongoDbOutboundGatewayTests.java # spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/rules/MongoDbAvailableTests.java # src/reference/asciidoc/mongodb.adoc
Cherry-picked to |
JIRA: https://jira.spring.io/browse/INT-4570
The
MongoDbOutboundGateway
is intended to be used with therequestMessage
context, however using a plainCollectionCallback
we don't have access to the
requestMessage
CollectionCallback
usage in favor of newly introducedMessageCollectionCallback
andmessage-collection-callback
for XMLCherry-pick to 5.0.x