firefly alternatives and similar libraries
Based on the "Web" category.
Alternatively, view Firefly alternatives based on common mentions on social networks and blogs.
-
javalin
DISCONTINUED. A simple and modern Java and Kotlin web framework [Moved to: https://github.com/javalin/javalin] -
apollo-android
:rocket: A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform. -
http4k
The Functional toolkit for Kotlin HTTP applications. http4k provides a simple and uniform way to serve, consume, and test HTTP services. -
skrape.it
A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion. -
hexagon
Hexagon is a microservices toolkit written in Kotlin. Its purpose is to ease the building of services (Web applications or APIs) that run inside a cloud platform. -
tekniq
A framework designed around Kotlin providing Restful HTTP Client, JDBC DSL, Loading Cache, Configurations, Validations, and more -
Pellet
An opinionated, Kotlin-first web framework that helps you write fast, concise, and correct backend services 🚀. -
bootique-kotlin
DISCONTINUED. RETIRED. Provides extension functions and features for smooth development with Bootique and Kotlin. -
Zeko-RestApi
Asynchronous web framework for Kotlin. Create REST APIs in Kotlin easily with automatic Swagger/OpenAPI doc generation -
komock
KoMock - Simple HTTP/Consul/SpringConfig http server framework written in Kotlin. Wiremock use cases -
voyager-server-spring-boot-starter
Easily create REST endpoints with permissions (access control level) and hooks includeded
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of firefly or a related project?
README
What is Firefly?
Firefly framework is an asynchronous Java web framework. It helps you create a web application Easy and Quickly. It provides MVC framework, asynchronous HTTP Server/Client, asynchronous TCP Server/Client and many other useful components for developing web applications, protocol servers, etc. That means you can easy deploy your web without any other java web containers, in short, it's containerless. It taps into the fullest potential of hardware using SEDA architecture, a highly customizable thread model.
Firefly core provides functionality for things like:
- Writing TCP clients and servers
- Writing HTTP clients and servers
- Writing WebSocket clients and servers
- Writing web application with MVC framework and template engine
- Database access
Event driven
The Firefly APIs are largely event-driven. It means that when things happen in Firefly that you are interested in, Firefly will call you by sending you events.
Some example events are:
- some data has arrived on a socket
- an HTTP server has received a request
Firefly handles a lot of concurrencies using just a small number of threads, so don't block Firefly thread, you must manage blocking call in the standalone thread pool.
With a conventional blocking API the calling thread might block when:
- Thread.sleep()
- Waiting on a Lock
- Waiting on a mutex or monitor
- Doing a long-lived database operation and waiting for a result
- Call blocking I/O APIs
In all the above cases, when your thread is waiting for a result it can’t do anything else - it’s effectively useless.
It means that if you want a lot of concurrencies using blocking APIs, then you need a lot of threads to prevent your application grinding to a halt.
Threads have overhead regarding the memory they require (e.g. for their stack) and in context switching.
For the levels of concurrency required in many modern applications, a blocking approach just doesn’t scale.
Quick start
Add maven dependency in your pom.xml.
<dependency>
<groupId>com.fireflysource</groupId>
<artifactId>firefly</artifactId>
<version>5.0.0-alpha1</version>
</dependency>
<dependency>
<groupId>com.fireflysource</groupId>
<artifactId>firefly-slf4j</artifactId>
<version>5.0.0-alpha1</version>
</dependency>
Add log configuration file "firefly-log.xml" to the classpath.
<?xml version="1.0" encoding="UTF-8"?>
<loggers xmlns="http://www.fireflysource.com/loggers"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.fireflysource.com/loggers http://www.fireflysource.com/loggers.xsd">
<logger>
<name>firefly-system</name>
<level>INFO</level>
<path>${log.path}</path>
</logger>
<logger>
<name>firefly-monitor</name>
<level>INFO</level>
<path>${log.path}</path>
</logger>
</loggers>
Create the HTTP server and client
fun main() = runBlocking {
val httpServer = HttpServerFactory.create()
httpServer
.router().get("/test").handler {
it.end("Welcome")
}
.listen("localhost", 9999)
val client = HttpClientFactory.create()
val response = client.get("http://localhost:9999/test").submit().await()
println(response.status)
println(response.stringBody)
}
Create WebSocket server and client
fun main() = runBlocking {
val server = HttpServerFactory.create()
server
.websocket("/helloWebSocket")
.onMessage { frame, _ ->
if (frame.type == Frame.Type.TEXT && frame is TextFrame) {
println(frame.payloadAsUTF8)
}
Result.DONE
}
.onAccept { connection ->
connection.coroutineScope.launch {
while (true) {
connection.sendText("Server time: ${Date()}")
delay(1000)
}
}
Result.DONE
}
.listen("localhost", 8999)
val client = HttpClientFactory.create()
val webSocketConnection = client
.websocket("ws://localhost:8999/helloWebSocket")
.onMessage { frame, _ ->
if (frame.type == Frame.Type.TEXT && frame is TextFrame) {
println(frame.payloadAsUTF8)
}
Result.DONE
}
.connect()
.await()
launch {
while (true) {
delay(2000)
webSocketConnection.sendText("Client time: ${Date()}")
}
}
Unit
}
Contact information
- E-mail: [email protected]
- QQ Group: 126079579
- Wechat: AlvinQiu
*Note that all licence references and agreements mentioned in the firefly README section above
are relevant to that project's source code only.