I tried a sample example to see how agenda-group works. Initially I set the focus of ksession to agenda-group \"ag1\" and fired the rules.
package com.sample
im
Since you changed facts in the session (your Message object is in your facts i guess) during the computation of a rule, other rules are computed again, not depending on the agenda-group they belong to, in order to update the Drools knowledge base.
You could add no-loop true
to prevent this on the line after rule
definition
I'm not quiet sure, but it's the behavior i noticed on my app and should so resolve your infinite loop. By the way, it seems logical to compute again rules when facts change.