public class BridgeImpl extends Object implements Bridge, org.apache.activemq.artemis.api.core.client.SessionFailureListener, org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler, org.apache.activemq.artemis.spi.core.remoting.ReadyListener
| Modifier and Type | Field and Description |
|---|---|
protected Executor |
executor |
protected ScheduledFuture<?> |
futureScheduledReconnection
Used when there's a scheduled reconnection
|
protected ScheduledExecutorService |
scheduledExecutor |
protected org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal |
serverLocator |
protected org.apache.activemq.artemis.core.client.impl.ClientSessionInternal |
session |
protected org.apache.activemq.artemis.core.client.impl.ClientSessionInternal |
sessionConsumer |
protected org.apache.activemq.artemis.api.core.client.TopologyMember |
targetNode |
protected String |
targetNodeID |
| Constructor and Description |
|---|
BridgeImpl(org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal serverLocator,
int initialConnectAttempts,
int reconnectAttempts,
int reconnectAttemptsSameNode,
long retryInterval,
double retryMultiplier,
long maxRetryInterval,
org.apache.activemq.artemis.utils.UUID nodeUUID,
org.apache.activemq.artemis.api.core.SimpleString name,
Queue queue,
Executor executor,
Filter filter,
org.apache.activemq.artemis.api.core.SimpleString forwardingAddress,
ScheduledExecutorService scheduledExecutor,
Transformer transformer,
boolean useDuplicateDetection,
String user,
String password,
StorageManager storageManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
protected void |
afterConnect() |
protected ServerMessage |
beforeForward(ServerMessage message) |
void |
beforeReconnect(org.apache.activemq.artemis.api.core.ActiveMQException exception) |
protected void |
connect() |
void |
connectionFailed(org.apache.activemq.artemis.api.core.ActiveMQException me,
boolean failedOver) |
void |
connectionFailed(org.apache.activemq.artemis.api.core.ActiveMQException me,
boolean failedOver,
String scaleDownTargetNodeID) |
protected org.apache.activemq.artemis.core.client.impl.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() |
org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl |
getCSF() |
List<MessageReference> |
getDeliveringMessages() |
static byte[] |
getDuplicateBytes(org.apache.activemq.artemis.utils.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() |
org.apache.activemq.artemis.api.core.SimpleString |
getForwardingAddress() |
org.apache.activemq.artemis.spi.core.protocol.RemotingConnection |
getForwardingConnection() |
org.apache.activemq.artemis.api.core.SimpleString |
getName() |
Queue |
getQueue() |
org.apache.activemq.artemis.api.core.client.ClientSessionFactory |
getSessionFactory() |
org.apache.activemq.artemis.api.core.client.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 |
isConnected() |
protected boolean |
isPlainCoreBridge() |
boolean |
isStarted() |
void |
pause() |
void |
proceedDeliver(MessageReference ref)
This will proceed with the actual delivery.
|
void |
readyForWriting() |
void |
resume() |
protected void |
scheduleRetryConnect() |
protected void |
scheduleRetryConnectFixedTimeout(long milliseconds) |
void |
sendAcknowledged(org.apache.activemq.artemis.api.core.Message message) |
void |
setNotificationService(org.apache.activemq.artemis.core.server.management.NotificationService notificationService) |
protected void |
setSessionFactory(org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal sfi) |
void |
start() |
void |
stop() |
String |
toManagementString()
This method will create a string representation meant for management operations.
|
String |
toString() |
protected void |
tryScheduleRetryReconnect(org.apache.activemq.artemis.api.core.ActiveMQExceptionType type) |
protected final org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal serverLocator
protected final Executor executor
protected final ScheduledExecutorService scheduledExecutor
protected ScheduledFuture<?> futureScheduledReconnection
protected volatile org.apache.activemq.artemis.core.client.impl.ClientSessionInternal session
protected volatile org.apache.activemq.artemis.core.client.impl.ClientSessionInternal sessionConsumer
protected String targetNodeID
protected org.apache.activemq.artemis.api.core.client.TopologyMember targetNode
public BridgeImpl(org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal serverLocator,
int initialConnectAttempts,
int reconnectAttempts,
int reconnectAttemptsSameNode,
long retryInterval,
double retryMultiplier,
long maxRetryInterval,
org.apache.activemq.artemis.utils.UUID nodeUUID,
org.apache.activemq.artemis.api.core.SimpleString name,
Queue queue,
Executor executor,
Filter filter,
org.apache.activemq.artemis.api.core.SimpleString forwardingAddress,
ScheduledExecutorService scheduledExecutor,
Transformer transformer,
boolean useDuplicateDetection,
String user,
String password,
StorageManager storageManager)
public static final byte[] getDuplicateBytes(org.apache.activemq.artemis.utils.UUID nodeUUID,
long messageID)
public org.apache.activemq.artemis.api.core.client.ClientSessionFactory getSessionFactory()
public List<MessageReference> getDeliveringMessages()
getDeliveringMessages in interface Consumerpublic void setNotificationService(org.apache.activemq.artemis.core.server.management.NotificationService notificationService)
setNotificationService in interface Bridgepublic void start()
throws Exception
start in interface org.apache.activemq.artemis.core.server.ActiveMQComponentExceptionpublic void flushExecutor()
flushExecutor in interface Bridgepublic void disconnect()
Bridgedisconnect in interface Bridgedisconnect in interface Consumerpublic boolean isConnected()
isConnected in interface Bridgepublic Executor getExecutor()
public void stop()
throws Exception
stop in interface org.apache.activemq.artemis.core.server.ActiveMQComponentExceptionpublic void pause()
throws Exception
public void resume()
throws Exception
public boolean isStarted()
isStarted in interface org.apache.activemq.artemis.core.server.ActiveMQComponentpublic void activate()
public org.apache.activemq.artemis.api.core.SimpleString getName()
public org.apache.activemq.artemis.api.core.SimpleString getForwardingAddress()
getForwardingAddress in interface Bridgepublic org.apache.activemq.artemis.spi.core.protocol.RemotingConnection getForwardingConnection()
getForwardingConnection in interface Bridgepublic void sendAcknowledged(org.apache.activemq.artemis.api.core.Message message)
sendAcknowledged in interface org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandlerprotected boolean isPlainCoreBridge()
protected ServerMessage beforeForward(ServerMessage message)
public void readyForWriting()
readyForWriting in interface org.apache.activemq.artemis.spi.core.remoting.ReadyListenerpublic HandleStatus handle(MessageReference ref) throws Exception
ConsumerConsumer.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)
ConsumerproceedDeliver in interface Consumerpublic void connectionFailed(org.apache.activemq.artemis.api.core.ActiveMQException me,
boolean failedOver)
connectionFailed in interface org.apache.activemq.artemis.core.remoting.FailureListenerpublic void connectionFailed(org.apache.activemq.artemis.api.core.ActiveMQException me,
boolean failedOver,
String scaleDownTargetNodeID)
connectionFailed in interface org.apache.activemq.artemis.core.remoting.FailureListenerprotected void tryScheduleRetryReconnect(org.apache.activemq.artemis.api.core.ActiveMQExceptionType type)
public void beforeReconnect(org.apache.activemq.artemis.api.core.ActiveMQException exception)
beforeReconnect in interface org.apache.activemq.artemis.api.core.client.SessionFailureListenerpublic org.apache.activemq.artemis.api.core.client.TopologyMember getTargetNodeFromTopology()
public String toManagementString()
ConsumertoManagementString in interface Consumerpublic org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl getCSF()
public Transformer getTransformer()
protected void fail(boolean permanently)
protected org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal createSessionFactory()
throws Exception
Exceptionprotected void setSessionFactory(org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal sfi)
protected void connect()
protected void scheduleRetryConnect()
protected void scheduleRetryConnectFixedTimeout(long milliseconds)
Copyright © 2023 The Apache Software Foundation. All rights reserved.