Skip to content

Commit da44d9e

Browse files
Merge pull request #109 from AxonIQ/feature/axon-framework-4-better-reconnects
Ensure reconnects to Platform due to deployments are less noisy
2 parents 4758e2e + 0c596c7 commit da44d9e

File tree

7 files changed

+43
-46
lines changed

7 files changed

+43
-46
lines changed

.github/workflows/add-to-console-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Add PR to AxonIQ Console project
1+
name: Add PR to Axoniq Platform project
22

33
on:
44
pull_request:
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/add-to-project@main
1414
with:
15-
project-url: https://github.com/orgs/AxonIQ/projects/9
15+
project-url: https://github.com/orgs/AxonIQ/projects/24
1616
github-token: ${{ secrets.ADD_TO_CONSOLE_PROJECT_TOKEN }}
1717
labeled: 'Type: Dependency Upgrade'
1818
label-operator: AND

.github/workflows/main.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
push:
55
branches:
66
- main
7+
- axon-4
78

89
jobs:
910
build:
1011
name: Test and Build on JDK ${{ matrix.java-version }}
1112
runs-on: ubuntu-latest
12-
continue-on-error: true # do not fail the whole job if one of the steps fails
1313

1414
strategy:
1515
matrix:
@@ -23,11 +23,6 @@ jobs:
2323
- java-version: 17
2424
sonar-enabled: true
2525
deploy-enabled: false
26-
# Disabled due to https://youtrack.jetbrains.com/issue/KT-62389/JDK-21-Cannot-access-class-TimeUnit.-Check-your-module-classpath-for-missing-or-conflicting-dependencies
27-
# Still runs perfectly fine on 21, just doesn't compile
28-
# - java-version: 21
29-
# sonar-enabled: false
30-
# deploy-enabled: false
3126

3227
steps:
3328
- name: Checkout Code
@@ -42,8 +37,14 @@ jobs:
4237
server-id: central
4338
server-username: MAVEN_USERNAME
4439
server-password: MAVEN_PASSWORD
45-
gpg-private-key: ${{ secrets.SONATYPE_GPG_KEY }} # Value of the GPG private key to import
46-
gpg-passphrase: ${{ secrets.SONATYPE_GPG_PASSWORD }}
40+
41+
- name: Import GPG key
42+
if: matrix.deploy-enabled
43+
run: |
44+
echo "${{ secrets.SONATYPE_GPG_KEY }}" | base64 --decode | gpg --batch --import
45+
gpg --list-secret-keys --keyid-format LONG
46+
env:
47+
GPG_TTY: $(tty)
4748

4849
- name: Test and Build
4950
if: ${{ !matrix.sonar-enabled }}
@@ -65,7 +66,7 @@ jobs:
6566
- name: Deploy to Sonatype
6667
if: matrix.deploy-enabled
6768
run: |
68-
./mvnw -B -U -Dstyle.color=always -Prelease deploy -DskipTests=true
69+
./mvnw -B -U -Dstyle.color=always -Prelease -Psign deploy -DskipTests=true
6970
env:
7071
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7172
MAVEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_ID }}

console-framework-client-api/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<modelVersion>4.0.0</modelVersion>
2727

2828
<artifactId>console-framework-client-api</artifactId>
29-
<name>AxonIQ Console Framework Client API</name>
30-
<description>API module for the AxonIQ Console Framework Client</description>
29+
<name>Axoniq Platform Framework Client API</name>
30+
<description>API module for the Axoniq Platform Framework Client</description>
3131

3232
<dependencies>
3333
<dependency>

console-framework-client-spring-boot-starter/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<modelVersion>4.0.0</modelVersion>
2727

2828
<artifactId>console-framework-client-spring-boot-starter</artifactId>
29-
<name>AxonIQ Console Framework Client Spring Boot Starter</name>
30-
<description>Spring Boot Starter to auto-connect Axon Framework applications with AxonIQ Console</description>
29+
<name>Axoniq Platform Framework Client Spring Boot Starter</name>
30+
<description>Spring Boot Starter to auto-connect Axon Framework applications with Axoniq Platform</description>
3131

