public class BridgeImpl extends Object implements Bridge, SessionFailureListener, SendAcknowledgementHandler, ReadyListener, ClientProducerFlowCallback
Modifier and Type | Field and Description |
---|---|
protected boolean |
disconnectedAndDown |
protected Executor |
executor |
protected ScheduledFuture<?> |
futureScheduledReconnection
Used when there's a scheduled reconnection
|
protected Queue |
queue |
protected ScheduledExecutorService |
scheduledExecutor |
protected ServerLocatorInternal |
serverLocator |
protected ClientSessionInternal |
session |
protected ClientSessionInternal |
sessionConsumer |
protected TopologyMember |
targetNode |
protected String |
targetNodeID |
Constructor and Description |
---|
BridgeImpl(ServerLocatorInternal serverLocator,
int initialConnectAttempts,
int reconnectAttempts,
int reconnectAttemptsSameNode,
long retryInterval,
double retryMultiplier,
long maxRetryInterval,
UUID nodeUUID,
SimpleString name,
Queue queue,
Executor executor,
Filter filter,
SimpleString forwardingAddress,
ScheduledExecutorService scheduledExecutor,
Transformer transformer,
boolean useDuplicateDetection,
String user,
String password,
ActiveMQServer server,
ComponentConfigurationRoutingType routingType) |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
protected void |
afterConnect() |
protected Message |
beforeForward(Message message,
SimpleString forwardingAddress) |
protected Message |
beforeForwardingNoCopy(Message message,
SimpleString forwardingAddress)
ClusterConnectionBridge already makes a copy of the message.
|
void |
beforeReconnect(ActiveMQException exception)
Notifies that a connection has failed due to the specified exception.
|
protected void |
connect() |
void |
connectionFailed(ActiveMQException me,
boolean failedOver)
Notifies that a connection has failed due to the specified exception.
|
void |
connectionFailed(ActiveMQException me,
boolean failedOver,
String scaleDownTargetNodeID)
Notifies that a connection has failed due to the specified exception.
|
protected ClientSessionFactoryInternal |
createSessionFactory() |
String |
debug() |
void |
disconnect()
To be called when the server sent a disconnect to the client.
|
protected void |
fail(boolean permanently) |
void |
flushExecutor() |
ClientSessionFactoryImpl |
getCSF() |
List<MessageReference> |
getDeliveringMessages() |
static byte[] |
getDuplicateBytes(UUID nodeUUID,
long messageID) |
Executor |
getExecutor()
The cluster manager needs to use the same executor to close the serverLocator, otherwise the stop will break.
|
Filter |
getFilter() |
SimpleString |
getForwardingAddress() |
RemotingConnection |
getForwardingConnection() |
BridgeMetrics |
getMetrics() |
SimpleString |
getName() |
Queue |
getQueue() |
ClientSessionFactory |
getSessionFactory() |
TopologyMember |
getTargetNodeFromTopology()
for use in tests mainly
|
Transformer |
getTransformer() |
HandleStatus |
handle(MessageReference ref)
There was a change on semantic during 2.3 here.
We now first accept the message, and the actual deliver is done as part of Consumer.proceedDeliver(MessageReference) . |
boolean |
isBlockedOnFlowControl()
For tests mainly
|
boolean |
isConnected() |
boolean |
isStarted() |
protected void |
nodeUP(TopologyMember member,
boolean last) |
void |
onCreditsFail(ClientProducerCredits producerCredits) |
void |
onCreditsFlow(boolean blocked,
ClientProducerCredits producerCredits) |
void |
pause() |
void |
proceedDeliver(MessageReference ref)
This will proceed with the actual delivery.
|
void |
readyForWriting() |
protected ClientSessionFactoryInternal |
reconnectOnOriginalNode() |
void |
resume() |
protected void |
scheduleRetryConnect() |
protected void |
scheduleRetryConnectFixedTimeout(long milliseconds) |
void |
sendAcknowledged(Message message)
Notifies the client that a message sent asynchronously has been received by the server.
|
long |
sequentialID()
an unique sequential ID for this consumer
|
void |
setNotificationService(NotificationService notificationService) |
protected void |
setSessionFactory(ClientSessionFactoryInternal sfi) |
void |
start() |
void |
stop() |
String |
toManagementString()
This method will create a string representation meant for management operations.
|
String |
toString() |
protected void |
tryScheduleRetryReconnect(ActiveMQExceptionType type) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
errorProcessing, getPriority, promptDelivery, supportsDirectDelivery
sendFailed
protected final ServerLocatorInternal serverLocator
protected final Executor executor
protected final ScheduledExecutorService scheduledExecutor
protected final Queue queue
protected ScheduledFuture<?> futureScheduledReconnection
protected volatile ClientSessionInternal session
protected volatile ClientSessionInternal sessionConsumer
protected volatile boolean disconnectedAndDown
protected String targetNodeID
protected TopologyMember targetNode
public BridgeImpl(ServerLocatorInternal serverLocator, int initialConnectAttempts, int reconnectAttempts, int reconnectAttemptsSameNode, long retryInterval, double retryMultiplier, long maxRetryInterval, UUID nodeUUID, SimpleString name, Queue queue, Executor executor, Filter filter, SimpleString forwardingAddress, ScheduledExecutorService scheduledExecutor, Transformer transformer, boolean useDuplicateDetection, String user, String password, ActiveMQServer server, ComponentConfigurationRoutingType routingType)
public boolean isBlockedOnFlowControl()
public static final byte[] getDuplicateBytes(UUID nodeUUID, long messageID)
public ClientSessionFactory getSessionFactory()
public List<MessageReference> getDeliveringMessages()
getDeliveringMessages
in interface Consumer
public void setNotificationService(NotificationService notificationService)
setNotificationService
in interface Bridge
public void onCreditsFlow(boolean blocked, ClientProducerCredits producerCredits)
onCreditsFlow
in interface ClientProducerFlowCallback
public void onCreditsFail(ClientProducerCredits producerCredits)
onCreditsFail
in interface ClientProducerFlowCallback
public long sequentialID()
Consumer
sequentialID
in interface Consumer
public void start() throws Exception
start
in interface ActiveMQComponent
Exception
public void flushExecutor()
flushExecutor
in interface Bridge
public void disconnect()
Bridge
disconnect
in interface Bridge
disconnect
in interface Consumer
public boolean isConnected()
isConnected
in interface Bridge
public Executor getExecutor()
public void stop() throws Exception
stop
in interface ActiveMQComponent
Exception
public void pause() throws Exception
public void resume() throws Exception
public boolean isStarted()
isStarted
in interface ActiveMQComponent
public void activate()
public SimpleString getName()
public SimpleString getForwardingAddress()
getForwardingAddress
in interface Bridge
public RemotingConnection getForwardingConnection()
getForwardingConnection
in interface Bridge
public void sendAcknowledged(Message message)
SendAcknowledgementHandler
sendAcknowledged
in interface SendAcknowledgementHandler
message
- message sent asynchronouslyprotected Message beforeForward(Message message, SimpleString forwardingAddress)
protected Message beforeForwardingNoCopy(Message message, SimpleString forwardingAddress)
public void readyForWriting()
readyForWriting
in interface ReadyListener
public HandleStatus handle(MessageReference ref) throws Exception
Consumer
Consumer.proceedDeliver(MessageReference)
. This is to avoid holding a lock on the queues while
the delivery is being accomplished To avoid a lock on the queue in case of misbehaving
consumers.
This should return busy if handle is called before proceed deliver is called
public void proceedDeliver(MessageReference ref)
Consumer
proceedDeliver
in interface Consumer
public void connectionFailed(ActiveMQException me, boolean failedOver)
FailureListener
connectionFailed
in interface FailureListener
me
- exception which has caused the connection to failpublic void connectionFailed(ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
FailureListener
connectionFailed
in interface FailureListener
me
- exception which has caused the connection to failscaleDownTargetNodeID
- the ID of the node to which messages are scaling downprotected void tryScheduleRetryReconnect(ActiveMQExceptionType type)
public void beforeReconnect(ActiveMQException exception)
SessionFailureListener
beforeReconnect
in interface SessionFailureListener
exception
- exception which has caused the connection to failpublic TopologyMember getTargetNodeFromTopology()
public BridgeMetrics getMetrics()
getMetrics
in interface Bridge
public String toManagementString()
Consumer
toManagementString
in interface Consumer
public ClientSessionFactoryImpl getCSF()
public Transformer getTransformer()
protected void fail(boolean permanently)
protected ClientSessionFactoryInternal createSessionFactory() throws Exception
Exception
protected ClientSessionFactoryInternal reconnectOnOriginalNode() throws Exception
Exception
protected void setSessionFactory(ClientSessionFactoryInternal sfi)
protected void connect()
protected void scheduleRetryConnect()
protected void nodeUP(TopologyMember member, boolean last)
protected void scheduleRetryConnectFixedTimeout(long milliseconds)
Copyright © 2019 JBoss by Red Hat. All rights reserved.