r/java • • Jan 16 '23

Building a PostgreSQL Wire Protocol Server using Vanilla, Modern Java 21 (shows use of: Records, Sealed Types, Pattern Matching for Switch, Virtual Threads, and Panama FFM)

https://gavinray97.github.io/blog/postgres-wire-protocol-jdk-21
224 Upvotes

23 comments sorted by

View all comments

3

u/bytedonor Jan 16 '23 edited Jan 16 '23

Why not just use ‘ServerSocket’, accept connections on main and pass the open socket to a VT executor task? I did something like this recently and was able to pump data across 500K web sockets in my test

1

u/rbygrave Jan 18 '23

This is how Helidon Nima does it as well.