eventuate-tram / eventuate-tram-sagas

Sagas for microservices
Other
1k stars 228 forks source link

Consider defining a bean of type 'io.eventuate.common.id.IdGenerator' in your configuration #57

Open prakash135sahu opened 3 years ago

prakash135sahu commented 3 years ago

Hello, Getting below issues while setting up SAGA , plain setup even without any code:

Issues no1: Parameter 1 of method sagaInstanceRepository in io.eventuate.tram.sagas.spring.orchestration.SagaOrchestratorConfiguration required a bean of type 'io.eventuate.common.id.IdGenerator' that could not be found.

The injection point has the following annotations:

Dependency used for Issue 1:

 <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
 </dependency>

<dependency>
    <groupId>io.eventuate.tram.sagas</groupId>
    <artifactId>eventuate-tram-sagas-spring-orchestration</artifactId>
    <version>${eventuateTramSagasVersion}</version>
</dependency>

<dependency>
    <groupId>io.eventuate.tram.sagas</groupId>
    <artifactId>eventuate-tram-sagas-spring-orchestration-simple-dsl</artifactId>
    <version>${eventuateTramSagasVersion}</version>
</dependency>

<dependency>
    <groupId>io.eventuate.tram.core</groupId>
    <artifactId>eventuate-tram-spring-optimistic-locking</artifactId>
    <version>${eventuateTramVersion}</version>
</dependency>

<dependency>
    <groupId>io.eventuate.tram.core</groupId>
    <artifactId>eventuate-tram-spring-commands</artifactId>
    <version>${eventuateTramVersion} </version>
</dependency>
<dependency>
    <groupId>io.eventuate.tram.core</groupId>
    <artifactId>eventuate-tram-spring-producer-jdbc</artifactId>
    <version>${eventuateTramVersion} </version>
</dependency>

<dependency>
    <groupId>io.eventuate.tram.core</groupId>
    <artifactId>eventuate-tram-spring-consumer-kafka</artifactId>
    <version>${eventuateTramVersion} </version>
</dependency>

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.4-1200-jdbc41</version>
    <exclusions>
    <exclusion>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
    </exclusion>
</exclusions>
</dependency>

Issues No2: below error comes while including

io.eventuate.tram.core eventuate-tram-spring-consumer-jdbc ${eventuateTramVersion}

Parameter 2 of method duplicateMessageDetector in io.eventuate.tram.spring.consumer.jdbc.TramConsumerJdbcAutoConfiguration required a bean of type 'io.eventuate.common.jdbc.EventuateJdbcStatementExecutor' that could not be found.

prakash135sahu commented 3 years ago

eventuateTramVersion =0.25.1.RELEASE eventuateTramSagasVersion=0.14.0.RELEASE

dartartem commented 3 years ago

Hello @prakash135sahu, unfortunately I was not able to reproduce the first issue.

Could you please create a repository with example configuration that produces errors? Then I will be able to investigate it more.

Second issue is reproducible. Problem is that EventuateCommonJdbcOperationsConfiguration is missed from TramConsumerJdbcAutoConfiguration. I will submit a fix. For now, please import the configuration explicitly. For example:

import io.eventuate.common.spring.jdbc.EventuateCommonJdbcOperationsConfiguration;

@SpringBootApplication
@Import(EventuateCommonJdbcOperationsConfiguration.class)
public class Main {
  public static void main(String[] args) {
    SpringApplication.run(Main.class, args);
  }
}