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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:53:08+00:00 2026-06-05T20:53:08+00:00

I am trying to route a message based on information in a XML snippet

  • 0

I am trying to route a message based on information in a XML snippet stored as a local entry (key=mapping_id_ep_v1.xml). The id used to look-up the correct endpoint and it is part of the message body.

This is the XML snippet used to map id’s to endpoints:

<mappings>
    <mapping id="ep_1">http://localhost:8280/services/ep_1</mapping>
    <mapping id="ep_2">http://localhost:8280/services/ep_2</mapping>
    <mapping id="ep_3">http://localhost:8280/services/ep_3</mapping>
<mappings>

I retrieve the id from the body to look-up the endpoint using the following statement:

<property name="LOOK-UP" expression="//controleFile/id" />

I can load the XML file into a property file using the following entry in a sequence:

<property name="MAPPING" expression="get-property('mapping_id_ep_v1.xml')" />

I log the property using the following statement:

<log level="custom">
    <property name="Look-up" expression="get-property('LOOK-UP')" />
    <property name="Mapping" expression="get-property('MAPPING')" />
</log>

So far so good. I haven’t been able to figure out how to retrieve the correct endpoint from the MAPPING property. Can anyone help out?

  • 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-05T20:53:12+00:00Added an answer on June 5, 2026 at 8:53 pm

    I solved my question using a different approach. It is in line with the answer given bij fipries.

    In the proxy I added the following:

     <property name="MAPPING" expression="get-property('mapping_id_ep_v1')" />
     <property name="LOOK_UP" expression="//controlFile/id" />
     <log level="custom">
        <property name="MAPPING" expression="get-property('MAPPING')" />
        <property name="LOOK_UP" expression="get-property('LOOK_UP')" />
     </log>
     <script language="js" key="testScript_2" function="getEndpointByID" />
     <log level="custom">
        <property name="EP" expression="get-property('EP')" />
     </log>
    

    This is the contents of mapping_id_ep_v1:

    <mappings>
        <mapping id="ep_1">http://localhost:8280/services/ep_1</mapping>
        <mapping id="ep_2">http://localhost:8280/services/ep_2</mapping>
        <mapping id="ep_3">http://localhost:8280/services/ep_3</mapping>
    <mappings>
    

    This is the code in TestScript_2:

    <x>
    
      function getEndpointByID(mc) {
         var xml = new XML(mc.getProperty('MAPPING'));
         var look_up = new XML(mc.getProperty('LOOK_UP'));
         var ep = xml..mapping.(@id == look_up);
         mc.setProperty('EP', ep + '');
      }
    
    </x>
    

    The proxy loads the mapping xml into a property. This property is converted to XML in the javascript code and then using LOOK_UP the correct endpoint is retrieved.

    Hope this helps someone else.

    Regards, nidkil

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

Sidebar

Related Questions

The issue: I'm trying to transform and route a message based on its input
I am trying to develop a content-based routing camel application. This application will look
I'm trying to create an Apache Camel route that sends a jms message to
trying to use this route: from(activemq:profiles).aggregate(header(cheese)).batchSize(30).bean(ProfilesQueueService, saveContacts) Fails with: No signature of method: org.apache.camel.model.RouteType.aggregate()
I'm trying to create a route in Kohana 3.2 that would match URIs like
I'm trying to implement a custom route in rails match '/:slug' => products#get_by_slug, :as
I am trying to add a custom route to my RESTful routes using the
I'm trying to draw a route in a mapView from the current location (got
I am trying to use a single RouteURL to route to different pages dependent
I am trying to add multiple ip address under a sub domain in route

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.