Skip to content

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

Merged
merged 3 commits into from
Dec 21, 2018

Conversation

artembilan
Copy link
Member

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

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**
Copy link
Contributor

@garyrussell garyrussell left a 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">
Copy link
Contributor

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.

Copy link
Member Author

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>`
@artembilan
Copy link
Member Author

OK. Now you have less files to review 😄

@garyrussell
Copy link
Contributor

Travis test failures.

@artembilan
Copy link
Member Author

So, now it's green.

@garyrussell garyrussell merged commit 1943c15 into spring-projects:master Dec 21, 2018
@garyrussell
Copy link
Contributor

Cherry-pick is not clean, unfortunately.

artembilan added a commit that referenced this pull request Dec 21, 2018
* 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
@artembilan
Copy link
Member Author

Cherry-picked to 5.0.x as d5dd0a1 after fixing conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants