Announcement Announcement Module
Collapse
No announcement yet.
message-driven-channel-adapter - startup dependency Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • message-driven-channel-adapter - startup dependency

    We have a use case that retrieves message off of JMS queue utilizing the message-driven-channel-adapter, transform and aggregates the messages and eventually delivery aggregated messages to third party via web service.

    The third party web service requires we authenticate and retrieve a token before we start delivery of data.

    Our thoughts were to have the application retrieve a token during start up. Our issue is that if this fails for some reason we do not want the message-driven-channel-adapter to start up and pull messages off the JMS queue.

    We have tried setting the depends-on value for the container associated with message-driven-channel-adapter. This seems to work partially except that is causing the entire application to not start on failure.

    Is it possible to only have a failure prevent the one message-driven-channel-adapter from starting up??

    Cheers.

  • #2
    Sure, you might consider setting the 'auto-startup' attribute on the message-driven-channel-adapter to FALSE. Then, in the bean that handles the authentication on startup, you could simply start the adapter manually IF successful. You could even send a Message to the Control Bus to start that if you prefer... however considering that authentication component is really "infrastructural" as-is, it's probably not a big concern if it has awareness of the adapter bean by name.

    Hope that helps.
    -Mark

    Comment


    • #3
      thanks. it looks like we had originally set the autostart to false on the listener container object references by the message-driven-channel-adapter. It looks like the message-driven-channel-adapter does not utilize/obey that param? would that make sense?

      Comment


      • #4
        I think you would need to set 'autoStart' on the message-driven-channel-adapter element itself, since that flag indicates whether it should start the underlying container.

        Comment

        Working...
        X