diff --git a/packages/Ecotone/src/Messaging/Config/MessagingSystemConfiguration.php b/packages/Ecotone/src/Messaging/Config/MessagingSystemConfiguration.php index abc3bf1d2..21e13d801 100644 --- a/packages/Ecotone/src/Messaging/Config/MessagingSystemConfiguration.php +++ b/packages/Ecotone/src/Messaging/Config/MessagingSystemConfiguration.php @@ -237,6 +237,9 @@ private function initialize(ModuleRetrievingService $moduleConfigurationRetrievi private function prepareAndOptimizeConfiguration(InterfaceToCallRegistry $interfaceToCallRegistry, ServiceConfiguration $applicationConfiguration): void { $this->verifyEndpointAndChannelNameUniqueness(); + $this->beforeSendInterceptors = $this->orderMethodInterceptors($this->beforeSendInterceptors); + $this->beforeCallMethodInterceptors = $this->orderMethodInterceptors($this->beforeCallMethodInterceptors); + $this->afterCallMethodInterceptors = $this->orderMethodInterceptors($this->afterCallMethodInterceptors); foreach ($this->channelAdapters as $channelAdapter) { $channelAdapter->withEndpointAnnotations(array_merge($channelAdapter->getEndpointAnnotations(), [new AttributeDefinition(AsynchronousRunningEndpoint::class, [$channelAdapter->getEndpointId()])])); @@ -715,7 +718,6 @@ public function registerBeforeSendInterceptor(MethodInterceptor $methodIntercept } $this->beforeSendInterceptors[] = $methodInterceptor; - $this->beforeSendInterceptors = $this->orderMethodInterceptors($this->beforeSendInterceptors); return $this; } @@ -781,7 +783,6 @@ public function registerBeforeMethodInterceptor(MethodInterceptor $methodInterce } $this->beforeCallMethodInterceptors[] = $methodInterceptor; - $this->beforeCallMethodInterceptors = $this->orderMethodInterceptors($this->beforeCallMethodInterceptors); return $this; } @@ -802,7 +803,6 @@ public function registerAfterMethodInterceptor(MethodInterceptor $methodIntercep } $this->afterCallMethodInterceptors[] = $methodInterceptor; - $this->afterCallMethodInterceptors = $this->orderMethodInterceptors($this->afterCallMethodInterceptors); return $this; }