If you call Message.getValue() on the completion of a CompletableFuture returned by Pulsar Client, like Reader.readNextAsync() then there is a good chance to create a deadlock. Following example demonstrates how to solve deadlock using the concept of thread. This usually happens when multiple threads need the same locks but obtain them in different. ![]() ![]() In case of a AVRO message Message.getValue() needs to download the schema from the Registry performing a blocking operation that involves a request to the Broker itself. How to solve deadlock using thread Solution. Deadlock in Java is a condition where two or more threads are blocked forever, waiting for each other.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |