ConsistentHash with SpringCloudCommandBus

34 views
Skip to first unread message

Aleksey Podogov

unread,
May 16, 2018, 6:25:12 AM5/16/18
to Axon Framework Users
Hi!

I have tried to use my AxonFramework application in distributed mode using SpringCloudCommandBus and Eureka Server, but that's not worked as expected. Commands to aggregates with same identifier are not routed to one node.
Debugging shows that all nodes have same version of ConsistentHash with command filter for all commands.
Hashes for each member generates using its name and segment index. For local member name always same on each node, so computed hashToMember map on each node different. Maybe that's the cause of incorrect routing?

Steven van Beelen

unread,
May 16, 2018, 7:08:50 AM5/16/18
to axonfr...@googlegroups.com
Hi Aleksey,

That's troublesome to hear and not the experience I'm having at a client right now.
Did you specify a `RoutingStrategy` in your application at all? This shouldn't be necessary in a Spring environment though, as Axon will provide a sensible default, but asking this for verification.
The RoutingStrategy, which defaults to the `AnnotationRoutingStrategy` based on the `@TargetAggregateIdentifier` field in your commands.

You point out that 'Debugging shows that all nodes have same version of ConsistentHash with command filter for all commands.'.
Does this mean that in for example a 2 node set up, both nodes have an identical ConsistentHash?
This on it's own isn't faulty, as both nodes should end up with the same ConsistentHash as soon as both applications are started up (and no dynamic removal/addition of command handlers is taking place).
If the ConsistentHash however only shows the local node and no others, then there definitely is something wrong.

Could you provide a more thorough description of what the ConsistentHashes contain?
Based on that I think we can figure out what's happening.

Cheers,
Steven

--
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.

Aleksey Podogov

unread,
May 16, 2018, 7:35:52 AM5/16/18
to Axon Framework Users
Hi, Steven!

I'm using autoconfigured routing strategy (AnnotationRoutingStrategy), all commands have TargetAggregateIdentifier annotated field.
I mean on all nodes ConsistentHash have knowledge about local member and other members. Sample toString description: ConsistentHash [MY-SERVICE[LOCAL](100),MY-SERVICE[http://10.252.30.53:8090](100),MY-SERVICE[http://10.252.30.53:8091](100)]
All instance of application started up. ConsistentHashChangeListener shows that there is no change of ConsistentHash version happends on heartbeat event.
CommandFilter for each member in ConsistentHash has every command for my aggregate.


среда, 16 мая 2018 г., 14:08:50 UTC+3 пользователь Steven van Beelen написал:

Steven van Beelen

unread,
May 17, 2018, 3:55:18 AM5/17/18
to axonfr...@googlegroups.com
Hi Aleksey,

I've been digging a little, but you're right.
The fact the local member defaults to `serviceId.toUpperCase() + [LOCAL]` will ensure an inconsistent routing solution when using the SpringCloudCommandRouter.
I'll look for a solution ASAP. Stay tuned!
You may assume a fix will be in for release 3.2.2 by the way.

Thanks for pointing this out Aleksey!

Cheers,
Steven

Aleksey Podogov

unread,
May 17, 2018, 4:18:46 AM5/17/18
to Axon Framework Users
Thank you, Steven!

четверг, 17 мая 2018 г., 10:55:18 UTC+3 пользователь Steven van Beelen написал:

Steven van Beelen

unread,
May 17, 2018, 4:58:14 AM5/17/18
to axonfr...@googlegroups.com
Hi Aleksey,

You can trick this issue if you want for the progress in resolving the incorrect behavior you've uncovered.

Cheers,
Steven

Aleksey Podogov

unread,
May 23, 2018, 7:03:19 AM5/23/18
to Axon Framework Users
Hi, Steven!

Thanks for fix in such a short time.


четверг, 17 мая 2018 г., 11:58:14 UTC+3 пользователь Steven van Beelen написал:

Steven van Beelen

unread,
May 23, 2018, 8:01:40 AM5/23/18
to axonfr...@googlegroups.com
Hi Aleksey,

Ah I take it you saw this release then, great!
And no worries, that issue did require an immediate fix.
If you encounter any other issues feel free to drop them here or on the GitHub page!

Cheers,
Steven
Reply all
Reply to author
Forward
0 new messages