Skip to content

Commit

Permalink
Updated duration fields in properties and fixed README
Browse files Browse the repository at this point in the history
  • Loading branch information
strawhat5 committed Sep 11, 2020
1 parent 2f599d7 commit 5f8d93f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "{ workflows { nodes { key } } }" }' \
http://localhost:9000/graphiql
http://localhost:9000/graphql
```

While development, the graph can be explored using the integrated GraphiQL:
Expand Down Expand Up @@ -459,9 +459,15 @@ By default, the port is set to `9000` and the database is only in-memory (i.e. n

```
zeebe:
hazelcast:
connection: localhost:5701
connectionTimeout: PT30S
client:
worker:
hazelcast:
connection: "localhost:5701"
connectionTimeout: "PT1M"
ringbuffer: "zeebe"
connectionInitialBackoff: "PT15S"
connectionBackoffMultiplier: 2.0
connectionMaxBackoff: "PT30S"
spring:
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ zeebe:
connection: "localhost:5701"
connectionTimeout: "PT1M"
ringbuffer: "zeebe"
connectionInitialBackoff: 15000
connectionInitialBackoff: "PT15S"
connectionBackoffMultiplier: 2.0
connectionMaxBackoff: 60000
connectionMaxBackoff: "PT30S"
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class HazelcastImporter(
val hazelcastConnection = hazelcastProperties.connection
val hazelcastConnectionTimeout = Duration.parse(hazelcastProperties.connectionTimeout)
val hazelcastRingbuffer = hazelcastProperties.ringbuffer
val hazelcastConnectionInitialBackoff = Duration.parse(hazelcastProperties.connectionInitialBackoff)
val hazelcastConnectionBackoffMultiplier = hazelcastProperties.connectionBackoffMultiplier
val hazelcastConnectionMaxBackoff = Duration.parse(hazelcastProperties.connectionMaxBackoff)

val hazelcastConfig = hazelcastConfigRepository.findById(hazelcastConnection)
.orElse(HazelcastConfig(
Expand All @@ -51,9 +54,9 @@ class HazelcastImporter(
val connectionRetryConfig = clientConfig.connectionStrategyConfig.connectionRetryConfig
connectionRetryConfig.clusterConnectTimeoutMillis = hazelcastConnectionTimeout.toMillis()
// These retry configs can be user-configured in application.yml
connectionRetryConfig.initialBackoffMillis = hazelcastProperties.connectionInitialBackoff
connectionRetryConfig.multiplier = hazelcastProperties.connectionBackoffMultiplier
connectionRetryConfig.maxBackoffMillis = hazelcastProperties.connectionMaxBackoff
connectionRetryConfig.initialBackoffMillis = hazelcastConnectionInitialBackoff.toMillis().toInt()
connectionRetryConfig.multiplier = hazelcastConnectionBackoffMultiplier
connectionRetryConfig.maxBackoffMillis = hazelcastConnectionMaxBackoff.toMillis().toInt()

val hazelcast = HazelcastClient.newHazelcastClient(clientConfig)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import org.springframework.boot.context.properties.ConstructorBinding
@ConfigurationProperties("zeebe.client.worker.hazelcast")
data class HazelcastProperties(
val connection: String = "localhost:5701",
val connectionTimeout: String = "PT30S",
val connectionTimeout: String = "PT1M",
val ringbuffer: String = "zeebe",
val connectionInitialBackoff: Int = 15 * 1000,
val connectionInitialBackoff: String = "PT15S",
val connectionBackoffMultiplier: Double = 2.0,
val connectionMaxBackoff: Int = 60 * 1000
val connectionMaxBackoff: String = "PT30S"
)

0 comments on commit 5f8d93f

Please sign in to comment.