22/12/2025
7. Go to project open in intellij/eclipse/SpringToolSuite and there make a package as order.event, there place this code with required variables as per your requirements and it should either match with schema defined in file defined as order-placed.avsc in avro folder in application.properties folder of module or with class defined with the same folder structure as in consumer's module as follows :
package com.techie.microservices.order.event;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
public class OrderPlacedEvent {
private String orderNumber;
private String email;
}
or
Schema-registry file defined as order-placed.avsc in avro folder in application.properties folder of module:
{
"type": "record",
"name": "OrderPlacedEvent",
"namespace": "com.techie.microservices.order.event",
"fields": [
{ "name": "orderNumber", "type": "string" },
{ "name": "email", "type": "string" },
{ "name": "firstName", "type": "string" },
{ "name": "lastName", "type": "string" }
]
}