soga | soga 后端,支持 | Server Side Rendering library
kandi X-RAY | soga Summary
kandi X-RAY | soga Summary
soga 后端使用 Go 语言全新实现 VMess、VLESS、Trojan、Shadowsocks、ShadowsocksR 等协议,不基于任何软件,专为面板对接打造,长期运行下内存占用低且非常稳定。.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of soga
soga Key Features
soga Examples and Code Snippets
Community Discussions
Trending Discussions on soga
QUESTION
I'm using mysql as the event store, so axon-server-connector is excluded from the classpath. My use case is described as following.
- Spring Boot 2.1.7.RELEASE and axon 4.3.2
- I planned to have three databases, for the purpose of axon event store, projection writing and projection reading respectively.
ANSWER
Answered 2020-May-19 at 07:28When using multiple databases, you probably won't be able to rely on autoconfiguration anymore, as Spring and Axon wouldn't know which one of the two databases you'd want to use.
Axon doesn't use an EntityManager directly. Instead, all components require an EntityManagerProvider. You may be able to use that to your advantage.
If you want all Axon components to use a certain database, simply define an EntityManagerProvider bean that returns the EntityManager that connects to that database. Spring manages the EntityManager completely, so you only need a single instance for all your EntityManager Sessions.
If you want different components to use different EntityManagers (e.g. Event Store in one database, Tokens and Sagas in another), then you will need to configure these components yourself. Sometimes, it's just easiest to copy the bean definitions from the AutoConfiguration classes and adapt them to suit your needs. See https://github.com/AxonFramework/AxonFramework/tree/master/spring-boot-autoconfigure/src/main/java/org/axonframework/springboot/autoconfig
Lastly, the entities that you need to scan depend on the components that you expect to use. Spring Boot autoconfiguration will scan the following Axon packages by default (if you don't specify any @EntityScan yourself):
- org.axonframework.eventhandling.tokenstore (for tokens)
- org.axonframework.modelling.saga.repository.jpa (for sagas)
- org.axonframework.eventsourcing.eventstore.jpa (for the event store)
Note that the @EnableJpaRepositories
annotation is used to scan for @Repository
classes. Axon doesn't use those, so there is no point scanning Axon packages for them. Axon does define entities, so @EntityScan
will make sense.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install soga
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page