Search in sources :

Example 1 with IncomingInterceptorLookingForExceptionMessage

use of org.apache.activemq.artemis.core.server.cluster.ClusterManager.IncomingInterceptorLookingForExceptionMessage in project activemq-artemis by apache.

the class ClusterConnectionImpl method createNewRecord.

private void createNewRecord(final long eventUID, final String targetNodeID, final TransportConfiguration connector, final SimpleString queueName, final Queue queue, final boolean start) throws Exception {
    String nodeId;
    synchronized (this) {
        if (!started) {
            return;
        }
        if (serverLocator == null) {
            return;
        }
        nodeId = serverLocator.getNodeID();
    }
    final ServerLocatorInternal targetLocator = new ServerLocatorImpl(topology, true, connector);
    targetLocator.setReconnectAttempts(0);
    targetLocator.setInitialConnectAttempts(0);
    targetLocator.setClientFailureCheckPeriod(clientFailureCheckPeriod);
    targetLocator.setConnectionTTL(connectionTTL);
    targetLocator.setInitialConnectAttempts(0);
    targetLocator.setConfirmationWindowSize(confirmationWindowSize);
    targetLocator.setBlockOnDurableSend(!useDuplicateDetection);
    targetLocator.setBlockOnNonDurableSend(!useDuplicateDetection);
    targetLocator.setRetryInterval(retryInterval);
    targetLocator.setMaxRetryInterval(maxRetryInterval);
    targetLocator.setRetryIntervalMultiplier(retryIntervalMultiplier);
    targetLocator.setMinLargeMessageSize(minLargeMessageSize);
    // No producer flow control on the bridges by default, as we don't want to lock the queues
    targetLocator.setProducerWindowSize(this.producerWindowSize);
    targetLocator.setAfterConnectionInternalListener(this);
    serverLocator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance(serverLocator));
    targetLocator.setNodeID(nodeId);
    targetLocator.setClusterTransportConfiguration(serverLocator.getClusterTransportConfiguration());
    if (retryInterval > 0) {
        targetLocator.setRetryInterval(retryInterval);
    }
    targetLocator.disableFinalizeCheck();
    targetLocator.addIncomingInterceptor(new IncomingInterceptorLookingForExceptionMessage(manager, executorFactory.getExecutor()));
    MessageFlowRecordImpl record = new MessageFlowRecordImpl(targetLocator, eventUID, targetNodeID, connector, queueName, queue);
    ClusterConnectionBridge bridge = new ClusterConnectionBridge(this, manager, targetLocator, serverLocator, initialConnectAttempts, reconnectAttempts, retryInterval, retryIntervalMultiplier, maxRetryInterval, nodeManager.getUUID(), record.getEventUID(), record.getTargetNodeID(), record.getQueueName(), record.getQueue(), executorFactory.getExecutor(), null, null, scheduledExecutor, null, useDuplicateDetection, clusterUser, clusterPassword, server, managementService.getManagementAddress(), managementService.getManagementNotificationAddress(), record, record.getConnector(), storeAndForwardPrefix);
    targetLocator.setIdentity("(Cluster-connection-bridge::" + bridge.toString() + "::" + this.toString() + ")");
    if (logger.isDebugEnabled()) {
        logger.debug("creating record between " + this.connector + " and " + connector + bridge);
    }
    record.setBridge(bridge);
    records.put(targetNodeID, record);
    if (start) {
        bridge.start();
    }
    if (!ConfigurationImpl.checkoutDupCacheSize(serverLocator.getConfirmationWindowSize(), server.getConfiguration().getIDCacheSize())) {
        ActiveMQServerLogger.LOGGER.duplicateCacheSizeWarning(server.getConfiguration().getIDCacheSize(), serverLocator.getConfirmationWindowSize());
    }
}
Also used : IncomingInterceptorLookingForExceptionMessage(org.apache.activemq.artemis.core.server.cluster.ClusterManager.IncomingInterceptorLookingForExceptionMessage) ServerLocatorImpl(org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) ServerLocatorInternal(org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal)

Aggregations

SimpleString (org.apache.activemq.artemis.api.core.SimpleString)1 ServerLocatorImpl (org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl)1 ServerLocatorInternal (org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal)1 IncomingInterceptorLookingForExceptionMessage (org.apache.activemq.artemis.core.server.cluster.ClusterManager.IncomingInterceptorLookingForExceptionMessage)1