Skip to content
Ingo Pak edited this page May 7, 2014 · 1 revision

Responsibility

The Core is the heart of the system that keeps track of the state of the defined aggregates.

The state is kept in an Axon Event Store.

Configuring the event store

Sample configuration:

    <axon:jpa-event-store id="eventStore"
                          data-source="dataSource"/>

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName"
                  value="org.hsqldb.jdbcDriver"/>
        <property name="url"
                  value="jdbc:hsqldb:mem:eventstore"/>
        <property name="username"
                  value="sa"/>
        <property name="password"
                  value="<empty>"/>
    </bean>

    <bean id="entityManagerFactory"
          class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource"
                  ref="dataSource"/>
        <property name="packagesToScan"
                  value="org.axonframework.eventstore.jpa"/>
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="database"
                          value="HSQL"/>
                <property name="generateDdl"
                          value="true"/>
            </bean>
        </property>
    </bean>

    <bean id="commandTransactionManager"
          class="org.axonframework.unitofwork.SpringTransactionManager">
        <constructor-arg>
            <bean class="org.springframework.orm.jpa.JpaTransactionManager">
                <property name="entityManagerFactory"
                          ref="entityManagerFactory"/>
            </bean>
        </constructor-arg>
    </bean>

See the Axon documentation for more options and details on how to configure an event store.

API

The Core comes with an Axon based API, through which add-ons can communicate with the Core. See the [Core API](Core API) for more detailed information.