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

Client Listener cannot be registered to Infinispan Server in native mode (Quarkus) #96

Open
luclachapelle opened this issue May 28, 2022 · 0 comments

Comments

@luclachapelle
Copy link

luclachapelle commented May 28, 2022

It is not possible to register any client listener to Infinispan Server in native mode via a HotRod Client.

Tried with both a C# and Java HotRod Clients and both end up with same error server side.

  • not working with infinispan-quarkus
  • does work with infinispan JVM mode

Error Message
image

Warning text/plain: ISPN000133: Attempted to register listener of class class org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender, but no valid, public methods annotated with method-level event annotations found! Ignoring listener.

Issue
The problem resides in ClientListenerRegistry .

The OnCacheEvent() method having the CacheEntry annotations is implemented in the BaseClientEventSender abstract class. Those method annotations are not discovered in the class in native mode (they are in JVM mode though).

As per the error message, it is clear it sees the class Listener annotation on StatelessClientEventSender() private class, but then nothing for the method level annotations.

The code scanning for the annotations is AbstractListenerImpl via the method validateAndAddListenerInvocations()

Investigation
I moved the OnCacheEvent() method and its annotations from the BaseClientEventSender class to the concrete classes being: StatelessClientEventSender and StatefulClientEventSender and recompiled Infinispan then recompiled infinispan-quarkus in native mode and it was working fine then.

So I guess either have the reflection would need to be fixed in native mode or Infinispan be modified as per the above suggestion, but I think the better would be to have the reflection fixed in infinispan-quarkus so that if other annotated classes with similar definition are implemented in Infinispan then it would work right away in native mode.

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant