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 8245091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:04:17+00:00 2026-06-07T22:04:17+00:00

This would seem like a pretty common thing to do, but I am having

  • 0

This would seem like a pretty common thing to do, but I am having trouble figuring out how to make it work. I wrote a custom filter for a request-response flow that has an inbound http endpoint. The custom filter checks if certain required query parameters are present and contain valid values. If the filter rejects a message, I would like to return an HTTP error status code, but I cannot figure out how to send a different response.

The Mule docs say:

If the inbound endpoint defined on a Flow has a request-response
exchange-pattern and there are no response blocks in your flow then
the response used is simply the result from the last Message Processor
in the flow, which will be null.

I am not sure if this is entirely accurate. My flow does have a <response> block, but it is not getting called if my custom filter returns false.

What is the best way to return a different response if the filter rejects a message?

Here is an example of my flow:

<flow name="Incoming_requests">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="incoming" />

    <http:body-to-parameter-map-transformer />

    <custom-filter class="com.mycompany.MyQueryParamFilter"/>

    <!--  Process valid messages here -->

    <response>
       <!--  Return a successful response  -->
    </response>
</flow>

EDIT: Here is are the docs that inferred that <response> blocks would be executed.
http://www.mulesoft.org/documentation/display/MULE3USER/Using+Filters#UsingFilters-UsinginFlows

  • 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-07T22:04:17+00:00Added an answer on June 7, 2026 at 10:04 pm

    Using a choice router would be better in your case:

    <choice>
      <when expression="...validation expression...">
        <!--  Process valid messages here -->
        <!--  Return a successful response  -->
      </when>
      <otherwise>
        <!--  Return a failure response  -->
      </otherwise>
    </choice>    
    

    No response elements are necessary if the choice is at the end of the flow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may seem like a basic question. I have a light-weight website and would
I have this design which I cannot seem to get right, I would like
This may seem to be an academic question, but still I would be very
I know this can seem a weird question but for me it would be
This may seem like a basic/stupid/obviously-answered question, but I wanted to check: why use
I thought this would be a pretty common question to look for in Google
Note: This might seem like a Super User question at first, but please read
What's your standard way of debugging a problem? This might seem like a pretty
I know how to achieve this, but it doesn't seem like the ruby way
This would seem to be the case in Firefox 3.5+, there I can instantiate

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.