Skip to content

Commit

Permalink
new events tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Fagorym committed Oct 21, 2023
1 parent ea237be commit 6586d19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void createOrder(RequestOrderDto order) {
kafkaTemplate.send("orderTopic", toEvent(order));
}

private OrderEvent toEvent(RequestOrderDto order) {
private OrderCreatedEvent toEvent(RequestOrderDto order) {
return new OrderCreatedEvent()
.setGuestCount(order.getGuestCount())
.setDate(order.getDate())
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ spring.kafka.bootstrap-servers=localhost:29092
spring.kafka.consumer.group-id=orderId
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:ru.nsu.fit.directors.userservice.dto.request.RequestOrderDto
spring.kafka.producer.properties.spring.json.type.mapping=created:ru.nsu.fit.directors.userservice.event.OrderCreatedEvent,\
\ cancelled:ru.nsu.fit.direectors.userservice.event.OrderCancelledEvent
spring.kafka.template.default-topic=orderTopic

0 comments on commit 6586d19

Please sign in to comment.