...
Code Block | ||
---|---|---|
| ||
public void class OrderTaker ... { @Consumer public void onOrder(Order order) { .... } } |
Configuration
Ring buffer channels have the following configuration options:
...
Code Block | ||
---|---|---|
| ||
public class PooledWorker { @Monitor protected SystemMonitor monitor; @Property protected int ordinal; @Property protected int numberOfConsumers; @Consumer public void onEvent(ChannelEvent event) { if ((event.getSequence() % numberOfConsumers) != ordinal) { // ignore the event if it is not for this consumer return; } String message = event.getEvent(String.class); monitor.process(ordinal, message); } } |
...