2

I am trying to call route in a xml File, with 3 Levels 1) At first it's possible to call nested routes without limitations ?

2) This my example: My First File call RootFile01.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- Configures the Camel Context -->
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="  http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd          http://camel.apache.org/schema/spring   http://camel.apache.org/schema/spring/camel-spring.xsd">
    <!-- Import Framework. -->
    <import resource="classpath*:META-INF/spring/camel-context-framework*.xml"/>
    <import resource="File0A01.xml"/>


    <import resource="File0B01.xml"/>


    <camelContext id="camelContext-db465ea3-e2da-4931-8902-0c771d2eac3c" xmlns="http://camel.apache.org/schema/spring">
        <routeContextRef ref="routeContextNested0A01"/>
        <routeContextRef ref="routeContextNested0B01"/>
        <route handleFault="true" id="_route1">
            <from id="_from1" uri="coveo-soap://test"/>
            <recipientList id="_recipientList1">
                <method ref="soapDynamicRouter"/>
            </recipientList>
        </route>
    </camelContext>
</beans>

My second File File0A01.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- Configures the Camel Context -->
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="  http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd          http://camel.apache.org/schema/spring   http://camel.apache.org/schema/spring/camel-spring.xsd">
        <routeContext id="routeContextNested0A01"
        xmlns="http://camel.apache.org/schema/spring">

        <route handleFault="true" id="routeNested0A01">
            <from uri="direct://Nested0A01" />

            <log message="=Data In ${body}"></log>

            <to uri="direct://routeNested0B01" />

        </route>

    </routeContext>
</beans>

My third file File0B01.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:camel="http://camel.apache.org/schema/spring"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

    <routeContext id="routeContextNested0B01"
        xmlns="http://camel.apache.org/schema/spring"> 
        <route id="routeNested0B01">
            <from uri="direct://routeNested0B01"/>

            <log message="Data In - ${body}"></log>

        </route>
    </routeContext>
</beans>

It's seem, RootFile01.xml can find routeNested0A01 in my second File File0A01.xml. But my second File File0A01.xml cannot reach routeNested0B01 in my third file File0B01.xml.

Error Message: Exhausted after delivery attempt: 1 caught: org.apache.camel.component.direct.DirectConsumerNotAvailableException: No consumers available on endpoint: Endpoint[direct://routeNested0B01]

How should I resolve this problem?

  • How do you deploy and run this in Fuse? If you just copy those files to the deploy folder then they are independent and dont run in the same bundle. You need to package this into a single JAR/bundle and have it deployed as a single unit. Also mind that using Spring XML in OSGi is deprecated in Red Hat Fuse. Use OSGi blueprint instead. And you can also use Red Hat customer portal to get support with your Fuse product they can help faster and better than here. – Claus Ibsen Feb 26 '19 at 04:12
  • Hi, Thanks for your answer and advices I Will try on Red Hat customer portal. – Ama No Uzume Feb 26 '19 at 08:08

0 Answers0