Highly abstracted event system which can make coding easy.
- New a evenx
@EvenxDeclare // it isn`t necessary
public class DemoEvenx extends BaseEvenx{
//something
}
- Use consumer
@EvenxConsumerController("demo") // producer app name. If value isn`t set , evenx will use local app name.
public class DemoController{
@EvenxConsumerMapping("xxx.DemoEvenx") // evenx class full name. If value isn`t set , evenx will use param class name.
public void demo(String demoEvenxJSON){
// do something
}
}
- Startup consumer
EvenxConsumerConfig consumerConfig = new EvenxConsumerConfig();
consumerConfig.setAppName("local");
consumerConfig.setMqHost("127.0.0.1");
consumerConfig.setMqPort(9876);
consumerConfig.setThreadNum(5);
consumerConfig.setScanPackage("com.stuben.evenx.consumer.LocalConsumerAction");
EvenxConsumerLauncher consumerLauncher = new EvenxConsumerLauncher();
consumerLauncher.startup();
- Use producer
EvenxProducerConfig producerConfig = new EvenxProducerConfig();
producerConfig.setAppName("local");
producerConfig.setMqHost("127.0.0.1");
producerConfig.setMqPort(9876);
producerConfig.setThreadNum(5);
EvenxProducer producer = new EvenxProducer(producerConfig);
producer.produce(new DemoEvenx());
- Evenx doesn`t use 'abstract class' to limit . Can it use annotation?
- Can use annotation to produce evenx after a method finish?
- Rocketmq is a persistent message system so it is too heavy. Can i just use a simple route table to share evenx?
- Finish the test case.
- Use remote seriallizer.
- Mq producer and consumer init outside.