restfeed-server

REST Feed Server

Лицензия

Лицензия

Группа

Группа

org.restfeeds
Идентификатор

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

restfeed-server
Последняя версия

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

0.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

restfeed-server
REST Feed Server
Ссылка на сайт

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

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

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

http://github.com/rest-feeds/restfeed-server-java/tree/master

Скачать restfeed-server

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

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

Зависимости

test (2)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-engine jar 5.5.2
org.mockito : mockito-core jar 3.2.4

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

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

restfeed-server-java

Maven Central

Library to provide a REST Feed server endpoint in Java.

The library is written in pure Java and has no transitive dependencies.

Usage

Add this library to your pom.xml:

    <dependency>
      <groupId>org.restfeeds</groupId>
      <artifactId>restfeed-server</artifactId>
      <version>0.0.2</version>
    </dependency>

Spring Boot

Use this library when using Spring Boot:

Feel free to implement the server endpoint in a framework of your choice, such as Java EE, Quarkus, Kotlin, Spring Webflux, etc.

Further examples are highly appreciated.

Components

RestFeedEndpoint

This is the core class that handles long polling.

FeedItemRepository

You need to implement a FeedItemRepository with the database of your choice.

Feed items are stored in a repository in chronological order of addition. An SQL database is a good choice, as it provides auto incrementation of primary keys. A single partitioned Kafka topic may also be reasonable as repository, but it requires more custom client and offset handling.

Provide access to the database that stores the feed items.

Consider a good primary key that identifies a feed item and guarantees the chronological sequence of addition to the feed. An auto-incrementing database sequence is a good choice.

FeedItem

Java bean representing the data model of the returned feed items.

HTTP endpoint

You need to implement a GET endpoint in a HTTP framework of your choice.

This endpoint must call the RestFeedEndpoint#fetch method and pass the item offset and the page limit. The endpoint must support the next link.

This endpoint must support content negotiation.

NextLinkBuilder

You need to implement a NextLinkBuilder to point to your REST endpoint.

The next link must provide access to all subsequent feed items. The next link response must not include the current feed item(s).

It is up to the implementation, how this link is build and evaluated.

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

Версия
0.0.2
0.0.1