Class FanoutTransport
java.lang.Object
org.apache.activemq.transport.fanout.FanoutTransport
- All Implemented Interfaces:
Service,CompositeTransport,Transport
A Transport that fans out a connection to multiple brokers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidasyncRequest(Object command, ResponseCallback responseCallback) An asynchronous request response where the Receipt will be returned in the future.longintlongintintReturns a counter which gets incremented as data is read from the transport.longReturns the current transport listenerRetrieves the WireFormat instance associated with this Transport instance.booleanbooleanbooleanbooleanIndicates if the transport can handle faultsbooleanboolean<T> TvoidA one way asynchronous sendvoidvoidreconnect to another locationvoidA synchronous request responseA synchronous request responseprotected voidrestoreTransport(org.apache.activemq.transport.fanout.FanoutTransport.FanoutTransportHandler th) voidsetFanOutQueues(boolean fanOutQueues) voidsetInitialReconnectDelay(long initialReconnectDelay) voidsetMaxReconnectAttempts(int maxReconnectAttempts) voidsetMaxReconnectDelay(long maxReconnectDelay) voidsetMinAckCount(int minAckCount) voidsetPeerCertificates(X509Certificate[] certificates) Sets the certificates provided by the connected peer.voidsetReconnectDelayExponent(long reconnectDelayExponent) voidsetTransportListener(TransportListener commandListener) Registers an inbound command listenervoidstart()voidstop()protected voidtransportListenerOnCommand(Command command) voidupdateURIs(boolean reblance, URI[] uris) Provide a list of available alternative locations
-
Constructor Details
-
FanoutTransport
public FanoutTransport()
-
-
Method Details
-
start
-
stop
-
getMinAckCount
public int getMinAckCount() -
setMinAckCount
public void setMinAckCount(int minAckCount) -
getInitialReconnectDelay
public long getInitialReconnectDelay() -
setInitialReconnectDelay
public void setInitialReconnectDelay(long initialReconnectDelay) -
getMaxReconnectDelay
public long getMaxReconnectDelay() -
setMaxReconnectDelay
public void setMaxReconnectDelay(long maxReconnectDelay) -
getReconnectDelayExponent
public long getReconnectDelayExponent() -
setReconnectDelayExponent
public void setReconnectDelayExponent(long reconnectDelayExponent) -
getMaxReconnectAttempts
public int getMaxReconnectAttempts() -
setMaxReconnectAttempts
public void setMaxReconnectAttempts(int maxReconnectAttempts) -
oneway
Description copied from interface:TransportA one way asynchronous send- Specified by:
onewayin interfaceTransport- Throws:
IOException
-
asyncRequest
public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException Description copied from interface:TransportAn asynchronous request response where the Receipt will be returned in the future. If responseCallback is not null, then it will be called when the response has been completed.- Specified by:
asyncRequestin interfaceTransportresponseCallback- TODO- Returns:
- the FutureResponse
- Throws:
IOException
-
request
Description copied from interface:TransportA synchronous request response- Specified by:
requestin interfaceTransport- Returns:
- the response
- Throws:
IOException
-
request
Description copied from interface:TransportA synchronous request response- Specified by:
requestin interfaceTransport- Returns:
- the repsonse or null if timeout
- Throws:
IOException
-
reconnect
public void reconnect() -
getTransportListener
Description copied from interface:TransportReturns the current transport listener- Specified by:
getTransportListenerin interfaceTransport- Returns:
-
setTransportListener
Description copied from interface:TransportRegisters an inbound command listener- Specified by:
setTransportListenerin interfaceTransport
-
narrow
-
restoreTransport
protected void restoreTransport(org.apache.activemq.transport.fanout.FanoutTransport.FanoutTransportHandler th) throws Exception, IOException - Throws:
ExceptionIOException
-
add
- Specified by:
addin interfaceCompositeTransport
-
remove
- Specified by:
removein interfaceCompositeTransport
-
reconnect
Description copied from interface:Transportreconnect to another location- Specified by:
reconnectin interfaceTransport- Throws:
IOException- on failure of if not supported
-
isReconnectSupported
public boolean isReconnectSupported()- Specified by:
isReconnectSupportedin interfaceTransport- Returns:
- true if reconnect is supported
-
isUpdateURIsSupported
public boolean isUpdateURIsSupported()- Specified by:
isUpdateURIsSupportedin interfaceTransport- Returns:
- true if updating uris is supported
-
updateURIs
Description copied from interface:TransportProvide a list of available alternative locations- Specified by:
updateURIsin interfaceTransport- Throws:
IOException
-
getRemoteAddress
- Specified by:
getRemoteAddressin interfaceTransport- Returns:
- the remote address for this connection
-
transportListenerOnCommand
-
isFaultTolerant
public boolean isFaultTolerant()Description copied from interface:TransportIndicates if the transport can handle faults- Specified by:
isFaultTolerantin interfaceTransport- Returns:
- true if fault tolerant
-
isFanOutQueues
public boolean isFanOutQueues() -
setFanOutQueues
public void setFanOutQueues(boolean fanOutQueues) -
isDisposed
public boolean isDisposed()- Specified by:
isDisposedin interfaceTransport- Returns:
- true if the transport is disposed
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceTransport- Returns:
- true if the transport is connected
-
getReceiveCounter
public int getReceiveCounter()Description copied from interface:TransportReturns a counter which gets incremented as data is read from the transport. It should only be used to determine if there is progress being made in reading the next command from the transport. The value may wrap into the negative numbers.- Specified by:
getReceiveCounterin interfaceTransport- Returns:
- a counter which gets incremented as data is read from the transport.
-
getPeerCertificates
- Specified by:
getPeerCertificatesin interfaceTransport- Returns:
- the Certificates provided by the peer, or null if not a secure channel.
-
setPeerCertificates
Description copied from interface:TransportSets the certificates provided by the connected peer.- Specified by:
setPeerCertificatesin interfaceTransport- Parameters:
certificates- the Certificates provided by the peer.
-
getWireFormat
Description copied from interface:TransportRetrieves the WireFormat instance associated with this Transport instance.- Specified by:
getWireFormatin interfaceTransport- Returns:
- the WireFormat in use.
-