by using PubSubManager.tryToPublishAndPossibleAutoCreate(). This also swaps the parameters of the method. Thanks to Guus der Kinderen for suggesting this.