Event Stream

Library to abstract publish and subscribe implementation in an event-based arquitecture

Лицензия

Лицензия

Группа

Группа

com.github.malkomich
Идентификатор

Идентификатор

event-stream
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Event Stream
Library to abstract publish and subscribe implementation in an event-based arquitecture
Ссылка на сайт

Ссылка на сайт

https://github.com/malkomich/event-stream
Система контроля версий

Система контроля версий

https://github.com/malkomich/event-stream

Скачать event-stream

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.malkomich/event-stream/ -->
<dependency>
    <groupId>com.github.malkomich</groupId>
    <artifactId>event-stream</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.malkomich/event-stream/
implementation 'com.github.malkomich:event-stream:1.0.1'
// https://jarcasting.com/artifacts/com.github.malkomich/event-stream/
implementation ("com.github.malkomich:event-stream:1.0.1")
'com.github.malkomich:event-stream:jar:1.0.1'
<dependency org="com.github.malkomich" name="event-stream" rev="1.0.1">
  <artifact name="event-stream" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.malkomich', module='event-stream', version='1.0.1')
)
libraryDependencies += "com.github.malkomich" % "event-stream" % "1.0.1"
[com.github.malkomich/event-stream "1.0.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
io.vertx : vertx-kafka-client jar 3.5.4

Модули Проекта

Данный проект не имеет модулей.

Event Stream

Build Status

Overview

Library to abstract publish and subscribe implementation in an event-based arquitecture.

Requisites

  • Java 8+
  • Maven 3+

Install

Gradle

    dependencies {
        compile 'com.github.malkomich:event-stream:1.0.2'
    }

Maven

    <dependency>
        <groupId>com.github.malkomich</groupId>
        <artifactId>event-stream</artifactId>
        <version>1.0.2</version>
    </dependency>

Usage

INITIALIZATION:
final KafkaConfig config = KafkaConfig.builder()
    .server("localhost:9092")
    .groupId("groupId")
    .build();

final EventService eventService = EventComponent.builder()
    .vertx(vertx)
    .kafkaConfig(config)
    .build();
PUBLISH:
final EventTopic topic = BetchainTopic.QUOTE; // You can build your own EventTopic implementation

final PublishRequest request = PublishRequest.builder()
    .topic(topic)
    .message(data.toJson())
    .build();

eventService.publish(request, onEventPublished -> {
    if (onEventPublished.succeeded()) {
        future.complete();
    } else {
        future.fail(onEventPublished.cause());
    }
});
SUBSCRIBE:
final EventTopic topic = BetchainTopic.QUOTE; // You can build your own EventTopic implementation

final SubscribeRequest request = SubscribeRequest.builder()
    .topic(topic)
    .handler(onEventReceived ->
            scrappingRepository.execute(onEventReceived.value(), Future.future()))
    .build();

eventService.subscribe(request, onSubscribed -> {
    if (onSubscribed.succeeded()) {
        handler.handle(Future.succeededFuture());
    } else {
        handler.handle(Future.failedFuture(onSubscribed.cause()));
    }
});

License

Apache License

Версии библиотеки

Версия
1.0.1
1.0.0