Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-13873 Handle Accept header to serialize the events #10239

Merged
merged 1 commit into from Aug 1, 2022

Conversation

jabolina
Copy link
Member

https://issues.redhat.com/browse/ISPN-13873

  • Created an EventLog serializer using the
    ConfigurationSerializer interface.

I am using the stuff that we already have to serialize configuration, since that can handle the EventLog object, but pretty much all of the serialization classes have Configuration in the name.

Now we have:

{
  "log" : {
    "instant" : "2022-07-26T11:33:08.666580Z",
    "category" : "LIFECYCLE",
    "content" : {
      "level" : "INFO",
      "message" : "ISPN100010: Finished rebalance with members [jbolina-34174, jbolina-58560], topology id 2"
    },
    "additional" : {
      "context" : "caching-listen",
      "scope" : "jbolina-58560",
      "detail" : null,
      "who" : null
    }
  }
}
log: 
  instant: "2022-07-26T11:11:22.912906Z"
  category: "LIFECYCLE"
  content: 
    level: "INFO"
    message: "ISPN100002: Starting rebalance with members [jbolina-9736, jbolina-46792], phase READ_OLD_WRITE_ALL, topology id 2"
  additional: 
    context: "caching-listen"
    scope: "jbolina-9736"
    detail: ~
    who: ~
<?xml version="1.0"?>
<log instant="2022-07-26T11:31:07.318201Z" category="LIFECYCLE">
    <content level="INFO" message="ISPN100002: Starting rebalance with members [jbolina-23979, jbolina-17669], phase READ_OLD_WRITE_ALL, topology id 2"/>
    <additional context="caching-listen" scope="jbolina-23979" detail="" who=""/>
</log>

Want to check with you all first. This is changes the object format for the log, currently is:

{
  "message":"ISPN100002: Starting rebalance with members [jbolina-29050, jbolina-38947], phase READ_OLD_WRITE_ALL, topology id 2",
  "category":"LIFECYCLE",
  "level":"INFO",
  "time":1658846192341,
  "owner":"",
  "context":"caching-listen",
  "scope":"jbolina-38947"
}

Do we keep the format that is currently used or it is OK to change it?

@ryanemerson
Copy link
Contributor

ryanemerson commented Jul 28, 2022

Do we keep the format that is currently used or it is OK to change it?

It's OK to change it as the current format was never in a stable release, only DevXX.

Overall I really the approach, good use of existing interfaces/components. However, tt would be good if we could include an integration test consuming the events in the various formats via server/tests.

@jabolina
Copy link
Member Author

However, tt would be good if we could include an integration test consuming the events in the various formats via server/tests.

Added a simpler version for now, where we verify specifically the log events. What do you think? When we publish more events in the listener we update the tests to be more generic on the content validation.

@jabolina
Copy link
Member Author

jabolina commented Jul 28, 2022

Oooops, I need to update the docs to reference the headers.
Updated.

@jabolina jabolina force-pushed the ISPN-13873 branch 2 times, most recently from 9ca8490 to 133e441 Compare July 28, 2022 19:31
@ryanemerson
Copy link
Contributor

Just one comment and then I think we're good to go.

* Created an `EventLog` serializer using the
`ConfigurationSerializer` interface.
@ryanemerson ryanemerson merged commit 9b548fc into infinispan:main Aug 1, 2022
@ryanemerson
Copy link
Contributor

Thanks @jabolina

@jabolina jabolina deleted the ISPN-13873 branch August 1, 2022 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants