Skip to content

KyleKreuter/avenue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Avenue

Avenue is a high-performance TCP Pub-Sub server designed to handle thousands of requests per second, leveraging the power of Java Virtual Threads. Virtual Threads, introduced in Java 21, provide lightweight JVM-managed threads that consume significantly fewer resources than traditional platform threads.

API Overview

Although this project is not production-ready, you can test the API by following these steps. To get started, create an instance of AvenueClient and register your TopicListeners.

Example Usage

public class Main {
    public static void main(String[] args) throws IOException, InterruptedException {
        AvenueClient avenueClient = AvenueClient.getInstance();
        avenueClient.registerTopicListener(new TopicListener() {
            @Override
            @Topic("test-topic")
            public void onMessage(Message message) {
                System.out.println("A message was received: " + message.data());
            }
        });
    }
}

Key Notes

  • Add the @Topic annotation to the onMessage method to specify the topic the listener is subscribed to.
  • Ensure proper exception handling for IO and interruptions

About

A lightweight tcp pub-sub server utilising the power of virtual threads

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages