Queue that connects multiple producers and multiple consumers
Since you say that your whole system is based on message passing you should take a serious look at akka.   You get a rock solid message passing system, and you can even spread it on multiple machines in the future.

I have not checked in detail, but you have some very serious concurrency bugs.  For example, add checks if writing is allowed, then writes to the queue.  The problem is that you did not synchronize add, so the check might pass, but before calling the next line, some other thread might bring the count down latch down to zero.  BlockingQueue is thread-safe, but it is far from enough to make your code thread-safe.

I don't like the MessagePipeline api: it is too complex.  I really don't see the advantage of writing or taking "batches" of messages.  If the reader or writers want to process many messages, just let them read or write many messages themselves by processing their many messages in a loop.  The api itself should only read/write one message at a time.  In that case, your whole MessagePipeline is superfluous since a simple BlockingQueue is exactly what you want.  You will also avoid many concurrency bugs.  You would also need to keep the CountDownLatch or something similar to let the consumer know when it's over.