Skip to content

GH-2749: Deprecate ChannelInterceptorAware #2751

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

Merged
merged 3 commits into from
Feb 22, 2019

Conversation

artembilan
Copy link
Member

Fixes #2749

The org.springframework.messaging.support.InterceptableChannel provides
exact functionality as ChannelInterceptorAware

  • Make ChannelInterceptorAware extends InterceptableChannel
  • Suppress deprecation warning whenever we need to keep backward
    compatibility
  • Fix all other places to deal with InterceptableChannel already

@artembilan
Copy link
Member Author

That's just cool to have that updateCopyrights task. It saved me a lot of time! 😄

Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues; one major, one minor.

@@ -243,7 +244,7 @@ public void setMessageConverter(MessageConverter messageConverter) {
* Return a read-only list of the configured interceptors.
*/
@Override
public List<ChannelInterceptor> getChannelInterceptors() {
public List<ChannelInterceptor> getInterceptors() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't do this; breaking change. Need to deprecate the old method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it clashes with the InterceptableChannel API. So, we in chicken-or-egg situation anyway, independently of the version we are going to fix it. Good deal that this method is just protected, so visible only for implementors, but not regular end-user code

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved it to 5.1.4; let's talk when we have more time.

@@ -304,6 +304,7 @@ Also, starting with version 5.1, `ChannelInterceptor.postReceive()` is no longer
Previously, the method was called.
If you have an interceptor that relies on the previous behavior, implement `afterReceiveCompleted()` instead, since that method is invoked, regardless of whether a message is received or not.

NOTE: Starting with version 5.1.3, the `ChannelInterceptorAware` is deprecated in favor of `InterceptableChannel` from Spring Messaging module, which it extends now for backward compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the Spring Messaging module ... which it now extends

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/5.1.3/5.2/

from the Spring Messaging module

Fixes spring-projects#2749

The `org.springframework.messaging.support.InterceptableChannel` provides
exact functionality as `ChannelInterceptorAware`

* Make `ChannelInterceptorAware extends InterceptableChannel`
* Suppress deprecation warning whenever we need to keep backward
compatibility
* Fix all other places to deal with `InterceptableChannel` already
Fixes spring-projects#2749

The `org.springframework.messaging.support.InterceptableChannel` provides
exact functionality as `ChannelInterceptorAware`

* Make `ChannelInterceptorAware extends InterceptableChannel`
* Suppress deprecation warning whenever we need to keep backward
compatibility
* Fix all other places to deal with `InterceptableChannel` already
@artembilan
Copy link
Member Author

OK. I think its time to forget such a deprecation for 5.1.x and just apply the change for the current 5.2.

I'll add a Migration Guide note, when the PR is merged.

Thanks

Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit picks

@@ -304,6 +304,7 @@ Also, starting with version 5.1, `ChannelInterceptor.postReceive()` is no longer
Previously, the method was called.
If you have an interceptor that relies on the previous behavior, implement `afterReceiveCompleted()` instead, since that method is invoked, regardless of whether a message is received or not.

NOTE: Starting with version 5.1.3, the `ChannelInterceptorAware` is deprecated in favor of `InterceptableChannel` from Spring Messaging module, which it extends now for backward compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/5.1.3/5.2/

from the Spring Messaging module

@garyrussell garyrussell merged commit 82ecd5a into spring-projects:master Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retire ChannelInterceptorAware in favor of org.springframework.messaging.support.InterceptableChannel
2 participants