-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reconsider a default order
value for default LoggingHandler
subscribed into a default errorChannel
by the framework
#3555
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
Comments
Well, the behavior is correct: I've just misled you a little bit.
By default we use a With your Java DSL approach ( I would say your I would treat it as a behavior change anyway, therefore if we agree with a feature, it is going to be scheduled for the next Meanwhile as a workaround for XML use-case, it is just enough to specify an extra @garyrussell , WDYT? |
Yes, we should leave a little room; but I think it should be closer to LOWEST_PRECEDENCE, maybe L_P - 100. I think you mean he needs a logging handler at 99, not 101, to log first. You should also define your own pub/sub channel |
Thanks, Gary, for feedback and correction.
Yes, it is also better to use a custom error channel for each specific case and don't abuse a global one if you are intended to have some custom error handler in the end. This way everything is in your control. But yeah... according that SO thread, @nikhilvasaikar just doesn't want to do any custom error channel... |
order
value for default LoggingHandler
subscribed into a default errorChannel
by the framework
Thank You @artembilan and @garyrussell. The reason why I did not create a custom May be the default |
Thank you for confirmation, @nikhilvasaikar , that we are on the same page with a compromise we are trying to find over here. What you are saying about custom executor, handlers etc. is fully OK for custom error handlers. As I said: with a custom, some error-specific handler subscribed to a default |
Changing the order of the default handler, leaving space for custom handlers, will solve the problem (in 6.0), before then, you will need to add your own But @artembilan is correct; the default |
@garyrussell @artembilan I agree that we should keep |
Fixes spring-projects#3555 The default global `errorChannel` has a `LoggingHandler` as a subscriber. It is subscribed without any `order` which may lose logging messages, when another subscriber with re-throw is present. * Set default `LoggingHandler` on the default `errorChannel` to `Ordered.LOWEST_PRECEDENCE - 100` to give a room for custom subscribers without an `order` and still get error logged
* GH-3555: Change logger order for errorChannel Fixes #3555 The default global `errorChannel` has a `LoggingHandler` as a subscriber. It is subscribed without any `order` which may lose logging messages, when another subscriber with re-throw is present. * Set default `LoggingHandler` on the default `errorChannel` to `Ordered.LOWEST_PRECEDENCE - 100` to give a room for custom subscribers without an `order` and still get error logged * Add extra note in docs about an order for custom subcribers Co-authored-by: Gary Russell <[email protected]> Co-authored-by: Gary Russell <[email protected]>
In what version(s) of Spring Integration are you seeing this issue?
5.4.3
Describe the bug
There is no consistency between DSL and XML config for the order of subscribers on the global
errorChannel
. Theorder
attribute also does not cause any effect in the XML configuration.To Reproduce
errorChannel
errorChannel
When the above is implemented using
DSL
, the behavior is as expected below. However, when implemented inXML
, the exception throwingservice-activator
in invoked before theerror logging handler
, hence causing theerror logging handler
to be never invoked as both subscribers are invoked on the caller's thread. Settingorder="100"
on theservice-activator
XML declaration also has no effect.Expected behavior
errorChannel
should be invokedfirst
and must log the errorservice-activator
must be invoked after, not before theerror logging handler
Sample
A brief description and scenario under which this issue was encountered is available at this stackoverflow post.
The text was updated successfully, but these errors were encountered: