Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9280047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:46:38+00:00 2026-06-18T17:46:38+00:00

Given a publish-subscribe channel configured with a task executor, is it possible to have

  • 0

Given a publish-subscribe channel configured with a task executor, is it possible to have the invocation of its ordered subscribers interrupted if one throws an exception?

For example, in this example the ‘worked’ message still gets sent by the second service-activator in the sequence. I would like this to not happen.

    <int:publish-subscribe-channel id="input" task-executor="taskExecutor" />

    <int:service-activator
        input-channel="input"
        order="1" 
        expression="1 / 0" 
        output-channel="nullChannel"
    />
    <int:service-activator
        input-channel="input"
        order="2" 
        expression="'worked'" 
        output-channel="output"
    />

    <int:channel id="output">
        <int:queue />
    </int:channel>

The real world use-case for this is somewhat more complex, in that a File is published to two subscribers, one for parsing the contents of it, and another for archiving to S3. A sequence is applied so they can be aggregated and deleted later once both tasks have finished.

The S3 upload is achieved with an outbound channel adapter that returns no reply. As such, there is a publish-subscribe channel that invokes the S3 adapter first (using the order attribute) and then sends the File to a bridge, which then places it on the channel that collects the aggregated messages.

If the S3 upload failed, I do not want the file to get deleted, so the second subscriber of the upstream channel must not be called.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:46:39+00:00Added an answer on June 18, 2026 at 5:46 pm

    The “order” attribute really doesn’t make any sense when you add a task executor because both tasks are executed asynchronously; interrupting the “second” thread might be too late. To answer your general question, no, a failure on one thread will not interrupt others.

    If I understand your use case correctly, you should be able to do what you want using the new 2.2 <request-handler-advice-chain/> feature, where you can add an ExpressionEvaluatingRequestHandlerAdvice to take different actions, based on success or failure. This is discussed in this blog… http://blog.springsource.org/2012/10/09/spring-integration-2-2-retry-and-more/ and, specifically the sample code it references (for the ftp adapter)…

    <int-ftp:outbound-channel-adapter
        channel="inputChannel"
        session-factory="mockSessionFactory"
        remote-directory="foo">
        <int-ftp:request-handler-advice-chain>
            <bean class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice">
                <property name="onSuccessExpression" value="payload.delete()" />
                <property name="successChannel" ref="afterSuccessDeleteChannel" />
                <property name="onFailureExpression" value="payload.renameTo(payload.absolutePath + '.failed.to.send')" />
                <property name="failureChannel" ref="afterFailRenameChannel" />
            </bean>
        </int-ftp:request-handler-advice-chain>
    </int-ftp:outbound-channel-adapter>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

with eZ Publish, when given an ezContentObjectTreeNode object, how can I find its previous/next
Is there any way of automating a site publish with a given set of
Given that the web application doesn't have su privileges, I'd like to execute a
I am currently developing a WCF Publish Subscribe service. My Service has the following
I'm still trying to get my head around the whole publish/subscribe aspect of Meteor.
Please go easy on me. I was just given the task to take a
I'm not even sure if this is possible... Given a form with <input id=fileinput
Given a Java web application using CometD, how can I publish a message to
I create websites for people. I have given them the ability to edit certain
I am using Guava to create an EventBus for a publish-subscribe messaging service. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.