Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2025. AxonIQ B.V.
* Copyright (c) 2022-2026. AxonIQ B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -73,24 +73,24 @@ class AxoniqPlatformEventStorageEngine(
return appendEvents(condition, context, events.toList())
}

override fun source(condition: SourcingCondition, context: ProcessingContext?): MessageStream<EventMessage?> {
return delegate.source(condition, context)
override fun source(condition: SourcingCondition): MessageStream<EventMessage?> {
return delegate.source(condition)
}

override fun stream(condition: StreamingCondition, context: ProcessingContext?): MessageStream<EventMessage?> {
return delegate.stream(condition, context)
override fun stream(condition: StreamingCondition): MessageStream<EventMessage?> {
return delegate.stream(condition)
}

override fun firstToken(context: ProcessingContext?): CompletableFuture<TrackingToken?> {
return delegate.firstToken(context)
override fun firstToken(): CompletableFuture<TrackingToken?> {
return delegate.firstToken()
}

override fun latestToken(context: ProcessingContext?): CompletableFuture<TrackingToken?> {
return delegate.latestToken(context)
override fun latestToken(): CompletableFuture<TrackingToken?> {
return delegate.latestToken()
}

override fun tokenAt(at: Instant, context: ProcessingContext?): CompletableFuture<TrackingToken?> {
return delegate.tokenAt(at, context)
override fun tokenAt(at: Instant, ): CompletableFuture<TrackingToken?> {
return delegate.tokenAt(at)
}

override fun describeTo(descriptor: ComponentDescriptor) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2025. AxonIQ B.V.
* Copyright (c) 2022-2026. AxonIQ B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,7 @@ import io.axoniq.platform.framework.messaging.HandlerMeasurement.Companion.RESOU
import io.axoniq.platform.framework.messaging.HandlerMetricsRegistry
import io.axoniq.platform.framework.messaging.toInformation
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.common.infra.ComponentDescriptor
import org.axonframework.messaging.core.Message
import org.axonframework.messaging.core.MessageStream
import org.axonframework.messaging.core.QualifiedName
Expand Down Expand Up @@ -93,8 +94,8 @@ class AxoniqPlatformEventHandlingComponent(
return delegate.sequenceIdentifierFor(event, context)
}

override fun subscribe(name: QualifiedName, eventHandler: EventHandler): EventHandlerRegistry? {
delegate.subscribe(name, eventHandler)
return this
override fun describeTo(descriptor: ComponentDescriptor) {
descriptor.describeProperty("processorName", processorName)
descriptor.describeWrapperOf(delegate)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2025. AxonIQ B.V.
* Copyright (c) 2022-2026. AxonIQ B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,13 +17,15 @@
package io.axoniq.platform.framework.messaging

import io.axoniq.platform.framework.messaging.enhancing.AxoniqPlatformCommandHandlingMember
import io.axoniq.platform.framework.messaging.enhancing.AxoniqPlatformEventHandlingMember
import io.axoniq.platform.framework.messaging.enhancing.AxoniqPlatformMessageHandlingMember
import io.axoniq.platform.framework.messaging.enhancing.AxoniqPlatformQueryHandlingMember
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.common.Priority
import org.axonframework.messaging.commandhandling.annotation.CommandHandlingMember
import org.axonframework.messaging.core.annotation.HandlerEnhancerDefinition
import org.axonframework.messaging.core.annotation.MessageHandlingMember
import org.axonframework.messaging.eventhandling.annotation.EventHandlingMember
import org.axonframework.messaging.queryhandling.annotation.QueryHandlingMember

@Priority((Int.MIN_VALUE * 0.95).toInt())
Expand All @@ -44,6 +46,8 @@ class AxoniqConsoleHandlerEnhancerDefinition : HandlerEnhancerDefinition {
return axoniqMember as MessageHandlingMember<T>
} else if (original is CommandHandlingMember<*>) {
return AxoniqPlatformCommandHandlingMember(original as CommandHandlingMember<T>, declaringClassName)
} else if (original is EventHandlingMember<*>) {
return AxoniqPlatformEventHandlingMember(original as EventHandlingMember<T>, declaringClassName)
}
return AxoniqPlatformMessageHandlingMember(original, declaringClassName)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2022-2026. AxonIQ B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.axoniq.platform.framework.messaging.enhancing

import io.axoniq.platform.framework.api.metrics.PreconfiguredMetric
import io.axoniq.platform.framework.messaging.HandlerMeasurement
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.messaging.core.Message
import org.axonframework.messaging.core.MessageStream
import org.axonframework.messaging.core.annotation.MessageHandlingMember
import org.axonframework.messaging.core.unitofwork.ProcessingContext
import org.axonframework.messaging.eventhandling.annotation.EventHandlingMember
import java.util.Optional

open class AxoniqPlatformEventHandlingMember<T>(open val delegate: EventHandlingMember<T>, val declaringClassName: String) : EventHandlingMember<T> {
private val logger = KotlinLogging.logger { }

override fun payloadType(): Class<*>? {
return delegate.payloadType()
}

override fun canHandle(message: Message, context: ProcessingContext): Boolean {
return delegate.canHandle(message, context)
}

override fun canHandleMessageType(messageType: Class<out Message?>): Boolean {
return delegate.canHandleMessageType(messageType)
}

@Suppress("DEPRECATION")
override fun handleSync(message: Message, context: ProcessingContext, target: T): Any? {
return delegate.handleSync(message, context, target)
}

override fun handle(message: Message, context: ProcessingContext, target: T): MessageStream<*>? {
HandlerMeasurement.onContext(context) {
logger.debug { "Received message [${message.type()}] for class [$declaringClassName]" }
it.reportHandlingClass(declaringClassName)
}
val start = System.nanoTime()
val stream = delegate.handle(message, context, target)
HandlerMeasurement.onContext(context) {
val end = System.nanoTime()
logger.debug { "Registering handling time for message [${message.type()}] in class [$declaringClassName]: ${end - start} ns" }
it.registerMetricValue(
metric = PreconfiguredMetric.MESSAGE_HANDLER_TIME,
timeInNs = end - start
)
}
return stream
}

override fun <HT : Any?> unwrap(handlerType: Class<HT>): Optional<HT> {
if(handlerType.isInstance(this)) {
return Optional.of(this) as Optional<HT>
}
return delegate.unwrap(handlerType)
}

override fun eventName(): String? {
return delegate.eventName()
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022-2025. AxonIQ B.V.
# Copyright (c) 2022-2026. AxonIQ B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,5 +13,3 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

io.axoniq.console.framework.starter.AxoniqPlatformLazyConfigurationEnhancer
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022-2025. AxonIQ B.V.
~ Copyright (c) 2022-2026. AxonIQ B.V.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -60,7 +60,7 @@
<kotlin.version>2.2.20</kotlin.version>
<dokka.version>2.0.0</dokka.version>

<axon.version>5.0.0</axon.version>
<axon.version>5.0.2</axon.version>
<spring-boot.version>3.5.7</spring-boot.version>


Expand Down
Loading