Question about 'blacklisting'

In read in the documentation that the axonframework 4.2 by default will blacklist events for which there are no eventhandlers.

I went through the code a bit and saw that events are blacklisted based on Type and Revision (io.axoniq.axonserver.grpc.event.PayloadDescription)

How does this combine with eventhandlers which have a required MetaDataValue

`

@EventHandler
public void on(SomePayload somePayload, @MetaDataValue(value = “someProperty”, required = true) String someProperty) {

}

`

In this case, don’t you risk blacklisting SomePayload if the first event does not have a “someProperty” metadata field?

I might also be understanding the code totally wrong,

Kr

Tom.

Hi Tom,

blacklisting is quite defensive. It will only blacklist events if there are no handlers that accept the specific event type.
In your case, your handlers accepts “SomePayload”, meaning that events for that type will not be blacklisted, if when several events came in with a missing “someProperty” in their metadata.

Hope this clears things up.
Cheers,

Hi Allard,

Thank you for clarifying but we are still reluctant to turn this feature on.
Is there some logging that we can activate to see what is being blacklisted/unblacklisted.

Also, is this blacklist sent to axonserver and are the events filtered there or is this a pure client side filter?
And a last one, is this filter persisted between reboots of the client/axonserver?

Kr

Tom.

I am going to try and answer my own question after going through the code but I might be wrong.

Logging can be enabled on axonserver for class io.axoniq.axonserver.localstorage.TrackingEventProcessorManager
There is a debug log statement for adding to the blacklist

`

public void addBlacklist(List blacklistList) {
logger.debug(“Blacklisted: {}”, blacklistList.get(0));
blacklistedTypes.addAll(blacklistList);
}

`
Though I am not sure about the correctness of this logging. Only the first element of the given list is logged but the entire list is added to the blacklisted types.

It seems that a blacklist is maintained in axonserver and that each ‘GetEventsRequest’ can add additional blacklisted events.

I am not sure about persistense between restarts.
I guess that if axonserver restarts the blacklist will be empty.
I am not sure that if a client restarts, the blacklist is reused or if that a new instance of the ‘TrackingEventProcessorManager’ is made.

Kr

Tom.

Hi Tom,

thanks for pointing out the logging issue. It will be fixed in the next release.

AxonServer maintains a blacklist for each separate Stream that has been opened. Essentially, this means that each Thread of a TrackingEventProcessor will have it’s own blacklist kept on the server. As soon as that connection breaks, the blacklist is reset. It will be rebuilt eventually as messages arrive (again). In other words, no blacklist state is maintained outside of the scope of a stream.

Cheers,