Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpringCloudCommandRouter requires local @CommandHandler to function properly #1

Closed
travikk opened this issue Nov 27, 2018 · 3 comments

Comments

@travikk
Copy link

travikk commented Nov 27, 2018

Hey there!

I noticed that if a service wants to use DistributedCommandBus with SpringCloudCommandRouter it's not really possible to do so. SpringCloudCommandRouter will throw a
new IllegalStateException("There should be no scenario where the local member does not exist."
when there haven't been any local member (which would happen when subscribing for a local @CommandHandler?).

It is a perfectly valid scenario that a service would like to dispatch a method to another one, whilst it itself doesn't have any command handlers.

There's no obvious workaround currently, as things are declared as private, so can't really override stuff without copy-pasting the whole class.

Thanks for your help!

@abuijze
Copy link
Member

abuijze commented Nov 28, 2018

Hi @travikk,

you did hit a little issue there, it seems. The problem is that a local instance is only configured once the loadFactor and/or CommandMessageFilter for the local node is registered. The default command message filter is a DenyAll, which basically means it doesn't accept any commands. Since that's the default, no changes are made.

While we'll fix this, as a workaround, you could configure an explicit loadFactor on the DistributedCommandBus to trigger this registration. The loadFactor may be 0.

@abuijze abuijze self-assigned this Nov 28, 2018
@abuijze abuijze transferred this issue from AxonFramework/AxonFramework Nov 28, 2018
@travikk
Copy link
Author

travikk commented Nov 28, 2018

Thanks for replying!

Thanks for the suggestion on the workaround. Will try it, as currently I had setup a simple handler for a dummy command.

@abuijze abuijze added this to the Release 4.0.1 milestone Nov 28, 2018
abuijze added a commit that referenced this issue Nov 28, 2018
Instead of throwing an exception when no locally registered node is
found, it should just ignore this and copy members from the Service
Registry. If a "pre-registration" local member is found, it should
be removed, as it will be replaced by a copy from the Service Registry

Resolves issue #1
@smcvb
Copy link
Member

smcvb commented Mar 13, 2019

Closing as this issue has been resolved in commit eefbbac.

@smcvb smcvb closed this as completed Mar 13, 2019
@smcvb smcvb modified the milestones: Extension-SpringCloud 4.0.1, Release 4.1 Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants