i searched about that before...
if you want to make simple messaging between them, build your own one using database relations
but if you want complex one, so this would a lot of work
-- many people suggest JMS if you want a professional work but i also recommend Apache ActiveMQ