3232
<dependencies>
3333
<dependency>

console-framework-client/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<modelVersion>4.0.0</modelVersion>
2727

2828
<artifactId>console-framework-client</artifactId>
29-
<name>AxonIQ Console Framework Client</name>
30-
<description>AxonIQ Console client for Axon Framework</description>
29+
<name>Axoniq Platform Framework Client</name>
30+
<description>Axoniq Platform client for Axon Framework</description>
3131

3232
<dependencies>
3333
<dependency>

console-framework-client/src/main/java/io/axoniq/console/framework/client/AxoniqConsoleRSocketClient.kt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022-2024. AxonIQ B.V.
2+
* Copyright (c) 2022-2025. AxonIQ B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,7 +37,6 @@ import reactor.core.publisher.Mono
3737
import reactor.netty.tcp.TcpClient
3838
import java.time.Instant
3939
import java.time.temporal.ChronoUnit
40-
import java.util.*
4140
import java.util.concurrent.ScheduledExecutorService
4241
import java.util.concurrent.ScheduledFuture
4342
import java.util.concurrent.TimeUnit
@@ -79,6 +78,7 @@ class AxoniqConsoleRSocketClient(
7978
private var lastConnectionTry = Instant.EPOCH
8079
private var connectionRetryCount = 0
8180
private var pausedReports = false
81+
private var supressConnectMessage = false
8282

8383
init {
8484
clientSettingsService.subscribeToSettings(heartbeatOrchestrator)
@@ -166,16 +166,20 @@ class AxoniqConsoleRSocketClient(
166166
rsocket = createRSocket()
167167
// Fetch the client settings from the server
168168
val settings = retrieveSettings().block()
169-
?: throw IllegalStateException("Could not receive the settings from AxonIQ console!")
169+
?: throw IllegalStateException("Could not receive the settings from Axoniq Platform!")
170170
clientSettingsService.updateSettings(settings)
171-
logger.info("Connection to AxonIQ Console set up successfully! This instance's name: $instanceName, settings: $settings")
171+
if (!supressConnectMessage) {
172+
logger.info("Connection to Axoniq Platform set up successfully! This instance's name: $instanceName, settings: $settings")
173+
supressConnectMessage = true
174+
}
172175
connectionRetryCount = 0
173176
} catch (e: Exception) {
174-
if (connectionRetryCount == 5) {
175-
logger.error("Failed to connect to AxonIQ Console. Error: ${e.message}. Will keep trying to connect...")
177+
if (connectionRetryCount == 10) {
178+
logger.error("Failed to connect to Axoniq Platform. Error: ${e.message}. Will keep trying to connect...")
179+
supressConnectMessage = false
176180
}
177181
disposeCurrentConnection()
178-
logger.debug("Failed to connect to AxonIQ Console", e)
182+
logger.debug("Failed to connect to Axoniq Platform", e)
179183
}
180184
}
181185

@@ -258,7 +262,7 @@ class AxoniqConsoleRSocketClient(
258262

259263
init {
260264
registrar.registerHandlerWithoutPayload(Routes.Management.HEARTBEAT) {
261-
logger.debug("Received heartbeat from AxonIQ Console. Last one was: {}", lastReceivedHeartbeat)
265+
logger.debug("Received heartbeat from Axoniq Platform. Last one was: {}", lastReceivedHeartbeat)
262266
lastReceivedHeartbeat = Instant.now()
263267
lastReceivedHeartbeat
264268
}
@@ -283,14 +287,13 @@ class AxoniqConsoleRSocketClient(
283287
}
284288

285289
override fun onDisconnected() {
286-
logger.info("This application has lost it's connection to AxonIQ Console. Reconnection will be automatically attempted.")
287290
this.heartbeatSendTask?.cancel(true)
288291
this.heartbeatCheckTask?.cancel(true)
289292
}
290293

291294
private fun checkHeartbeats(heartbeatTimeout: Long) {
292295
if (lastReceivedHeartbeat < Instant.now().minusMillis(heartbeatTimeout)) {
293-
logger.debug("Haven't received a heartbeat for {} seconds from AxonIQ Console. Reconnecting...", ChronoUnit.SECONDS.between(lastReceivedHeartbeat, Instant.now()))
296+
logger.debug("Haven't received a heartbeat for {} seconds from Axoniq Platform. Reconnecting...", ChronoUnit.SECONDS.between(lastReceivedHeartbeat, Instant.now()))
294297
disposeCurrentConnection()
295298
}
296299
}
@@ -299,7 +302,7 @@ class AxoniqConsoleRSocketClient(
299302
return rsocket
300303
?.requestResponse(encodingStrategy.encode("", createRoutingMetadata(Routes.Management.HEARTBEAT)))
301304
?.doOnSuccess {
302-
logger.debug("Heartbeat successfully sent to AxonIQ Console")
305+
logger.debug("Heartbeat successfully sent to Axoniq Platform")
303306
}
304307
?: Mono.empty()
305308
}
@@ -313,7 +316,7 @@ class AxoniqConsoleRSocketClient(
313316
}
314317
.doOnError {
315318
if (it.message?.contains("Access Denied") == true) {
316-
logger.error("Was unable to send call to AxonIQ Console since authentication was incorrect!")
319+
logger.error("Was unable to send call to Axoniq Platform since authentication was incorrect!")
317320
}
318321
}
319322
}

pom.xml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
</modules>
3232
<packaging>pom</packaging>
3333

34-
<name>AxonIQ Console - Framework Client</name>
35-
<description>Project containing the Framework Client for AxonIQ Console</description>
34+
<name>Axoniq Platform Framework client parent</name>
35+
<description>Axoniq Platform instrumentation and client for Axon Framework 5. https://platform.axoniq.io</description>
3636

3737
<inceptionYear>2023</inceptionYear>
3838
<url>https://axoniq.io/</url>
3939
<issueManagement>
4040
<system>GitHub</system>
41-
<url>https://github.com/AxonIQ/console-framework-client/issues</url>
41+
<url>https://github.com/AxonIQ/platform-framework-client/issues</url>
4242
</issueManagement>
4343
<licenses>
4444
<license>
@@ -219,22 +219,13 @@
219219
</build>
220220

221221
<scm>
222-
<connection>scm:git:git://github.com/AxonIQ/console-framework-client.git</connection>
223-
<developerConnection>scm:git:[email protected]:AxonIQ/console-framework-client.git</developerConnection>
224-
<url>https://github.com/AxonIQ/console-framework-client</url>
222+
<connection>scm:git:git://github.com/AxonIQ/platform-framework-client.git</connection>
223+
<developerConnection>scm:git:[email protected]:AxonIQ/platform-framework-client.git</developerConnection>
224+
<url>https://github.com/AxonIQ/platform-framework-client</url>
225225
<tag>HEAD</tag>
226226
</scm>
227227

228228
<developers>
229-
<developer>
230-
<name>Gerard Klijs</name>
231-
<email>[email protected]</email>
232-
<organization>AxonIQ</organization>
233-
<organizationUrl>https://axoniq.io</organizationUrl>
234-
<roles>
235-
<role>Developer</role>
236-
</roles>
237-
</developer>
238229
<developer>
239230
<name>Mitchell Herrijgers</name>
240231
<email>[email protected]</email>
@@ -374,8 +365,10 @@
374365
<goal>sign</goal>
375366
</goals>
376367
<configuration>
377-
<keyname>AA9DC051550F7897</keyname>
378-
<useAgent>true</useAgent>
368+
<gpgArguments>
369+
<arg>--pinentry-mode</arg>
370+
<arg>loopback</arg>
371+
</gpgArguments>
379372
</configuration>
380373
</execution>
381374
</executions>

0 commit comments

Comments
 (0)