Also i still have doubts how pact works for messag...
# pact-jvm
a
Also i still have doubts how pact works for messaging cases. On the provider side should i use a MessageTarget pointing to a real kafka topic?
y
Hey @André Sousa, we have some examples here for Kafka https://docs.pactflow.io/docs/examples#consumers for JS and Java https://docs.pactflow.io/docs/examples#providers for Java We also have a recipe for Kafka here https://docs.pact.io/recipes/kafka#schema-registry-json-provider Hope this helps indirectly answer your question
a
Thanks @Yousaf Nabi (pactflow.io). Its correct to interpret that this object MessageAndMetadata will be used by Pact to compare the message defined by the consumer against the one produced by the provider?
For instance, this method: @PactVerifyProvider("a product created event") public MessageAndMetadata productCreatedEvent() throws JsonProcessingException { ProductEvent product = new ProductEvent("id1", "product name", "product type", "v1", EventType.CREATED, 27.00); Message<String> message = new ProductMessageBuilder().withProduct(product).build(); return generateMessageAndMetadata(message); }
This method won't write into a existing kafka topic right? it'll just create this MessageAndMetadata object for Pact to match?