Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/main/java/apoc/broker/BrokerExceptionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import apoc.broker.exception.BrokerResendDisabledException;
import apoc.broker.exception.BrokerRuntimeException;
import apoc.broker.exception.BrokerSendException;

import java.net.ConnectException;

import org.neo4j.logging.Log;

/**
Expand Down Expand Up @@ -189,14 +192,19 @@ public static BrokerConnectionRecoveryException brokerConnectionRecoveryExceptio
public static BrokerConnectionInitializationException brokerConnectionInitializationException( String msg, Throwable e )
{
BrokerConnectionInitializationException brokerException;
if ( e != null )
if ( e == null )
{
brokerException = new BrokerConnectionInitializationException( msg, e );
log.error( brokerException.getMessage(), e );
brokerException = new BrokerConnectionInitializationException( msg );
log.error( brokerException.getMessage() );
}
else if ( e instanceof ConnectException )
{
brokerException = new BrokerConnectionInitializationException( msg + " " + e );
log.warn( brokerException.getMessage() );
}
else
{
brokerException = new BrokerConnectionInitializationException( msg );
brokerException = new BrokerConnectionInitializationException( msg, e );
log.error( brokerException.getMessage() );
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/apoc/broker/KafkaConnectionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public KafkaConnection( Log log, String connectionName, Map<String,Object> confi
if ( verboseErrorLogging )
{
BrokerExceptionHandler.brokerConnectionInitializationException( "Failed to initialize Kafka connection '" + connectionName + "'.", e );
log.warn( "APOC Broker: Initializing Kafka connection '" + connectionName + "' will be retried." );
}
connected.set( false );
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/apoc/broker/RabbitMqConnectionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public RabbitMqConnection( Log log, String connectionName, Map<String,Object> co
if ( verboseErrorLogging )
{
BrokerExceptionHandler.brokerConnectionInitializationException( "Failed to initialize RabbitMQ connection '" + connectionName + "'.", e );
log.warn( "APOC Broker: Initializing RabbitMQ connection '" + connectionName + "' will be retried." );
}
connected.set( false );
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/apoc/broker/SqsConnectionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public SqsConnection( Log log, String connectionName, Map<String,Object> configu
if ( verboseErrorLogging )
{
BrokerExceptionHandler.brokerConnectionInitializationException( "Failed to initialize SQS connection '" + connectionName + "'.", e );
log.warn( "APOC Broker: Initializing SQS connection '" + connectionName + "' will be retried." );
}
connected.set( false );
}
Expand Down