Adding Java example for asynchronous publication