This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Bronislav Bronek

Ranch Hand
+ Follow
since Feb 26, 2016
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bronislav Bronek

This is a convention in the company where I am now.
4 months ago
I must write web service that call other web service. My web service do nothing just only works as a proxy 1-1 with outer web service.
I cannot set up output as a  response from the outer directly.
I must create my objects, fill my objects from outer response and set up as a output.

4 months ago
I have 2 classes:

Cloud you tell me how to copy fields from class A to B
Is it a good idea to use Gson?  are there better solutions ?

4 months ago

I have HTTP client:


And one put method on the server (implemented in Spark):

The problem: when I set up for example TimeUnit.MINUTES.sleep(10) everything is fine I see return value "text". But when I set up TimeUnit.MINUTES.sleep(20) or longer I do not see return value also I do not see any errors, my client is just waiting and waiting. Do you have any idea what happen ?

6 months ago
hi , could you please tell me how to write in java this task:

I have n elements, I need to distribute the elements in list with the size M.  M > n

for example:
element 1 =>  x  , times presence
element 2 =>  y  , times presence
element n =>  z  , times presence

x+y+...+ z = M

7 months ago

I have the database where many connections is serviced in the same time (reading, writing)
My idea to unload the connections is to create a replica of my DB. So that, I have 2 DBs one for writing, second for reading.-

- could you tell me the way how to synchronize these DB ?

- maybe you know a better idea to solved that problem with  overwhelmed database problem ?
I have this hierarchy:

In the line below class A is injected not Y ( I need Y ):

Could you please tell me how to do in Spring Boot to inject class Y ?
The problem probably is that class A has @Primary annotation but does @Qualifier not have a priority ?

What about the situation when I have 250 web socket connections ?

I see that 250 connections are opened
I have maxThreadPool = 200

When I create 250 users and run in the same time I see that all 250 are handled.

Could you explain me how it is posiible. You wrote that where there is not more threads in pool -  the connection request "bounces"
Tell me please this -

I have a webSocket server which is runnnig on Tomcat.
Tomcat works in NIO – non-blocking I/O (many more connections than threads) mode.

maxConnections = 1000
maxThreads = 200

Assuming 300 connections for example , all 300 users can be serve by Tomcat ??

I mean, one thred from pool can switch between 2 connections because of 300 > 200 ?
here is

maxThreads  = (int) The max number of active threads in this pool, default is 200
So, thread in tomcat can be either busy or idle.

default value of threads pool is 200

is this relation correct ?

( 200 - total number of idle threads) = total number of busy threads
the total number of threads = 200  by default in tomcat ?

200  -  the number of busy threads =  the number of idle threads.

Tell me please the difference between   the current thread and   the busy thread?
Could you please explain me this sentence?

"With a monitoring tool, you can calculate the number of idle threads by comparing the current thread count to the number of busy threads."

What is the current thread?  
What is the busy thread?