Axon 4 without AxonServer

2,366 views
Skip to first unread message

Danny Kruitbosch

unread,
Oct 19, 2018, 10:10:15 AM10/19/18
to Axon Framework Users
Hi,

I've been upgrading to Axon 4 today. A lot of packages seems to have moved around (new package names), but I think it's more logical and I managed to refactor most of my code.

We are using MongoDB as an event store and token store. All my unit tests work again, but when I start the application, all my sagas try to connect to Axon server for  looking up their tracking tokens.

I get these errors in my logs:
o.a.e.TrackingEventProcessor - Fetch Segments for Processor 'EnrollEmployeeToPPVDSagaProcessor' failed: No connection to AxonServer available.

So how do I exclude AxonServer (for now) and make MongoDB my event and token store again?

I use to have this in my config class:

@Bean
public SagaConfiguration enrollEmployeeFromPPVDSagaConfiguration() {
    return SagaConfiguration.trackingSagaManager(EnrollEmployeeFromPPVDSaga.class);
}


But this doesn't work anymore.


Thanks,

Danny

Allard Buijze

unread,
Oct 20, 2018, 5:46:09 AM10/20/18
to axonfr...@googlegroups.com
Hi Danny,

good to hear that you’ve adopted 4.0! It’s been out for more than a day, already ;-).
If you wish to use the embedded event store, you basically have two options:
- explicitly define the EmbeddedEventStore in your application context. This approach will allow you to use the event and query bus by Axon Server.
- exclude the axon-server-connector dependency in your pom/gradle file. This will give you the defaults you were used to in Axon 3.

Cheers,

Allard
Zusterplein 20, 3703 CB Zeist




Read our blog!


--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Allard Buijze
CTO

E: allard...@axoniq.io
T: +31 6 34 73 99 89

Danny Kruitbosch

unread,
Oct 22, 2018, 3:46:35 AM10/22/18
to Axon Framework Users
Hi Allard,

I just excluded the axon-server-connector and everything seems to work again like before. So thanks ;)

Kind regards,

Danny

Op zaterdag 20 oktober 2018 11:46:09 UTC+2 schreef Allard Buijze:

Ajinkya Virkar

unread,
Oct 22, 2018, 10:56:50 AM10/22/18
to Axon Framework Users
Where do you get Axon 4 documents and download. I could not find it http://www.axonframework.org/download/

Allard Buijze

unread,
Oct 23, 2018, 2:49:53 AM10/23/18
to axonfr...@googlegroups.com
Hi Ajinkya,

we're working on transitioning the website from axonframework.org to axoniq.io. You can download Axon (and Framework and Server) from https://axoniq.io/download.

Cheers,

Allard

Danny Kruitbosch

unread,
Oct 23, 2018, 9:10:22 AM10/23/18
to Axon Framework Users
Or just update your maven/gradle dependencies ;)

Op dinsdag 23 oktober 2018 08:49:53 UTC+2 schreef Allard Buijze:

mst...@thoughtworks.com

unread,
Dec 4, 2018, 7:48:28 AM12/4/18
to Axon Framework Users
Hi Allard

I have a simple Spring Boot application that I am trying to convert to Axon 4.0 to run without a separate Axon Server instance.

I can exclude the axon-server-connector dependency but I do not understand what you mean by explicitly define the EmbeddedEventStore in your application context. The only explicit configuration in my app is to serialize events using JSON. It (by default) stores events in an H2 database defined by spring.datasource

Any help you can give me is greatly appreciated.

Thanks
Michael

Michael Strasser

unread,
Dec 4, 2018, 4:13:55 PM12/4/18
to dstibbe, David Stibbe, axonfr...@googlegroups.com
Hi David

Thanks, that works fine with in-memory event storage. I can replicate that in my own app as well.

I need to figure out how to replicate the default JPA event storage in Axon 3. It is not clear to me from the Axon docs.

Regards
Michael

On Tue, 4 Dec 2018 at 22:51 dstibbe <dst...@protonmail.com> wrote:
I created a simple project without the server: https://github.com/dstibbe/cargo

Hopefully this can help you?


Met vriendelijke groet,
David Stibbe





-------- Oorspronkelijk bericht --------
Aan 4 dec. 2018 13:48, < mst...@thoughtworks.com > schreef:
--
Michael Strasser
Lead Technologist
Emailmst...@thoughtworks.com
Telephone
+61 4 1428 4256
PGP:
A13D 44D8 2E90 4858
ThoughtWorks

Danny Kruitbosch

unread,
Dec 5, 2018, 2:03:24 AM12/5/18
to Axon Framework Users
Hi Michael,

SInce we only use MongoDB as our eventstore, I can only give you this. All non-AxonDB event storage engines have a builder interface now.
Our config for mongo looks like this:
    @Bean
    public EventStorageEngine eventStore(MongoClient client) {
        return MongoEventStorageEngine.builder()
                .mongoTemplate(defaultAxonMongoTemplate())
                .build();
    }

So I guess, for the JPA evenstorage engine it would look like this:

    @Bean
    public EventStorageEngine jpaEventStore() {
        return JpaEventStorageEngine.builder()
                .build();
    }

Just check out which stuff you have to set on the builder interface to define your datasource, entitymanager etc (intellisense get's you a long way to see what's possible).

Hope this helps ;)

Danny

Op dinsdag 4 december 2018 22:13:55 UTC+1 schreef Michael Strasser:

mst...@thoughtworks.com

unread,
Dec 5, 2018, 4:37:44 AM12/5/18
to Axon Framework Users
Thanks everyone for your help.

It is now working with only changes to the POM and package arrangements. I don’t know why it didn’t work before.

The code is here, if you are interested: https://github.com/mjstrasser/licensing-demo
Reply all
Reply to author
Forward
0 new messages