stn1slv commented on code in PR #13630:
URL: https://github.com/apache/camel/pull/13630#discussion_r1542458053


##########
components/camel-google/camel-google-pubsub-lite/src/main/java/org/apache/camel/component/google/pubsublite/GooglePubsubLiteComponent.java:
##########
@@ -0,0 +1,245 @@
+/*
+ * 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.pubsublite;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+
+import com.google.api.gax.core.CredentialsProvider;
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.auth.oauth2.GoogleCredentials;
+import com.google.auth.oauth2.ServiceAccountCredentials;
+import com.google.cloud.pubsub.v1.MessageReceiver;
+import com.google.cloud.pubsub.v1.stub.PublisherStubSettings;
+import com.google.cloud.pubsublite.SubscriptionPath;
+import com.google.cloud.pubsublite.TopicPath;
+import com.google.cloud.pubsublite.cloudpubsub.*;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.RemovalListener;
+import org.apache.camel.Endpoint;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.support.ResourceHelper;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Represents the component that manages {@link GooglePubsubLiteEndpoint}.
+ */
+@Component("google-pubsub-lite")
+public class GooglePubsubLiteComponent extends DefaultComponent {
+    private static final Logger LOG = 
LoggerFactory.getLogger(GooglePubsubLiteComponent.class);
+
+    @Metadata(label = "common",
+              description = "The Service account key that can be used as 
credentials for the PubSub Lite publisher/subscriber. It can be loaded by 
default from "
+                            + " classpath, but you can prefix with classpath:, 
file:, or http: to load the resource from different systems.")
+    private String serviceAccountKey;
+
+    @Metadata(
+              label = "producer",
+              description = "Maximum number of producers to cache. This could 
be increased if you have producers for lots of different topics.")
+    private int publisherCacheSize = 100;
+
+    @Metadata(
+              label = "producer",
+              description = "How many milliseconds should each producer stay 
alive in the cache.")
+    private int publisherCacheTimeout = 180000;
+
+    @Metadata(
+              label = "consumer",
+              description = "How many milliseconds should each producer stay 
alive in the cache. " +
+                            "Must be greater than the allowed size of the 
largest message (1 MiB).")
+    private long consumerBytesOutstanding = 10 * 1024 * 1024;
+
+    @Metadata(
+              label = "consumer",
+              description = "The number of messages that may be outstanding to 
the client. Must be >0.")
+    private long consumerMessagesOutstanding = 1000;
+
+    @Metadata(
+              label = "advanced",
+              description = "How many milliseconds should a producer be 
allowed to terminate.")
+    private int publisherTerminationTimeout = 60000;
+
+    private RemovalListener<String, Publisher> removalListener = removal -> {
+        Publisher publisher = removal.getValue();
+        if (publisher == null) {

Review Comment:
   Fixed in 
[8bfe10f](https://github.com/apache/camel/pull/13630/commits/8bfe10f92a9fd68d9d9fa417c5e906aca3b20d7a)



-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to