stubbing publish to method to avoid connection refused errors