I have this xml config:
And this bean:
If @ServiceActivator annotation is not present, <service-activator> calls random method from Handler (Class.getMethods() is unordered).
If @ServiceActivator annotation is present, everything works as expected.
I took me long time to find out why is my flow behaving strangely - when debugging it always worked, but not when running without debugging.
I understand there's power in choosing method during message processing and issuing exception during configuration is not an option, but there should be at least some warning issued during message processing if there's ambiguity in which method will be called.