im using blocking queue in my program.. where my client threds poll for response, and server thred offer the response to queue.I didnt use any thread.sleep mechanism from client end, since im using blockingqueue..But im egtting null values from the queue, when my server thread delays to put some messages in the queue.. Why this is happening? My code;
private BlockingQueue<Message> applicationResponses= new LinkedBlockingQueue<Message>();
client
--------
Message response = applicationResponses.poll();
server;
applicationResponses.offer(message);