There something I can do to get only the Event name over the full package name + Event Name in the Axon server dashboard ?
This: GameRegisteredEvent
instead of : io.axoniq.demo.gamerental.coreapi.GameRegisteredEvent
any ideas ?
There something I can do to get only the Event name over the full package name + Event Name in the Axon server dashboard ?
any ideas ?
Hi @Dominic_Dubreuil1! Can you give a bit more information about why the whole package name is too much?
The package name is ok and correctly right. The question is how we can remove the package name and just to have the Event Name inside the payloadType. It is possible ?
Hi @Dominic_Dubreuil1 the payloadType is used by Axon Framework to identify what type to deserialize the payloadData into. Is there another use case you have in mind?
I’m afraid it’s not clear from your message if you want to change what is displayed in the UI or if you want to actually change the payload? Can you please clarify?
I dont want to change the type i want to change the display in the UI. I want a simplified version of the class name instead of the full package name that is usally too long and cant be fully seen in ui.
If you want to change what Axon states as being the payloadType
, you will have to customize the Serializer
.
Here it depends a little on whether you’re using XStream or Jackson, so I’ll provide a short description on both.
XStream - XStream
can use aliases to replace long Strings for shorter variants. You will have to provide your own XStream
instance through the XStreamSerializer.Builder
to add aliases. You can define an alias on the XStream
instance by using the XStream#alias(String, Class<?>)
method.
Jackson - When using the JacksonSerializer
, you are inclined to provide a custom JacksonSerializer
that changes the payloadType
on serialization and knows how to get back from the adjusted type to an actual Class<?>
. The methods to override, are the typeForClass(Class<?>)
and resolveClassName(SerializedType)
methods.
So yea, this is possible. Whether it is worth the effort simply for minimizing what’s shown in the dashboard is up to you. Why the names are typically removed is for things like saving space and leaking domain logic.