publish and get public messages

adding functionality to publish and get public messages