Thursday, August 25, 2016

Excetion: waiting for namespace handlers [http://camel.apache.org/schema/cxf

2016-08-26 09:19:06,451 | INFO  | -7.0.0.M2/deploy | BlueprintContainerImpl           | 28 - org.apache.aries.blueprint.core - 1.6.1 | Bundle com.xxxx.yyyyyyy.esb/0.0.1.SNAPSHOT is waiting for namespace handlers [http://camel.apache.org/schema/cxf]

When I was developing an Apache Camel REST project using CXFRS with the blueprint schema in XML DSL, above INFO log was appeared and bundle went to a Grace period. When the issue occurred my xml namespace configurations as below.

<?xml version="1.0" encoding="UTF-8"?>

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util xmlns:cxf="http://camel.apache.org/schema/cxf"     

xsi:schemaLocation=" 
http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd 
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd"> 

I verified several times for the existence of the camel-cxf.xsd in the schemas of the camel-cxf dependency.

And also verified servicemix container contains the camel-cxf feature installed.

Finally I understood name-spaces and XSD locations should be as follows since I am using the blueprint schema.

xmlns:cxf="http://camel.apache.org/schema/bluprint/cxf" 

http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd

Then issue resolved.

Monday, August 22, 2016

Available XML tags in Apache Camel

onException when onCompletion
intercept interceptFrom interceptSendToEndpoint
to toD route
aop aggregate bean
doCatch choice otherwise
convertBodyTo delay dynamicRouter
enrich filter doFinally
idempotentConsumer inOnly inOut
loadBalance log loop
marshal multicast pipeline
policy pollEnrich process
recipientList removeHeader removeHeaders
removeProperties removeProperty resequence
rollback routingSlip sample
script setBody setExchangePattern
setFaultBody setHeader setOutHeader
setProperty sort split
stop threads throttle
throwException transacted transform
doTry unmarshal validate
whenSkipSendToEndpoint wireTap restBinding

Friday, August 5, 2016

How to set message headers for a apache camel restlet request

It is simple to set message headers for camel restlet request (Here we follow XML method to add those headers to a camel routing).

Following route will send a GET request to  http://192.168.1.20:8081/abcsys/services/esbInboundAdaptorServiceRest/V1.0/receiveMessage including Basic Authentication headers with username admin and password admin. A query param also get appended to the URI as http://192.168.1.20:8081/abcsys/services/esbInboundAdaptorServiceRest/V1.0/receiveMessage?message=new message

<route>

                    <!-- Set the query parameters to URI -->
                    <setHeader headerName="CamelHttpQuery">
                        <simple>message=new message</simple>
                    </setHeader>

                    <!-- Set the authentication header username for endpoint authorization -->
                    <setHeader headerName="CamelRestletLogin">
                        <simple>admin</simple>
                    </setHeader>

                    <!-- Set the authorization header password for endpoint authorization -->
                    <setHeader headerName="CamelRestletPassword">
                        <simple>admin</simple>
                    </setHeader>

                    <to
                        uri="restlet:http://192.168.1.20:8081/abcsys/services/esbInboundAdaptorServiceRest/V1.0/receiveMessage" />


</route>

Refer this for possible lists of headers that can be set to restlet requests.