[JAVA-4239] Allow custom service names with srvServiceName URI option Created: 15/Jul/21  Updated: 28/Oct/23  Resolved: 23/Dec/21

Status: Closed
Project: Java Driver
Component/s: Cluster Management
Affects Version/s: None
Fix Version/s: 4.5.0

Type: New Feature Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: spec-compliance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Duplicate
is duplicated by JAVA-4349 Add prose test for SRV polling with a... Closed
Issue split
split from DRIVERS-521 Allow custom service names with srvSe... Implementing
Quarter: FY22Q3
Upstream Changes Summary:

DRIVERS Ticket Description
We are using DCOS (marathon/mesos) to manage our services. DCOS generates SRV records for our mongos instances under a record that looks like

_mongos-mongodb._tcp.marathon.mesos

However, there's currently no way for me to use this because when I provide a connection url like

mongodb+srv://_mongos-mongodb._tcp.marathon.mesos

the drivers prepend "mongodb._tcp" to the provided url. It's not clear why it's required that the host _must start with "_mongodb._tcp". Why not let the user specify the actual DNS entry to query?

I believe the same issue will exist for multiple orchestration frameworks such as Consul/Nomad and Kubernetes.

Drivers should sync their URI options and seedlist discovery spec tests to this commit. Drivers should accept a new URI option srvServiceName that overrides the default "mongodb" service name for SRV lookup in both discovery and polling.

Backwards Compatibility: Fully Compatible
Documentation Changes: Needed

 Description   

Support a new URI option srvServiceName that overrides the default "mongodb" service name for SRV lookup in both discovery and polling.

Sync URI options and seedlist discovery spec tests to this commit.

Add a prose test for SRV polling with a custom service name as described in this commit.*

 



 Comments   
Comment by Githook User [ 23/Dec/21 ]

Author:

{'name': 'jyemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Update broken Mockito tests

JAVA-4239
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/a4a1960776a9f7e7765448ab38a42aef054f327e

Comment by Githook User [ 23/Dec/21 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Support srvServiceName option for SRV lookups (#843)

JAVA-4239
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/7d591c4a9623244efbdc1f78dade34bc9b142c74

Generated at Thu Feb 08 09:01:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.