Does java have a concurrent queue with a fixed size that automatically poll dropped elements when new data is inserted at the end of the queue?

  java, question

Does java have a concurrent queue with a fixed size that can automatically determine when a new element is inserted at the end of the queue. If the queue is full, poll will drop the element at the end of the queue, and if it is not full, offer will enter?

Ps: LinkedBlockingQueue considered和ConcurrentLinkedQueue

ConcurrentLinkedQueue可以用size()判断大小
LinkedBlockingQueue可以用offer()判断,如果塞不进去说明队列满了

But the efficiency is not too high. . . )
Moreover, since element e is a business bean, it is relatively large, so the time for 100 concurrency is about 300 ~ 400 ms. . . .

Seek better solutions from the Great God. . .

ArrayBlockingQueue should meet the requirements of LZ, but it still needs to judge by the return value of offer.

The size of ConcurrentLinkedQueue is not a constant time operation, so it is slow. LinkedBlockingQueue is implemented with linked lists, and it is not specially used for fixed-size queues, so it is also slow.