Announcement Announcement Module
Collapse
No announcement yet.
Creating a Channel's Downstream components on first request? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a Channel's Downstream components on first request?

    Is there something similar to lazy-init for channels? I basically have a channel that I don't want the channels' downstream components initialized until the first time it actually receives a message. Is this doable?

  • #2
    See the dynamic-ftp sample in the advanced samples... https://github.com/garyrussell/sprin...ration-samples

    It uses a dynamic channel resolver to instantiate a separate application context, and returns the channel which is the entry point to that flow.

    Sounds like that would meet your requirements. The sample supports multiple instances (different ftp destinations); sounds like you just need one. Once it has been instantiated the first time, just return the channel immediately.

    Comment


    • #3
      Cool... can I use a session factory like this without using the ftp outbound gateway?

      Comment


      • #4
        I don't really understand the question; if you have a session factory that's not used by an endpoint, what's its purpose?

        But I'm sure you have something else in mind.

        Comment


        • #5
          I focused too much on the implementation detail when looking at your example. I applied the same concept but using a custom router.

          Thanks!

          Comment

          Working...
          X