Skip to content
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

Provide a mongodb connector for Syndesis #5337

Closed
heiko-braun opened this issue May 10, 2019 · 17 comments
Closed

Provide a mongodb connector for Syndesis #5337

heiko-braun opened this issue May 10, 2019 · 17 comments
Assignees
Labels
closed/migrated Epic Use by ZenHub, typically also for user stories group/connector Supported camel connectors target/7.5 zenhub/in-progress
Milestone

Comments

@heiko-braun
Copy link
Collaborator

heiko-braun commented May 10, 2019

See also https://issues.jboss.org/browse/ENTESB-11499

As a citizen user I want to be able to connect to MongoDB datastore. I will provide my own connection configuration strings such as:

mongodb://[username:password@]host1[:port1][,...hostN[:portN]]][/[database][?options]]

(See https://docs.mongodb.com/manual/reference/connection-string/)

Acceptance Criteria

  • CRUD support

Stretch items

  • Adhoc queries (regex, range query)
  • Javascript queries
  • Aggregation (Map-reduce)
  • Force ACID Tranactions

--There is an initial draft of the user doc for this feature.
--The writer acknowledges receiving enough information from engineering to write the initial draft of the user doc for this feature.

@heiko-braun heiko-braun added the Epic Use by ZenHub, typically also for user stories label May 10, 2019
@pure-bot pure-bot bot added the notif/triage The issue needs triage. Applied automatically to all new issues. label May 10, 2019
@heiko-braun heiko-braun removed the notif/triage The issue needs triage. Applied automatically to all new issues. label May 16, 2019
@rareddy
Copy link
Contributor

rareddy commented May 16, 2019

From Teiid side the connection properties, I will be interested in capturing will be

mongodb.host=localhost
mongodb.port=27017
mongodb.database=sampledb
mongodb.username=admin
mongodb.password=admin
mongodb.authenticationDatabase=admin

These are in sync with Spring Boot properties

@oscerd
Copy link
Collaborator

oscerd commented May 16, 2019

In camel they are different

@rareddy
Copy link
Contributor

rareddy commented May 16, 2019

I am not concerned if the names are different, but if I can map properties one to one or extract above that would suffice the data virtualization need.

@squakez
Copy link
Contributor

squakez commented Jun 7, 2019

First basic structure and unit testing are showing that upstream component is working fine. However there may be a problem due to the fact that a connection bean is required on the CamelContext. Will provide further analysis.

@squakez squakez added the group/connector Supported camel connectors label Jun 7, 2019
@lburgazzoli
Copy link
Collaborator

lburgazzoli commented Jun 7, 2019 via email

@squakez
Copy link
Contributor

squakez commented Jun 17, 2019

I've created this issue to enhance the upstream component: #5773

@squakez
Copy link
Contributor

squakez commented Jun 17, 2019

@rareddy, about the connection configuration you're mentioning the presence of mongodb.database this would be more typical of an integration configuration (within collection). The user may use the same connection to connect to different databases. Can we keep this out of the list of connection properties? the rest is already configured.

@rareddy
Copy link
Contributor

rareddy commented Jun 17, 2019

@squakez you mean the Collection name? I am not sure I follow use the same configuration to connect to different databases?

squakez added a commit to squakez/syndesis that referenced this issue Jul 29, 2019
squakez added a commit that referenced this issue Jul 30, 2019
* #5640 basic producer and consumer and #6009 verifier

* #5965 spring auto configuration removal

* #5337 Removing useless operation (used for documentation purposes)

* #6274 PR suggestions fixes
@asmigala
Copy link
Contributor

asmigala commented Aug 7, 2019

The current implementation requires that the collection used is a capped collection .

This has several limitations:

  1. capped collections have a specific size and when this is exceeded, the oldest document in the collection is removed
  2. updates to documents stored in a capped collection cannot change the size of the document, i.e. {"_id": 1, "foo": "bar"} cannot be changed to {"_id": 1, "foo": "barX"} because the new document would be longer
  3. documents cannot be deleted from a capped collection

All of this severly limits the usability of this connector, to the point where I do not think we can claim general mongodb support.

@gaughan @squakez

@squakez
Copy link
Contributor

squakez commented Aug 7, 2019

As just discussed in chat, likely capped collection must be used for consumer only. Produced should be used and tested with normal collections. It would be a matter of highlighting in the connector documentation.

@asmigala
Copy link
Contributor

asmigala commented Aug 7, 2019

Ok, so per my current understanding

Operation Capped Collection Regular Collection
create ✔️ ✔️
read ✔️
update ✔️
delete ✔️

@rareddy
Copy link
Contributor

rareddy commented Aug 7, 2019

@squakez is there a limitation to use the capped collection for consumer?

@gaughan
Copy link

gaughan commented Aug 7, 2019

If we know potential breaking changes are needed to complete or add to the matrix above, the connector should be TP until we can refactor.

@squakez
Copy link
Contributor

squakez commented Aug 9, 2019

As mentioned in the requirement document: Integration with Mongo as a consumer: the upstream component feature is limited by the fact that a Mongo collection must be a capped collection with a feature named “Tailable cursor consumer”. We will start with this solution and evolve to Change Streams if we get it required.

The change stream feature is something added lately to the upstream component, and, unfortunately it's only available in camel 3. I made some quick test to see how easy would be to backport to 2.x but, unfortunately there are breaking changes that may require some effort to have it working.

I can give priority to the refactor of the change stream feature to have it working in camel 2.x, though I cannot estimate the effort needed.

@squakez
Copy link
Contributor

squakez commented Aug 22, 2019

I've run some experiment to see the complexity of backporting the feature to from actual 3.0 to 2.x. It seems it's viable, so I'll keep working on that direction and implement the change stream to have the connector GA. I've created an ad-hoc subtask: #6436

@heiko-braun
Copy link
Collaborator Author

@rareddy
Copy link
Contributor

rareddy commented Sep 9, 2019

@heiko-braun @squakez Just FYI, the DV support can NOT be added with out additional support for the default mongodb.database property. This will akin providing the "schema" in the "sql" connector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed/migrated Epic Use by ZenHub, typically also for user stories group/connector Supported camel connectors target/7.5 zenhub/in-progress
Projects
None yet
Development

No branches or pull requests

7 participants