Unable to publish/create topic using PubSubRegistry

I have started using lagom recently. Based on this link my understanding is, a message should be published on the constructed topic - especially this part of the sample code I am referring to.

      final PubSubRef<Temperature> topic = pubSub.refFor(TopicId.of(Temperature.class, id));

I couldn’t build Temperature DTO to POST from rest client. So I created my on DTO which is exactly similar to HelloEvent - in my case its KafkaEvent.

I tried to use the code from here

However I did not see the topic created after performing POST operation. I did add print statements and they do appear in console.

   System.out.println("Received id:" + id);
   final PubSubRef<KafkaEvent> topic = pubSub.refFor(TopicId.of(KafkaEvent.class, id));
   System.out.println("Sent to:" + topic.toString());

I am not seeing any error in kafka server log or in my project.

Is there any step I am missing? or my understanding is wrong in usage of PubSubRegistry?

Please do let me know if further details are required.
Thanks in advance