Updated Device.setId to Device.receiveClientId for device specific handling
Updated publishMessage to use a Thread to avoid network activity on the main thread