oscerd opened a new pull request, #31117:
URL: https://github.com/apache/camel/pull/31117
## Description
The client that camel-azure-cosmosdb builds from `databaseEndpoint` always
worked in the direct mode, which connects
over TCP to the replicas of the account, and the component had no option to
change it. A route could therefore not use
the component's own client where only the gateway mode works: behind a
firewall that lets HTTPS only through, or against
an emulator that serves the gateway mode only, such as the Floci AZ
container of the integration tests. There,
`createDatabase` fails with 501 on `GET
/addresses/?$resolveFor=dbs&$filter=protocol eq rntbd`. Such a route had to bind
a `cosmosAsyncClient` of its own. Croway found it in the review of #29249.
This PR:
- adds a `connectionMode` option, `DIRECT` by default as before, or
`GATEWAY` (`com.azure.cosmos.ConnectionMode`), which
`CosmosDbClientFactory` applies to the client it builds. Like the other
options of the client, it does not apply to a
client set in `cosmosAsyncClient`, as the description of that option now
says;
- documents it in a "Connection mode" section of the component page;
- adds `CosmosDbConnectionModeIT`: the component builds its own client from
the endpoint and the key of the account,
with `connectionMode=GATEWAY`, and creates a database;
- regenerates the catalog, the component and endpoint DSLs and the
configurers.
The direct mode stays the default, so nothing changes for existing routes.
## Testing
- `CosmosDbConnectionModeIT` passes against Floci AZ. With
`CosmosDbClientFactory` ignoring the option, it fails with the
501 of the direct mode (`This operation is not supported by the floci
...`).
- The unit tests of camel-azure-cosmosdb pass.
- Full reactor build.
_Claude Code on behalf of Andrea Cosentino_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]