Coder Social home page Coder Social logo

Comments (1)

smcvb avatar smcvb commented on June 3, 2024

The key is in the RemoteHandlingException you receive. This signals you are using either the JGroups or Spring Cloud Extension to distribute your application.

Whenever you are in a distributed environment, you need to assume the scenario that not all instances are equal.

Differently put, some applications may have command handlers, others may not (in short, a heterogeneous system).

Due to this, there is a window of opportunity that the exception thrown one application X does not exist on application Y.
As such, Axon Framework defaults to protect everybody by assuming the exception is unknown, by wrapping it for you.

If you want some level of control over what the exception result is, your best step forward is to throw a dedicated CommandExecutionException, wherein you set the details field.
This field is intended to carry your "exceptional API," enabling you to have conscious exceptional communication between your nodes, instead of assuming the exceptional classes are present on All instances that will ever dispatch commands to said application.

Thus, your best bet is to catch the exception and transform it into a CommandExecutionException with (if necessary) your own details in it.
Granted, Axon Framework could be able to capture the exceptions originating from itself to generate these details.

By the way, you can also check our reference guide on the subject, over here.

I will close this issue as resolved, as I think the predicament is sufficiently addressed.
If you feel differently, be sure to reach out! We're always open for reconsidering.

Lastly, I strongly recommend you upgrade to a more recent version of Axon Framework.
We are already at 4.9.0, with 4.9.1 coming out soon.

from axonframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.