Messaging Service API Example for JAVA