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)); topic.publish(temperature);
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)); topic.publish(temperature); 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