public class RedisTransporter extends Transporter implements com.lambdaworks.redis.event.EventBus, com.lambdaworks.redis.pubsub.RedisPubSubListener<byte[],byte[]>
ServiceBroker broker = ServiceBroker.builder().nodeID("node1")
.transporter(new RedisTransporter("localhost")).build();
Required dependency:| Modifier and Type | Field and Description |
|---|---|
protected RedisPubSubClient |
clientPub |
protected RedisPubSubClient |
clientSub |
protected java.lang.String |
password |
protected boolean |
secure |
protected java.util.concurrent.atomic.AtomicInteger |
status |
protected static int |
STATUS_CONNECTED |
protected static int |
STATUS_CONNECTING_1 |
protected static int |
STATUS_CONNECTING_2 |
protected static int |
STATUS_DISCONNECTED |
protected static int |
STATUS_DISCONNECTING |
protected java.lang.String[] |
urls |
checkTimeoutTimer, counterTransporterPacketsReceivedBytes, counterTransporterPacketsReceivedTotal, counterTransporterPacketsSentBytes, counterTransporterPacketsSentTotal, debug, debugHeartbeats, disconnectChannel, discoverBroadcastChannel, discoverChannel, eventbus, eventChannel, executor, gaugeTransitConnected, heartbeatChannel, heartbeatInterval, heartbeatTimeout, heartBeatTimer, infoBroadcastChannel, infoChannel, infoScheduled, infoScheduledAt, instanceID, lastReceivedMessageAt, metrics, monitor, namespace, nodeID, nodes, offlineTimeout, PACKET_DISCONNECT, PACKET_DISCOVER, PACKET_EVENT, PACKET_HEARTBEAT, PACKET_INFO, PACKET_PING, PACKET_PONG, PACKET_REQUEST, PACKET_RESPONSE, pingChannel, pongChannel, preferHostname, prefix, protocolVersion, registry, requestChannel, responseChannel, scheduler, serializer, serviceInvoker, subscriptionTimeout, uidGenerator, usingJsonSerializerbroker, logger, nameMOLECULER_CACHER_CLEAN_TIME, MOLECULER_CACHER_CLEAN_TIME_DESC, MOLECULER_CACHER_CLEAN_TOTAL, MOLECULER_CACHER_CLEAN_TOTAL_DESC, MOLECULER_CACHER_DEL_TIME, MOLECULER_CACHER_DEL_TIME_DESC, MOLECULER_CACHER_DEL_TOTAL, MOLECULER_CACHER_DEL_TOTAL_DESC, MOLECULER_CACHER_EXPIRED_TOTAL, MOLECULER_CACHER_EXPIRED_TOTAL_DESC, MOLECULER_CACHER_FOUND_TOTAL, MOLECULER_CACHER_FOUND_TOTAL_DESC, MOLECULER_CACHER_GET_TIME, MOLECULER_CACHER_GET_TIME_DESC, MOLECULER_CACHER_GET_TOTAL, MOLECULER_CACHER_GET_TOTAL_DESC, MOLECULER_CACHER_SET_TIME, MOLECULER_CACHER_SET_TIME_DESC, MOLECULER_CACHER_SET_TOTAL, MOLECULER_CACHER_SET_TOTAL_DESC, MOLECULER_CIRCUIT_BREAKER_HALF_OPENED_ACTIVE, MOLECULER_CIRCUIT_BREAKER_HALF_OPENED_ACTIVE_DESC, MOLECULER_CIRCUIT_BREAKER_OPENED_ACTIVE, MOLECULER_CIRCUIT_BREAKER_OPENED_ACTIVE_DESC, MOLECULER_CIRCUIT_BREAKER_OPENED_TOTAL, MOLECULER_CIRCUIT_BREAKER_OPENED_TOTAL_DESC, MOLECULER_EVENT_BROADCAST_TOTAL, MOLECULER_EVENT_BROADCAST_TOTAL_DESC, MOLECULER_EVENT_BROADCASTLOCAL_TOTAL, MOLECULER_EVENT_BROADCASTLOCAL_TOTAL_DESC, MOLECULER_EVENT_EMIT_TOTAL, MOLECULER_EVENT_EMIT_TOTAL_DESC, MOLECULER_EVENT_RECEIVED_ACTIVE, MOLECULER_EVENT_RECEIVED_ACTIVE_DESC, MOLECULER_EVENT_RECEIVED_ERROR_TOTAL, MOLECULER_EVENT_RECEIVED_ERROR_TOTAL_DESC, MOLECULER_EVENT_RECEIVED_TIME, MOLECULER_EVENT_RECEIVED_TIME_DESC, MOLECULER_EVENT_RECEIVED_TOTAL, MOLECULER_EVENT_RECEIVED_TOTAL_DESC, MOLECULER_EXECUTOR, MOLECULER_REQUEST_ACTIVE, MOLECULER_REQUEST_ACTIVE_DESC, MOLECULER_REQUEST_ERROR_TOTAL, MOLECULER_REQUEST_ERROR_TOTAL_DESC, MOLECULER_REQUEST_LEVELS, MOLECULER_REQUEST_LEVELS_DESC, MOLECULER_REQUEST_RETRY_ATTEMPTS_TOTAL, MOLECULER_REQUEST_RETRY_ATTEMPTS_TOTAL_DESC, MOLECULER_REQUEST_TIME, MOLECULER_REQUEST_TIME_DESC, MOLECULER_REQUEST_TIMEOUT_TOTAL, MOLECULER_REQUEST_TIMEOUT_TOTAL_DESC, MOLECULER_REQUEST_TOTAL, MOLECULER_REQUEST_TOTAL_DESC, MOLECULER_SCHEDULER, MOLECULER_TRANSIT_CONNECTED, MOLECULER_TRANSIT_CONNECTED_DESC, MOLECULER_TRANSIT_ORPHAN_RESPONSE_TOTAL, MOLECULER_TRANSIT_ORPHAN_RESPONSE_TOTAL_DESC, MOLECULER_TRANSIT_REQUESTS_ACTIVE, MOLECULER_TRANSIT_REQUESTS_ACTIVE_DESC, MOLECULER_TRANSIT_STREAMS_RECEIVE_ACTIVE, MOLECULER_TRANSIT_STREAMS_RECEIVE_ACTIVE_DESC, MOLECULER_TRANSPORTER_PACKETS_RECEIVED_BYTES, MOLECULER_TRANSPORTER_PACKETS_RECEIVED_BYTES_DESC, MOLECULER_TRANSPORTER_PACKETS_RECEIVED_TOTAL, MOLECULER_TRANSPORTER_PACKETS_RECEIVED_TOTAL_DESC, MOLECULER_TRANSPORTER_PACKETS_SENT_BYTES, MOLECULER_TRANSPORTER_PACKETS_SENT_BYTES_DESC, MOLECULER_TRANSPORTER_PACKETS_SENT_TOTAL, MOLECULER_TRANSPORTER_PACKETS_SENT_TOTAL_DESC| Constructor and Description |
|---|
RedisTransporter() |
RedisTransporter(java.lang.String... urls) |
RedisTransporter(java.lang.String password,
boolean secure,
java.lang.String... urls) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect() |
protected io.datatree.Promise |
disconnect() |
protected void |
error(java.lang.Throwable cause)
Any I/O error occurred.
|
rx.Observable<com.lambdaworks.redis.event.Event> |
get() |
java.lang.String |
getPassword() |
java.lang.String[] |
getUrls() |
boolean |
isSecure() |
void |
message(byte[] channel,
byte[] message) |
void |
message(byte[] pattern,
byte[] channel,
byte[] message) |
void |
psubscribed(byte[] pattern,
long count) |
void |
publish(com.lambdaworks.redis.event.Event event) |
void |
publish(java.lang.String channel,
io.datatree.Tree message) |
void |
punsubscribed(byte[] pattern,
long count) |
protected void |
reconnect() |
void |
setPassword(java.lang.String password) |
void |
setSecure(boolean secure) |
void |
setUrls(java.lang.String[] urls) |
void |
stopped()
Closes transporter.
|
io.datatree.Promise |
subscribe(java.lang.String channel) |
void |
subscribed(byte[] channel,
long count) |
protected void |
unableToConnect(java.lang.Exception cause) |
void |
unsubscribed(byte[] channel,
long count) |
broadcastInfoPacket, broadcastNodeConnected, broadcastNodeDisconnected, broadcastNodeUpdated, broadcastTransporterConnected, broadcastTransporterDisconnected, channel, checkTimeouts, connected, connected, createPingPacket, getAddress, getAllNodeIDs, getCpuUsage, getDescriptor, getHeartbeatInterval, getHeartbeatTimeout, getInstanceID, getLastHeartbeatTime, getNamespace, getOfflineTimeout, getPrefix, getSerializer, getSubscriptionTimeout, isDebug, isDebugHeartbeats, isOnline, isPreferHostname, processReceivedMessage, processReceivedMessage, publish, received, scheduleInfoPacket, sendClosePacket, sendDataPacket, sendDisconnectPacket, sendDiscoverPacket, sendErrorPacket, sendEventPacket, sendHeartbeatPacket, sendInfoPacket, sendPongPacket, sendRequestPacket, setDebug, setDebugHeartbeats, setHeartbeatInterval, setHeartbeatTimeout, setNamespace, setOfflineTimeout, setPreferHostname, setPrefix, setSerializer, setSubscriptionTimeout, started, subscribe, updateNodeInfogetBroker, getLogger, getNameprotected static final int STATUS_DISCONNECTING
protected static final int STATUS_DISCONNECTED
protected static final int STATUS_CONNECTING_1
protected static final int STATUS_CONNECTING_2
protected static final int STATUS_CONNECTED
protected final java.util.concurrent.atomic.AtomicInteger status
protected java.lang.String password
protected boolean secure
protected java.lang.String[] urls
protected RedisPubSubClient clientSub
protected RedisPubSubClient clientPub
public RedisTransporter()
public RedisTransporter(java.lang.String... urls)
public RedisTransporter(java.lang.String password,
boolean secure,
java.lang.String... urls)
public void connect()
connect in class Transporterprotected void unableToConnect(java.lang.Exception cause)
protected io.datatree.Promise disconnect()
protected void reconnect()
protected void error(java.lang.Throwable cause)
Transportererror in class Transportercause - I/O errorpublic void stopped()
stopped in interface MoleculerLifecyclestopped in class Transporterpublic io.datatree.Promise subscribe(java.lang.String channel)
subscribe in class Transporterpublic void publish(java.lang.String channel,
io.datatree.Tree message)
publish in class Transporterpublic void message(byte[] channel,
byte[] message)
message in interface com.lambdaworks.redis.pubsub.RedisPubSubListener<byte[],byte[]>public void message(byte[] pattern,
byte[] channel,
byte[] message)
message in interface com.lambdaworks.redis.pubsub.RedisPubSubListener<byte[],byte[]>public void subscribed(byte[] channel,
long count)
subscribed in interface com.lambdaworks.redis.pubsub.RedisPubSubListener<byte[],byte[]>public void psubscribed(byte[] pattern,
long count)
psubscribed in interface com.lambdaworks.redis.pubsub.RedisPubSubListener<byte[],byte[]>public void unsubscribed(byte[] channel,
long count)
unsubscribed in interface com.lambdaworks.redis.pubsub.RedisPubSubListener<byte[],byte[]>public void punsubscribed(byte[] pattern,
long count)
punsubscribed in interface com.lambdaworks.redis.pubsub.RedisPubSubListener<byte[],byte[]>public void publish(com.lambdaworks.redis.event.Event event)
publish in interface com.lambdaworks.redis.event.EventBuspublic rx.Observable<com.lambdaworks.redis.event.Event> get()
get in interface com.lambdaworks.redis.event.EventBuspublic java.lang.String[] getUrls()
public void setUrls(java.lang.String[] urls)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public boolean isSecure()
public void setSecure(boolean secure)