Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;

/**
* Auto-configuration for Saga persistence capabilities.
Expand Down Expand Up @@ -64,7 +63,6 @@ public class SagaPersistenceAutoConfiguration {
*/
@Bean
@ConditionalOnMissingBean
@Primary
public ObjectMapper sagaObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.findAndRegisterModules(); // This will register JSR310 module for Java 8 time types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ public SagaEngine sagaEngine(SagaRegistry registry,
);
}

@Bean
@ConditionalOnMissingBean
public TccEvents tccEvents(LoggingTransactionalObserver loggingObserver) {
return new TccToGenericObserverAdapter(loggingObserver);
}

@Bean
@ConditionalOnMissingBean
public TccEventPublisher tccEventPublisher() {
Expand Down Expand Up @@ -263,12 +257,21 @@ public SagaEvents sagaEventsComposite(ApplicationContext applicationContext,

@Bean
@Primary
@ConditionalOnMissingBean(TccEvents.class)
public TccEvents tccEventsComposite(LoggingTransactionalObserver logger,
public TccEvents tccEventsComposite(ApplicationContext applicationContext,
LoggingTransactionalObserver logger,
ObjectProvider<MicrometerTransactionalObserver> micrometer,
ObjectProvider<GenericTransactionalObserver> tracing) {
List<TccEvents> sinks = new ArrayList<>();

// Add all other TccEvents beans first (including test beans)
// Exclude the composite itself to avoid circular dependency
Map<String, TccEvents> allEvents = applicationContext.getBeansOfType(TccEvents.class);
for (Map.Entry<String, TccEvents> entry : allEvents.entrySet()) {
if (!"tccEventsComposite".equals(entry.getKey())) {
sinks.add(entry.getValue());
}
}

// Add logging adapter
sinks.add(new TccToGenericObserverAdapter(logger));

Expand Down Expand Up @@ -333,6 +336,7 @@ public TccCompositor tccCompositor(TccEngine tccEngine, TccRegistry tccRegistry,
}

@Bean
@ConditionalOnMissingBean
public WebClient.Builder webClientBuilder() {
return WebClient.builder();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

Expand Down Expand Up @@ -67,7 +66,6 @@ public FailingTcc failingTcc() {
}

@Bean
@Primary
public TccEvents testEvents() {
return new TestEvents();
}
Expand Down