Informatica interview question

Explain publisher subscriber design pattern and code it up in Java