Search in sources :

Example 1 with DisruptorBindEvent

use of com.lmax.disruptor.spring.boot.event.DisruptorBindEvent in project spring-boot-starter-samples by vindell.

the class DisruptorConfig method send.

// 每1s执行1次
@Scheduled(fixedDelay = 1000)
public void send() throws Exception {
    DisruptorBindEvent event = new DisruptorBindEvent(this, "message " + Math.random());
    event.setEvent("Event-Output");
    event.setTag("TagA-Output");
    event.setKey("id-" + Math.random());
    disruptorTemplate.publishEvent(event);
}
Also used : DisruptorBindEvent(com.lmax.disruptor.spring.boot.event.DisruptorBindEvent) Scheduled(org.springframework.scheduling.annotation.Scheduled)

Example 2 with DisruptorBindEvent

use of com.lmax.disruptor.spring.boot.event.DisruptorBindEvent in project spring-boot-starter-samples by vindell.

the class DisruptorConfig method send2.

// 每1s执行1次
@Scheduled(fixedDelay = 1000)
public void send2() throws Exception {
    DisruptorBindEvent event = new DisruptorBindEvent(this, "message " + Math.random());
    event.setEvent("Event-Output");
    event.setTag("TagB-Output");
    event.setKey("id-" + Math.random());
    disruptorTemplate.publishEvent(event);
}
Also used : DisruptorBindEvent(com.lmax.disruptor.spring.boot.event.DisruptorBindEvent) Scheduled(org.springframework.scheduling.annotation.Scheduled)

Aggregations

DisruptorBindEvent (com.lmax.disruptor.spring.boot.event.DisruptorBindEvent)2 Scheduled (org.springframework.scheduling.annotation.Scheduled)2