Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make transaction retry timeout configurable. #163

Merged
merged 1 commit into from
May 3, 2023
Merged
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
17 changes: 17 additions & 0 deletions docs/modules/ROOT/pages/includes/quarkus-neo4j.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,23 @@ endif::add-copy-button-to-env-var[]
|`false`


a| [[quarkus-neo4j_quarkus.neo4j.max-transaction-retry-time]]`link:#quarkus-neo4j_quarkus.neo4j.max-transaction-retry-time[quarkus.neo4j.max-transaction-retry-time]`

[.description]
--
Configure the maximum time transactions are allowed to retry.

ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_NEO4J_MAX_TRANSACTION_RETRY_TIME+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_NEO4J_MAX_TRANSACTION_RETRY_TIME+++`
endif::add-copy-button-to-env-var[]
--|link:https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html[Duration]
link:#duration-note-anchor-{summaryTableId}[icon:question-circle[], title=More information about the Duration format]
|`30S`


a|icon:lock[title=Fixed at build time] [[quarkus-neo4j_quarkus.neo4j.devservices.additional-env-additional-env]]`link:#quarkus-neo4j_quarkus.neo4j.devservices.additional-env-additional-env[quarkus.neo4j.devservices.additional-env]`

[.description]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public class Neo4jConfiguration {
@ConfigDocSection
public TrustSettings trustSettings;

/**
* Configure the maximum time transactions are allowed to retry.
*/
@ConfigItem(defaultValue = "30S")
public Duration maxTransactionRetryTime;

/**
* Connection pool.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.net.URI;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.logging.Level;

Expand Down Expand Up @@ -43,6 +44,7 @@ public RuntimeValue<Driver> initializeDriver(Neo4jConfiguration configuration, S
Config.ConfigBuilder configBuilder = createBaseConfig();
configureSsl(configBuilder, configuration);
configurePoolSettings(configBuilder, configuration.pool);
configBuilder.withMaxTransactionRetryTime(configuration.maxTransactionRetryTime.toMillis(), TimeUnit.MILLISECONDS);

Driver driver = GraphDatabase.driver(uri, authToken, configBuilder.build());
shutdownContext.addShutdownTask(driver::close);
Expand Down