A Tomcat server worker thread replying to an incoming request must access at least one of several possible cloud API services (Google Cloud Storage in particular; non-modifying, that is, only performing Reads). Tomcat offers out-of-the-box pooling for JDBC and JNDI compatible DB's and services. What is the best strategy for pooling connections to multiple cloud services to be shared across worker threads?
Tomcat: Creating a connection pool for cloud API services
193 Views Asked by ChaimKut At
2
There are 2 best solutions below
0
Setop
On
Your application access API over HTTP(S). The connection pooling must be performed at HTTP Client level.
If you're using Apache HTTPClient, there are examples of usage of pool.
Related Questions in TOMCAT
- Best way to pass an environment variable to several config files
- Openshift context path
- KeyStore file is not found in jar, although present in jar
- phpseclib of how to get PID and kill
- Unable to connect database of lamp instance from servlet running on tomcat instance of google cloud
- Spring and Tomcat: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
- How can I get a custom header from the client in Tomcat?
- why lost Mysql connection pool after a period?
- Eclipse Java EE + Bitnami Tomcat Stack
- Service not starting using Spring-boot during integration tests
- Image not loading in web page and says 404 error
- Maven Tomcat plugin - 404 WebServlet not found
- How to deploy a spring boot MVC application in traditional tomcat webapps folder?
- Tomcat Manager is not accessible in multi-domain configuration
- JSP return Jasper Exceptions on my friend's pc's when it works on mine
Related Questions in CONCURRENCY
- Entity Framework Code First with Fluent API Concurrency `DbUpdateConcurrencyException` Not Raising
- How to return blocking queue to the right object?
- How to ensure data synchronization across threads within a "safe" area (e.g not in a critical section) without locking everything
- Breakpoint "concurrency" in Intellij
- java, when (and for how long) can a thread cache the value of a non-volatile variable?
- Reentrancy and Reentrant in C?
- How to do many simultaneous jsoup sessions (Spring boot project and concurrancy)
- Using multiple threads to print statements sequentially
- Interrupting long working thread
- Usage of C++11 std::unique_lock<std::mutex> lk(myMutex); not really clear
- Using getOrElseUpdate of TrieMap in Scala
- Concurrency of JPA when same DB used by other applications
- erlang processes and message passing architecture
- Erratic StampedLock.unlock(long) behaviour?
- Jersey Client, memory leak, static and concurrency
Related Questions in CONNECTION-POOLING
- Reusing connections in Django with Python Requests
- Should Hystrix replace existing JDBC/HTTP connection pools, or delegate to them?
- C3P0 Connection Pool not working in Servlet/Tomcat
- what exactly does a database connection mean in connection pool
- Use Tomcat JDBC Pool as Hibernate Connection pool
- How to fix connection pool leak in Grails?
- How to configure the connection pool in Play Framework 1.3 through application.conf and c3p0.properties?
- How to configure JDBC Connection Pool in Tomcat 5.5 for Oracle R12?
- setMaxTotal and setDefaultMaxPerRoute in HttpClient?
- APPARENT DEADLOCK c3p0 0.9.5.1 spring
- How to install WebSphere MQ resource adapter (wmq.jmsra.rar) in JBoss 6.2 EAP?
- How to decide optimal settings for setMaxTotal and setDefaultMaxPerRoute?
- Client connection in Pymongo
- Difference between OracleDataSource , Oracle UCP, Commons DBCP and Tomcat Connection Pool?
- How does Nodejs MongoDB connection pool work?
Related Questions in TOMCAT9
- Standalone tomcat 9 spikes CPU to 50% every 10 seconds while my web application is idle
- Spring Boot REST Controller returns 404 when deployed on external tomcat 9 server
- scheduleAtFixRate runs every 10 minutes instead of hourly
- Can web application worked both in Tomcat 10 and Tomcat 9
- Threads getting into blocked state while doing a host name look up using java.net.InetAddress.getLocalHost
- Tomcat 9 jndi: protocol MalformedURLException: unknown protocol: jndi
- What causes "HTTP method names must be tokens" error?
- Tomcat 9 can't load spring boot application
- Server Tomcat v9.0 Server at localhost failed to start because of com.mongodb.client.MongoDatabase
- Custom SpnegoAuthenticator worked with Tomcat 8 but gives 404 with Tomcat 9
- Redirect Tomcat 9 servlet exception logs to log4j2
- Getting a 403 for static resources in spring boot without using spring security
- Log4J change configuration runtime
- The requested resource [projectname/servlet] is not available
- An error has occurred. Retry later.If the problems persists, contact the system administrator. - KNOWAGE
Related Questions in CONNECTION-POOL
- Spring AsyncRestTemplate connection pool and thread pool settings
- Php - Connection Pooling To Mysql
- Spark Streaming connection pool in each JVM
- MySQL JDBC Datasource lookup fails after updating to mysql-connector-java-5.1.44
- sequelize - connection pool size
- Spring boot, Tomcat connection pool when multiple spring boot applications are in same external tomcat container
- Mysql Connection vs Connection Pool
- Creating a connection pool using all nodes in AWS opensearch cluster
- Can I using springboot application with hikariCP on JBoss WAS?
- Sharing redisson client connection pool between several redisson client bean
- How to improve simple connection pool to be less blocking
- How wildfly resets properties set on connection when returned to connection pool
- Is it feasible to use database-per-tenant with 1000 tenants?
- I have connectionpool class which is a singleton. when i try to call it in my DBDAO classes something go wrong and it create 2 instances
- Why mysql_init(nullptr) leads to segmentation fault in the following code?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
As you mentioned Tomcat allows defining JDBC/JNDI resources that can be used by web applications. If there is a JDBC driver available for the service you want to use then you can use the same approach. For example, a quick search for GCS JDBC driver returns this.
For pooling, you could define HikariCP as a tomcat resource and configure it to connect to GCS using the third-party driver using the
driverClassNameproperty.Alternatively, applications can use the HTTP-based SDKs that cloud providers usually make available.