kinaesthesia
kinaesthesia

Reputation: 703

Spring integration exception stacktrace like Apache camel?

Is it possible to have something like Apache Camel stacktrace when an exception is thrown ?

enter image description here

Right now I have some issue for debugging my application because when an exception is throw, the only thing I have is the class name (so I can't debug the flow and I can't see his path)

Upvotes: 1

Views: 242

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121272

The feature you mention in the screen shot has the same name in Spring Integration - Message History.

When message travel we store there in the headers (MessageHistory.HEADER_NAME) the path. And that is available in logs as well.

After message has traveled you can get access to that object in the message via MessageHistory.read(message). This Object is a List<MessageHistory.Entry> extension, where each entry has this properties for access:

public static final String NAME_PROPERTY = "name";

public static final String TYPE_PROPERTY = "type";

public static final String TIMESTAMP_PROPERTY = "timestamp";

I agree that we might not have similar pretty-print for this MessageHistory object, but at least we have something for your consideration.

When exception is thrown in the Spring Integration it is an instance of MessagingException. Its failedMessage can be used to extract a mentioned history.

Feel free to open a JIRA ticket with the improvement request.

Upvotes: 1

Related Questions