finished publish and subscribe example