Skip to content

Instantly share code, notes, and snippets.

@dsebastien
Created January 1, 2018 02:10
Show Gist options
  • Save dsebastien/4b9e13d9d120ef4b0c5fb842db4b85b4 to your computer and use it in GitHub Desktop.
Save dsebastien/4b9e13d9d120ef4b0c5fb842db4b85b4 to your computer and use it in GitHub Desktop.
Happy new yearvent
POST http://localhost:8080/schools?name=Herchies&description=Ecole communale
2018-01-01 03:09:20.812 INFO 10624 --- [nio-8080-exec-1] b.i.ecool.controllers.SchoolController : Handling a request to create a school
2018-01-01 03:09:20.892 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.schools.SchoolServiceImpl : Request to create a new school: CreateSchoolCommand(name=Herchies, description=Ecole communale)
2018-01-01 03:09:20.893 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.schools.SchoolServiceImpl : Verifying that no other school already exists with that name
2018-01-01 03:09:20.962 INFO 10624 --- [nio-8080-exec-1] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
Hibernate:
/* select
generatedAlias0.id
from
School as generatedAlias0
where
generatedAlias0.name=:param0 */ select
school0_.id as col_0_0_
from
schools school0_
where
school0_.name=? limit ?
2018-01-01 03:09:21.099 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.schools.SchoolServiceImpl : Persisting the new school
Hibernate:
call next value for school_seq
Hibernate:
call next value for school_seq
2018-01-01 03:09:21.130 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.schools.SchoolServiceImpl : New school persisted successfully. Id: 1. UUID: 5a2d700a-bdb4-47d7-8d36-1f3bea56ecec
2018-01-01 03:09:21.170 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.e.EventPublisherServiceImpl : Publishing an event to a specific topic: SchoolCreatedV1(schoolId=5a2d700a-bdb4-47d7-8d36-1f3bea56ecec, name=Herchies, description=Ecole communale). Topic: schools
2018-01-01 03:09:21.171 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.e.EventPublisherServiceImpl : Sending an event to the bus
2018-01-01 03:09:21.201 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.events.bus.ReactiveEventBusImpl : Posting an item to the bus: SchoolCreatedV1(schoolId=5a2d700a-bdb4-47d7-8d36-1f3bea56ecec, name=Herchies, description=Ecole communale)
2018-01-01 03:09:21.202 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.bus.ReactiveEventBusImpl : Pushing the event to the global stream
2018-01-01 03:09:21.207 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.bus.ReactiveEventBusImpl : Pushing the event to the specific stream
2018-01-01 03:09:21.208 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.events.bus.ReactiveEventBusImpl : Pushing the event to an additional stream named: schools
2018-01-01 03:09:21.209 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.e.EventPublisherServiceImpl : Saving the event to the log
2018-01-01 03:09:21.223 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventLogServiceImpl : Adding an event to the event log: SchoolCreatedV1(schoolId=5a2d700a-bdb4-47d7-8d36-1f3bea56ecec, name=Herchies, description=Ecole communale)
2018-01-01 03:09:21.225 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventLogServiceImpl : Caching/Persisting the schema (if needed)
2018-01-01 03:09:21.257 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventSchemaServiceImpl : Saving schema for [eventName: SchoolCreated], [eventVersion: 1], [class: class be.itsee.ecool.events.schools.SchoolCreatedV1]
2018-01-01 03:09:21.286 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Getting schema for be.itsee.ecool.events.schools.SchoolCreatedV1
2018-01-01 03:09:21.304 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.avro.AvroSchemaCacheServiceImpl : Trying to get Schema for clazz be.itsee.ecool.events.schools.SchoolCreatedV1 from the Avro schema put. Present? false
2018-01-01 03:09:21.305 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Schema not present in cache yet. Using reflection to build it
2018-01-01 03:09:21.504 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Schema built, caching it
2018-01-01 03:09:21.506 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.avro.AvroSchemaCacheServiceImpl : Caching schema for be.itsee.ecool.events.schools.SchoolCreatedV1
2018-01-01 03:09:21.542 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Converting schema to String: {"type":"record","name":"SchoolCreatedV1","namespace":"be.itsee.ecool.events.schools","fields":[{"name":"schoolId","type":"string"},{"name":"name","type":"string"},{"name":"description","type":["null","string"],"default":null},{"name":"eventUuid","type":"string"},{"name":"eventName","type":"string"},{"name":"eventVersion","type":"int"}]}
2018-01-01 03:09:21.555 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventSchemaServiceImpl : Serialized schema: {
"type" : "record",
"name" : "SchoolCreatedV1",
"namespace" : "be.itsee.ecool.events.schools",
"fields" : [ {
"name" : "schoolId",
"type" : "string"
}, {
"name" : "name",
"type" : "string"
}, {
"name" : "description",
"type" : [ "null", "string" ],
"default" : null
}, {
"name" : "eventUuid",
"type" : "string"
}, {
"name" : "eventName",
"type" : "string"
}, {
"name" : "eventVersion",
"type" : "int"
} ]
}
2018-01-01 03:09:21.562 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventSchemaServiceImpl : Schema fingerprint: ce320d9dde1b3244120133b65992b4330c007fcd3c1bcd4e808986bd09ad8d72b5d5c92013543687308d987c6678ffaa04494d06c24007ba428e8d2f5c2f9916
2018-01-01 03:09:21.563 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventSchemaServiceImpl : Checking if the schema is already known (fingerprint: ce320d9dde1b3244120133b65992b4330c007fcd3c1bcd4e808986bd09ad8d72b5d5c92013543687308d987c6678ffaa04494d06c24007ba428e8d2f5c2f9916)
Hibernate:
/* select
generatedAlias0
from
EventSchema as generatedAlias0
where
generatedAlias0.sha512Fingerprint=:param0 */ select
eventschem0_.id as id1_3_,
eventschem0_.creation_timestamp as creation2_3_,
eventschem0_.event_name as event_na3_3_,
eventschem0_.event_version as event_ve4_3_,
eventschem0_.name as name5_3_,
eventschem0_.payload as payload6_3_,
eventschem0_.sha512_fingerprint as sha7_3_,
eventschem0_.uuid as uuid8_3_
from
event_schemas eventschem0_
where
eventschem0_.sha512_fingerprint=? limit ?
2018-01-01 03:09:21.580 INFO 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventSchemaServiceImpl : The schema is not known yet. Persisting it
Hibernate:
call next value for event_schemaseq
Hibernate:
call next value for event_schemaseq
2018-01-01 03:09:21.591 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventLogServiceImpl : Persisted event schema id: 1
2018-01-01 03:09:21.603 DEBUG 10624 --- [nio-8080-exec-1] b.i.e.s.e.s.AvroEventSerializerImpl : Serializing SchoolCreatedV1(schoolId=5a2d700a-bdb4-47d7-8d36-1f3bea56ecec, name=Herchies, description=Ecole communale) to a String
2018-01-01 03:09:21.604 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.e.s.AvroEventSerializerImpl : Getting the Avro schema to use for serialization
2018-01-01 03:09:21.604 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Getting schema for be.itsee.ecool.events.schools.SchoolCreatedV1
2018-01-01 03:09:21.605 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.avro.AvroSchemaCacheServiceImpl : Trying to get Schema for clazz be.itsee.ecool.events.schools.SchoolCreatedV1 from the Avro schema put. Present? true
2018-01-01 03:09:21.606 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.e.s.AvroEventSerializerImpl : Converting the event to a generic record
2018-01-01 03:09:21.607 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Building a generic Avro record for the object
2018-01-01 03:09:21.610 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Adding entries to the generic record for each property of the object
2018-01-01 03:09:21.611 DEBUG 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Searching for the actual Avro field name for the following property: [description]
2018-01-01 03:09:21.612 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Retrieving the Java field
2018-01-01 03:09:21.612 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Java field found. Checking if the org.apache.avro.reflect.AvroName annotation is defined on it
2018-01-01 03:09:21.613 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : AvroName annotation not defined for the given property field. Using the default: description
2018-01-01 03:09:21.613 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Checking if the field called [description] is part of the schema
2018-01-01 03:09:21.619 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Adding the [description] property to the generic record. Value: Ecole communale
2018-01-01 03:09:21.619 DEBUG 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Searching for the actual Avro field name for the following property: [name]
2018-01-01 03:09:21.619 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Retrieving the Java field
2018-01-01 03:09:21.619 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Java field found. Checking if the org.apache.avro.reflect.AvroName annotation is defined on it
2018-01-01 03:09:21.619 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : AvroName annotation not defined for the given property field. Using the default: name
2018-01-01 03:09:21.619 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Checking if the field called [name] is part of the schema
2018-01-01 03:09:21.619 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Adding the [name] property to the generic record. Value: Herchies
2018-01-01 03:09:21.620 DEBUG 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Searching for the actual Avro field name for the following property: [schoolId]
2018-01-01 03:09:21.620 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Retrieving the Java field
2018-01-01 03:09:21.620 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Java field found. Checking if the org.apache.avro.reflect.AvroName annotation is defined on it
2018-01-01 03:09:21.621 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : AvroName annotation not defined for the given property field. Using the default: schoolId
2018-01-01 03:09:21.621 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Checking if the field called [schoolId] is part of the schema
2018-01-01 03:09:21.621 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Adding the [schoolId] property to the generic record. Value: 5a2d700a-bdb4-47d7-8d36-1f3bea56ecec
2018-01-01 03:09:21.621 DEBUG 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Searching for the actual Avro field name for the following property: [eventName]
2018-01-01 03:09:21.621 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Retrieving the Java field
2018-01-01 03:09:21.621 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Java field found. Checking if the org.apache.avro.reflect.AvroName annotation is defined on it
2018-01-01 03:09:21.621 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : AvroName annotation not defined for the given property field. Using the default: eventName
2018-01-01 03:09:21.621 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Checking if the field called [eventName] is part of the schema
2018-01-01 03:09:21.623 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Adding the [eventName] property to the generic record. Value: SchoolCreated
2018-01-01 03:09:21.623 DEBUG 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Searching for the actual Avro field name for the following property: [eventUuid]
2018-01-01 03:09:21.623 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Retrieving the Java field
2018-01-01 03:09:21.623 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Java field found. Checking if the org.apache.avro.reflect.AvroName annotation is defined on it
2018-01-01 03:09:21.623 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : AvroName annotation not defined for the given property field. Using the default: eventUuid
2018-01-01 03:09:21.624 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Checking if the field called [eventUuid] is part of the schema
2018-01-01 03:09:21.624 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Adding the [eventUuid] property to the generic record. Value: bf29800d-b673-417b-82c9-0c516e762518
2018-01-01 03:09:21.624 DEBUG 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Searching for the actual Avro field name for the following property: [eventVersion]
2018-01-01 03:09:21.624 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Retrieving the Java field
2018-01-01 03:09:21.624 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Java field found. Checking if the org.apache.avro.reflect.AvroName annotation is defined on it
2018-01-01 03:09:21.624 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : AvroName annotation not defined for the given property field. Using the default: eventVersion
2018-01-01 03:09:21.624 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Checking if the field called [eventVersion] is part of the schema
2018-01-01 03:09:21.624 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Adding the [eventVersion] property to the generic record. Value: 1
2018-01-01 03:09:21.630 TRACE 10624 --- [nio-8080-exec-1] b.i.ecool.services.avro.AvroServiceImpl : Converting generic record [{"schoolId": "5a2d700a-bdb4-47d7-8d36-1f3bea56ecec", "name": "Herchies", "description": "Ecole communale", "eventUuid": "bf29800d-b673-417b-82c9-0c516e762518", "eventName": "SchoolCreated", "eventVersion": 1}] to a byte array using the schema: {"type":"record","name":"SchoolCreatedV1","namespace":"be.itsee.ecool.events.schools","fields":[{"name":"schoolId","type":"string"},{"name":"name","type":"string"},{"name":"description","type":["null","string"],"default":null},{"name":"eventUuid","type":"string"},{"name":"eventName","type":"string"},{"name":"eventVersion","type":"int"}]}
2018-01-01 03:09:21.649 DEBUG 10624 --- [nio-8080-exec-1] b.i.e.s.e.s.AvroEventSerializerImpl : Serialized event: {
"schoolId" : "5a2d700a-bdb4-47d7-8d36-1f3bea56ecec",
"name" : "Herchies",
"description" : {
"string" : "Ecole communale"
},
"eventUuid" : "bf29800d-b673-417b-82c9-0c516e762518",
"eventName" : "SchoolCreated",
"eventVersion" : 1
}
2018-01-01 03:09:21.650 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventLogServiceImpl : Event log entry to save: EventLogEntry(id=0, eventUuid=637772f3-9c00-47c1-b36f-63cd3e3cf775, eventName=SchoolCreated, eventVersion=1, eventPayload={
"schoolId" : "5a2d700a-bdb4-47d7-8d36-1f3bea56ecec",
"name" : "Herchies",
"description" : {
"string" : "Ecole communale"
},
"eventUuid" : "bf29800d-b673-417b-82c9-0c516e762518",
"eventName" : "SchoolCreated",
"eventVersion" : 1
}, creationTimestamp=2018-01-01T03:09:21.649)
2018-01-01 03:09:21.650 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventLogServiceImpl : Saving an entry to the event log: EventLogEntry(id=0, eventUuid=637772f3-9c00-47c1-b36f-63cd3e3cf775, eventName=SchoolCreated, eventVersion=1, eventPayload={
"schoolId" : "5a2d700a-bdb4-47d7-8d36-1f3bea56ecec",
"name" : "Herchies",
"description" : {
"string" : "Ecole communale"
},
"eventUuid" : "bf29800d-b673-417b-82c9-0c516e762518",
"eventName" : "SchoolCreated",
"eventVersion" : 1
}, creationTimestamp=2018-01-01T03:09:21.649)
Hibernate:
call next value for event_log_entry_seq
Hibernate:
call next value for event_log_entry_seq
2018-01-01 03:09:21.652 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.events.EventLogServiceImpl : Event log entry saved successfully. Id: 1
2018-01-01 03:09:21.659 TRACE 10624 --- [nio-8080-exec-1] b.i.e.s.schools.SchoolServiceImpl : Returning the persisted school
Hibernate:
/* insert be.itsee.ecool.domain.entities.School
*/ insert
into
schools
(creation_timestamp, description, name, uuid, id)
values
(?, ?, ?, ?, ?)
Hibernate:
/* insert be.itsee.ecool.domain.entities.EventSchema
*/ insert
into
event_schemas
(creation_timestamp, event_name, event_version, name, payload, sha512_fingerprint, uuid, id)
values
(?, ?, ?, ?, ?, ?, ?, ?)
Hibernate:
/* insert be.itsee.ecool.domain.entities.EventLogEntry
*/ insert
into
event_log
(creation_timestamp, event_name, event_payload, event_uuid, event_version, id)
values
(?, ?, ?, ?, ?, ?)
2018-01-01 03:09:21.724 INFO 10624 --- [nio-8080-exec-1] createSchool : | onSubscribe([Synchronous Fuseable] Operators.ScalarSubscription)
2018-01-01 03:09:21.725 INFO 10624 --- [nio-8080-exec-1] createSchool : | request(unbounded)
2018-01-01 03:09:21.726 INFO 10624 --- [nio-8080-exec-1] createSchool : | onNext(School(id=1, uuid=5a2d700a-bdb4-47d7-8d36-1f3bea56ecec, name=Herchies, description=Ecole communale, classrooms=[], creationTimestamp=2018-01-01T03:09:21.098))
2018-01-01 03:09:21.819 INFO 10624 --- [nio-8080-exec-1] createSchool : | onComplete()
Result:
{
"id": 1,
"uuid": "5a2d700a-bdb4-47d7-8d36-1f3bea56ecec",
"name": "Herchies",
"description": "Ecole communale",
"classrooms": [],
"creationTimestamp": "2018-01-01T03:09:21.098"
}
GET http://localhost:8080/schools
Result:
[
{
"id": 1,
"uuid": "5a2d700a-bdb4-47d7-8d36-1f3bea56ecec",
"name": "Herchies",
"description": "Ecole communale",
"classrooms": [],
"creationTimestamp": "2018-01-01T03:09:21.098"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment