Skip to content

Commit

Permalink
fix kafka deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
tkeburia committed Dec 11, 2023
1 parent d0dcaaa commit 0c1697e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ spring.kafka.consumer.group-id=notificationId
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer
spring.kafka.consumer.properties.spring.json.type.mapping=event:com.redbadger.notificationservice.OrderPlacedEvent
spring.kafka.properties.security.protocol=PLAINTEXT
spring.kafka.properties.security.protocol=PLAINTEXT
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public String placeOrder(OrderRequest orderRequest) {
log.info("All requested products are in stock");
orderRepository.save(order);
kafkaTemplate.send("notificationTopic", new OrderPlacedEvent(order.getOrderNumber()));
return String.format("Order Number %s Placed Successfully", order.getOrderNumber());
log.info(String.format("Order Number %s Placed Successfully", order.getOrderNumber()));
return "Order Placed";
}
else {
throw new IllegalArgumentException("Product is not in stock, please try again later");
Expand Down
2 changes: 1 addition & 1 deletion order-service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ spring.kafka.template.default-topic=notificationTopic
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer
spring.kafka.producer.properties.spring.json.type.mapping=event:com.redbadger.orderservice.event.OrderPlacedEvent
spring.kafka.properties.security.protocol=PLAINTEXT
spring.kafka.properties.security.protocol=PLAINTEXT
2 changes: 1 addition & 1 deletion spin_up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ popd

echo "deploying services..."
cd deployment
helm install kafka oci://registry-1.docker.io/bitnamicharts/kafka
helm install kafka oci://registry-1.docker.io/bitnamicharts/kafka --set listeners.client.protocol=PLAINTEXT

for service in *
do
Expand Down

0 comments on commit 0c1697e

Please sign in to comment.