DataCarrier

DataCarrier is a light, embed, high-throughput, publish-subscribe MQ.

This project has been included and donated into Apache software foundation, as a part of Apache SkyWalking.

Sky-Walking APM uses DataCarrier in sky-walking agaent, one implementation version is used in OneAPM Ai commercial edition. See skywalking version.

Coverage Status Download

Why need DataCarrier

Download

How to use

or

/**
 * set consumers to this Carrier.
 * consumer begin to run when {@link DataCarrier<T>#produce(T)} begin to work.
 *
 * @param consumer single instance of consumer, all consumer threads will all use this instance.
 * @param num      number of consumer threads
 * @return
 */
carrier.consume(consumer, 10);

- create a consumer (sample)
```java
public class SampleConsumer implements IConsumer<SampleData> {
    public int i = 1;

    @Override
    public void init() {

    }

    @Override
    public void consume(List<SampleData> data) {
        for(SampleData one : data) {
            one.setIntValue(this.hashCode());
            ConsumerTest.buffer.offer(one);
        }
    }

    @Override
    public void onError(List<SampleData> data, Throwable t) {

    }

    @Override
    public void onExit() {

    }
}

Doc

(中文)SkyWalking子项目--DataCarrier 1.0 解读