[JAVA-2884] ConnectionString streamType not applied to MongoClientSettings Created: 06/Jun/18 Updated: 06/Dec/18 Resolved: 06/Dec/18 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Configuration |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Graeme Rocher | Assignee: | Jeffrey Yemin |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
It seems there is no way to specify the streamType and also provide custom settings to mongo (like the codecs etc.) this is because the method in the com.mongodb.async.client.MongoClients is private:
So if you pass a ConnectionString you cannot specify codecs. If you pass a MongoClientSettings you can specify codecs but not the requestedStreamType
|
| Comments |
| Comment by Jeffrey Yemin [ 06/Dec/18 ] | ||||||||||||||||||||
|
Hi graemerocher Sorry for the slow response on this. We were considering our options, and have decided not to fix this and instead deprecate the streamType query parameter. Please see Hope this doesn't cause too much pain; I think it's the right way to go long term for the driver. | ||||||||||||||||||||
| Comment by Ian Whalen (Inactive) [ 19/Nov/18 ] | ||||||||||||||||||||
|
Putting into investigating for Jeff to figure out whether we can/should do a short term fix here to make streamType work with mongo client settings or just remove streamType. | ||||||||||||||||||||
| Comment by Jeffrey Yemin [ 06/Jun/18 ] | ||||||||||||||||||||
|
OK, I see. I think you'll have to specify the stream type programmatically for now (via MongoClientSettings.Builder#streamFactoryFactory), and we'll address this in an upcoming release.
| ||||||||||||||||||||
| Comment by Graeme Rocher [ 06/Jun/18 ] | ||||||||||||||||||||
|
That is what we are doing, but if you look at the code MongoClients calls connectionString.getStreamType()
And delegates to a private method that is not accessible and there is no public method that takes a settings and a stream type | ||||||||||||||||||||
| Comment by Jeffrey Yemin [ 06/Jun/18 ] | ||||||||||||||||||||
|
The way to do it is to apply the connection string to the MongoClientSettings:
This particular code sample requires the com.mongodb.MongoClientSettings class introduced in the 3.7.1 driver. The code for 3.6 is similar but would use the now deprecated com.mongodb.async.client.MongoClientSettings. |