Results 1 to 3 of 3

Thread: OutputChannel for mail:outbound-adapter

  1. #1
    Join Date
    Jun 2011
    Location
    Austin, TX
    Posts
    13

    Default OutputChannel for mail:outbound-adapter

    I know outbound-channel-adapters are fire and forget...I have scenario after email has been sent out need to update the status

    is there any way to have an output-channel once mail:outbound-channel-adapter fired.

    here is my config

    <int-mail:outbound-channel-adapter channel="emailChannel" mail-sender="mailSender" />
    <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailS enderImpl">
    <property name="session" ref="mailSession" />
    </bean>


    Thanks
    Mahender

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    Please use [ code ] ... [ /code ] tags (no spaces inside brackets) around the snippet when posting code or configuration.

    Make 'emailChannel' a publish-subscribe channel and subscribe another endpoint (e.g. <service-activator/>) to it.

    The subscribers will be invoked in the order they appear in the configuration file, but I prefer to always add an 'order' attribute to make it clear (e.g. ob adapter order="1", service-activator order="2" will ensure the adapter is always called before the sa, regardless of where their configuration resides).

    If the mail send fails, the second endpoint won't be invoked and the exception will be thrown back to the caller, or sent to the errorChannel if so configured.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Jun 2011
    Location
    Austin, TX
    Posts
    13

    Default

    Thanks for explanation.
    This helped me a lot, it fits for my requirement.

    -Mahender

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •