can we use Oracle in the Axon spring boot? if yes
Please give me an example configuration
What do you want to use Oracle for? Just for projections or also the event store? With just spring data and the database driver included, pretty much all you need should be auto configured.
For event store
yes, I added dependency but in runtime get an error
eventStorageEngine in org.isc.axon.framworkcore.config.OracleConfig required a bean of type 'org.axonframework.common.jdbc.PersistenceExceptionResolver
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc11</artifactId>
<version>23.3.0.23.09</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
In this sample I did
@SpringBootApplication(exclude = {
DataSourceAutoConfiguration.class,
JdbcAutoConfiguration.class
})
and write
@ConditionalOnProperty(prefix = “isc.axon.oracle”,havingValue =“true” ,name = “enable”,matchIfMissing = false)
@AutoConfigureBefore({AxonAutoConfiguration.class, DataSourceAutoConfiguration.class, JdbcAutoConfiguration.class})
@EnableConfigurationProperties(PropertiesISC.class)
@Configuration
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE + 10)
public class OracleConfig {
Are you using spring boot? it should be created from:
@Bean
@ConditionalOnMissingBean({PersistenceExceptionResolver.class, EventStore.class})
public PersistenceExceptionResolver jdbcSQLErrorCodesResolver() {
return new JdbcSQLErrorCodesResolver();
}