org.cg.eventbus.policy.StrictCommitPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.cg.eventbus Show documentation
Show all versions of org.cg.eventbus Show documentation
Simplified messaging programming model with kafka implementation.
package org.cg.eventbus.policy;
import org.cg.eventbus.message.Message;
/**
* A very strict commit policy.
* Consumer will commit its offset after consume every single message.
* @author liang.li
*
*/
public class StrictCommitPolicy extends CommitPolicy{
public StrictCommitPolicy() {
super();
}
@Override
public boolean needCommit() {
return true;
}
@Override
public boolean needCommit(Message msg) {
return true;
}
}