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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:55:13+00:00 2026-05-27T09:55:13+00:00

I have a mule-config file where i have defined a http inbound to accept

  • 0

I have a mule-config file where i have defined a “http inbound” to accept request on the corresponding URL.

Now what i have to to is to accept only a valid http inbound address and reject others.

So i have applied a “choice” filter to filter out valid URL’s. (like the following) :

<flow name="abc">
    <http:inbound-endpoint address="http://localhost:1212/jcore/abc" 
transformer-refs="HttpParams" responseTransformer-refs="JavaObjectToJson" 
contentType="application/json" encoding="UTF-8">

    </http:inbound-endpoint>

    <component class="main.java.com.jcore.abc"/>

    <choice>
        <when evaluator="header" 
expression="INBOUND:http.request.path=/jcore/abc/a">

            <vm:outbound-endpoint path="ToSomething"/>

        </when>

         <when evaluator="header" 
expression="INBOUND:http.request.path=/jcore/abc/b">

            <vm:outbound-endpoint path="ToSomething"/>

        </when>

        <otherwise>
            <message-properties-transformer>
                <add-message-property key="http.status" value="404"/>
            </message-properties-transformer>
            <expression-transformer>
                <return-argument evaluator="string" 
expression="{&quot;Exception&quot;: &quot;Could not Render the Request. 
URL may be wrong&quot;}"/>
            </expression-transformer>
        </otherwise>

    </choice>

</flow>

It is Working ..!!

But i have around 30 “Flows” like this one. And i want to apply “choice” filter like this on every flow.

Note : the matching URL will get changed in each case. Like in this case it is “/abc/a”. In others , it is different

So, i wanted to know, if there is a way to avoid writing much of this redundant code and make a Spring bean with parameters OR sumthing else, that i can apply on each flow..??

  • 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-05-27T09:55:14+00:00Added an answer on May 27, 2026 at 9:55 am

    I’d separate the path validation logic from the actual request handling logic, which I will make generic, configurable, and shared across flows via a flow-ref construct.

    Something like this:

    <flow name="abc">
        <http:inbound-endpoint address="http://localhost:1212/jcore/abc"
            contentType="application/json" encoding="UTF-8" />
    
        <message-properties-transformer scope="invocation">
            <add-message-property key="supported.request.paths"
                                  value="/jcore/abc/a,/jcore/abc/b"/>
        </message-properties-transformer>    
        <flow-ref name="request-handler" />
    </flow>
    
    <flow name="request-handler">
        <script:component>
            <script:script engine="groovy">
                def requestPath = message.getInboundProperty('http.request.path')
                def supportedPaths = message.getInvocationProperty('supported.request.paths')
                def requestPathOk = supportedPaths.split(',').toList().contains(requestPath)
                message.setInvocationProperty('request.path.ok', requestPathOk)
                return message
            </script:script>
        </script:component>
        <choice>
            <when evaluator="header" expression="INVOCATION:request.path.ok=true">
                <vm:outbound-endpoint path="ToSomething" exchange-pattern="request-response" />
            </when>
            <otherwise>
                <message-properties-transformer>
                    <add-message-property key="http.status" value="404" />
                </message-properties-transformer>
                <expression-transformer>
                    <return-argument evaluator="string"
                        expression="{&quot;Exception&quot;: &quot;Could not Render the Request. URL may be wrong&quot;}" />
                </expression-transformer>
            </otherwise>
        </choice>
    </flow>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Flow in MULE like below : <flow name=MetaService> <http:inbound-endpoint address=http://localhost:8000/jcore/meta transformer-refs=HttpParams
I have a Flow in MULE which contains a HTTP inbound and component class
I have a Mule Application where I send a Request to Multiple WebServices and
I have a jruby/rails app using: jruby 1.4.0 Rails 2.3.5 ActiveMQ 5.3.0 Mule ESB
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
I have a running Mule application I am using in my project. What I
I have tried to use the lastest version of magento connector on mule 3.2.
i have a flow that works as follows: <flow name=ChatListener> <quartz:inbound-endpoint jobName=eventTimer repeatInterval=${chatListener.pollingInterval}> <quartz:event-generator-job
org.mule.api.lifecycle.InitialisationException: Initialisation Failure: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1] Offending resource:
I have the following use case in Mule ESB - Expose a SOAP endpoint

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.