public class HttpMessenger extends Object implements Messenger
Messenger implementation using the HTTP protocol.
Unlike the helper-redis implementation, this class can only facilitate the communication between two clients at a time. However, unlike redis, the connection is direct.
The messenger works by sending/receiving HTTP POST requests. It is a simple (not necessarily the most efficient) implementation, which could be quite easily optimised if necessary - pooling connections would be a start!
Of course, a messenger using plain TCP sockets (optionally with a library like netty) could work just as well.
| Constructor and Description |
|---|
HttpMessenger(String host,
int port,
String remoteHost,
int remotePort) |
| Modifier and Type | Method and Description |
|---|---|
<T> Channel<T> |
getChannel(String name,
com.google.common.reflect.TypeToken<T> type)
Gets a channel by name.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChannel, getConversationChannel, getConversationChannel, getReqRespChannel, getReqRespChannel@Nonnull public <T> Channel<T> getChannel(@Nonnull String name, @Nonnull com.google.common.reflect.TypeToken<T> type)
MessengergetChannel in interface MessengerT - the channel message typename - the name of the channel.type - the channel message typetokenCopyright © 2022. All rights reserved.