In this video, see the instructor's solution for one way to refactor a SubscribableChannel implementation.
(upbeat music) … - [Instructor] Let's have a look now … at one way to solve this refactoring code challenge. … Starting in tech support.xml, … where our channel is first configured, … the first thing we need to do … is instead of using the channel element … from the Integration namespace, … we need to use the PublishSubscribeChannel element. … It's that simple. … Now in our code references, … we need to update the type that we're casting … this reference to. … So here in line 33, in the ViewService, … instead of casting our resulting bean to a direct channel, … we need to cast it to a PublishSubscribeChannel. … The reason that works so handily for us … is there in line 20, we have initialized … our TechSupportChannel property … to be an abstract subscribable channel, … which is the parent of both PublishSubscribeChannels … and direct channels. … So it's just a simple matter of changing our cast … there in line 33, and that does the trick. … We have a similar situation in Dashboard Manager. …
Skill Level Advanced
Using the exercise files2m 16s
1. Essential Project Components
2. Communicating Messages over Channels
3. Manage Messages with Endpoints
4. Connect External Systems with Endpoints
5. Advanced Spring Integration
Advanced Spring Integration2m 54s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.