Bob DeRemer
Bob DeRemer

Reputation: 329

How to use Netty for server to server binary websocket communication?

BACKGROUND: I have application server logic that hosts stateful object instances. I plan to have multiple servers - each hosting stateful object instances. NOTE: this is not a cluster with the same objects mirrored, but more of a federated model.

Each instance of my application server is using Netty and supports HTTP and WebSockets.

I wish to use the Netty WebSocket plumbing as the communication layer for not only server_1/server_2, but also for server_1/object_A talking to server_2/object_X.

For Example:

QUESTION (s):

From a network utilization standpoint, I would think option #2 would be preferred for all bi-directional communication between Server_1 and Server_2.

If you need any clarification or more details, please don't hesitate to ask.

Upvotes: 1

Views: 1299

Answers (1)

Norman Maurer
Norman Maurer

Reputation: 23557

If you want to send over Java classes I would recommend to use the marshalling encoder/decoder that ships with Netty[1].

To your other question, all operations on a Channel are Thread-safe.

[1] https://github.com/netty/netty/tree/3/src/main/java/org/jboss/netty/handler/codec/marshalling

Upvotes: 1

Related Questions