oscerd commented on code in PR #28217:
URL: https://github.com/apache/camel/pull/28217#discussion_r4334911274


##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc:
##########
@@ -250,6 +250,16 @@ as the body, so `+${body}+` was the file found. A 
`fileName` that uses the file
 before. A `fileName` that read the file found through its headers, such as 
`${header.CamelFileName}`, must use the file
 functions instead (`${file:name}`).
 
+=== camel-google-mail, camel-google-drive, camel-google-calendar, 
camel-google-sheets - one API client per endpoint options
+
+The `google-mail`, `google-mail-stream`, `google-drive`, `google-calendar`, 
`google-calendar-stream`, `google-sheets` and
+`google-sheets-stream` components now create one API client per distinct set 
of the options the client is created from
+(`clientId`, `clientSecret`, `refreshToken`, `accessToken`, 
`serviceAccountKey`, `delegate`, `scopes` and
+`applicationName`, plus `emailAddress`, `p12FileName` and `user` on the two 
calendar components), instead of a single
+client per component. Endpoints configured with the same options keep sharing 
one client; endpoints configured with
+different options now get their own client, created from their own options. 
The `clientFactory` option of a
+`google-drive` endpoint is now used to create the client of that endpoint.

Review Comment:
   Added in 6d43bfb8b40a: the note now ends with "a `google-mail-stream` 
endpoint configured with neither `clientSecret` nor `serviceAccountKey` now 
fails with an `IllegalArgumentException` when its client is created, instead of 
getting a `null` client and failing at the first API call".
   
   _Claude Code on behalf of oscerd_



##########
components/camel-google/camel-google-calendar/src/test/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamClientPerEndpointOptionsTest.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.google.calendar.stream;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import com.google.api.client.http.javanet.NetHttpTransport;
+import com.google.api.client.json.jackson2.JacksonFactory;
+import com.google.api.services.calendar.Calendar;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.google.calendar.GoogleCalendarClientFactory;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertSame;
+
+class GoogleCalendarStreamClientPerEndpointOptionsTest {
+
+    private static final String OAUTH = 
"?clientId=id&clientSecret=secret&refreshToken=";
+
+    @Test
+    void shouldKeepOneClientPerDistinctOptions() throws Exception {

Review Comment:
   Added in 6d43bfb8b40a: `shouldKeepOneClientPerDelegate` in the three stream 
tests (mail, calendar, sheets). Two endpoints with the same `serviceAccountKey` 
and different `delegate` values get distinct clients, and the recording factory 
sees both delegates.
   
   _Claude Code on behalf of oscerd_



-- 
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]

Reply via email to