I have a threadlocal that records logs, and I want to add all logs of this request to the return result when returning the result. Normal use is no problem, but when using thread pool, due to the characteristics of threadlocal, the logs printed in the child thread are stored in the threadlocal of the child thread. How can I get the log data saved by the child threads to thread local in the main thread
How does a parent thread in a thread pool obtain data stored in thread local by a child thread
57 Views Asked by hadou At
0
There are 0 best solutions below
Related Questions in SPRING-BOOT
- Multi Tenancy in Spring - Partitioned Data Approach
- I have created a spring boot application with spring data JPA, Rest ,oracle and i am getting this ORA-00933: SQL command not properly ended
- Springboot: How to get an entity optional property and check null?
- How to create jasper report in spring boot rest api with jpa
- JSON Body is Not Passing Certain Strings
- Unresolved reference error is showing up after adding the dgs codegen plugin successfully
- Transaction silently rolled back
- JPA buddy error when generating JPA Entities from DB
- Migrating Spring Boot 2 to 3 throws org.glassfish.jaxb.runtime.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
- Hibernate SQL Error: Missing FROM-clause entry for table "th1_1"
- Appwrite and / or Spring Boot Backend
- Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. I'm using Postgresql
- Driver com.microsoft.sqlserver.jdbc.SQLServerDriver claims to not accept jdbcUrl, ${SPRING_DATASOURCE_URL}: GitHub Actions
- springboot class org.hibernate.mapping.Bag cannot be cast to class org.hibernate.mapping.SimpleValue
- Spring security causing 404 with message "No static resource login"
Related Questions in JAVA-8
- Java control panel glitching or becomes yellowish
- Uneven Load Distribution in Kubernetes Pods with Multithreaded Execution using fork join pool
- test result: Error. Program `sh' timed out (timeout set to 480000ms, elapsed time including timeout handling was 480002ms)
- java.net.ConnectException: Connection timed out: no further information Java to SOAP
- Java Stream, Need to update list of list objects
- Setting up different Java class fields value by a single value on some counter value
- feign client Spring boot
- `TYPE_USE` vs `TYPE` vs `TYPE_PARAMETER` annotations
- Error faced in trying to install Java 8 on Raspberry Pi 4B
- Grouping by multiple fields and counting using in Java 8
- How to customize mention notifications in liferay 7.3.5
- Without _JAVA_OPTIONS and JAVA_TOOL_OPTIONS, whether LeanFT will work or not?
- How to build a CriteriaQuery from SQL query
- From a string I am manually setting the date and time in calendar, for the other days it is working fine but for 28 and 29 Feb it is setting wrong val
- Sort strings containing numbers, chars and ponctuations in ”human readable order”
Related Questions in THREADPOOL
- C++ error: no matching member function for call to 'enqueue' futures.emplace_back(TP.enqueue(sum_plus_one, x, &M));
- Efficiently Handling Large Number of API Calls with Delphi 10.4 and OmniThreadLibrary
- RedisConnectionFailureException intermittently
- Java custom ThreadPool - pause task submission and cancel current queued tasks
- DataInputStream not recognising input
- Why is publishDir not copying large directories?
- asio using both coroutine and thread_pool issue
- The infinite loop to make the connection with opcua server, regardless of disconnecting the client
- Tcl Thread: Why this ten lines don't commit in parallel?
- ThreadPoolExecutor too fast for CPU bound task
- Handling a thread crash
- Why do I see this error "org.springframework.core.task.TaskRejectedException" when using Spring Framework 5.3.2?
- Can using a CPU with higher computing power necessarily reduce the number of required logical cores under the same load?
- How does the ThreadPool decide which type of thread to use for a work item
- std::thread move problem (use member function)
Related Questions in JAVA-11
- About installing openjdk on Fedora workstation
- Eclipse-Maven Forcefully Overwrites Java Version Set Every Update Project
- Issues with the JRE when attempting to open an AEM instance by using JDK 11.0.19 on Ubuntu
- After upgrading to JDK 11 my SOAP response is different
- Problems setting up a new quarkus project on Mac
- In intellij while creating new spring project nit able to see java version below 17
- Lombok AnnotationProcessor failing with Bazel build
- Running test throws NoSuchMethodError
- OracleDataSource cannot implement createConnectionBuilder() in javax.sql.Datasource
- What is the best approach to access concrete sub class specific methods using java?
- Why does LazyInitializationException get thrown on non linked entities?
- Is there a way to make keep-alive setting specific to one instance of java.net.http.HttpClient
- Could not initialize class org.apache.pulsar.jetty.tls.JettySslContextFactory
- RHEL9, OpenJDK 11, FIPS - issues with PBES2 ciphers
- Trouble with setting up Java modules in Apache NetBeans 20 Flatpak Installation, on Linux Mint 21.3 Virginia
Related Questions in THREAD-LOCAL
- Is exception handling mandatory in MDC.remove() or MDC.put()?
- ThreadLocal context lost with CompletableFuture in Java
- What's the role of using Map to encapsulate ThreadLocal<Map>?
- JDK 21 - Why ThreadLocalRandom's nextInt implement with super.nextInt directly?
- Spring Integration delay along with thread MDC context
- How to propagating context through StructuredTaskScope by ScopedValue, by the way, how about the MDC ThreadContextMap in StructuredTaskScope?
- Check if a function argument value is thread-local
- How do I fix the following issue: Could not write JSON: Failed making field 'java.lang.ThreadLocal#threadLocalHashCode' accessible?
- How does a parent thread in a thread pool obtain data stored in thread local by a child thread
- Linking error with g++ for static inline thread_local variable
- Virtual thread for reading InputStream from HTTP response
- Context-Propagation does not work in @SpringBootTest
- Http Request from Spring Boot 3 Scheduled Jobs
- Java 8 to Java 17 ThreadLocal issue
- Common mutex for shared library dynamic loading and thread_local initialization?
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?