You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Karuna Arshakota <ka...@progress.com> on 2009/01/06 08:28:14 UTC

configure routing slip

hi,
  I am new to Camel and found very interesting to work with patterns.I am
trying different patterns but struck at routing slip pattern.I am using
camel 1.4.

Please find that attached camel xml and input xml which am sending this
through an endpoint('somequeue')
http://www.nabble.com/file/p21305734/Header.xml Header.xml 
http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
camel-debugger-tmp6214.xml 

First time i got a message to the 'output' endpoint(URI) but when I ran
after that many times but no message were coming to the mentioned URIs.I am
expecting the message should come to all URIs that i mentioned in the input
xml (myqueue and output).Am I correct? Could you please explain the
functionality of routing slip and explain me how can i really use it.
Thanks for all ur help in Advance

-- 
View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21305734.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: configure routing slip

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah it looks correct. I guess you have read the wiki page at:
http://activemq.apache.org/camel/routing-slip.html

It could do with an update though as it's a bit sparse with samples.
Let me try to create a sample (based on unit test) using JMS as you
sample and see how it goes.




On Tue, Jan 6, 2009 at 8:28 AM, Karuna Arshakota <ka...@progress.com> wrote:
>
> hi,
>  I am new to Camel and found very interesting to work with patterns.I am
> trying different patterns but struck at routing slip pattern.I am using
> camel 1.4.
>
> Please find that attached camel xml and input xml which am sending this
> through an endpoint('somequeue')
> http://www.nabble.com/file/p21305734/Header.xml Header.xml
> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
> camel-debugger-tmp6214.xml
>
> First time i got a message to the 'output' endpoint(URI) but when I ran
> after that many times but no message were coming to the mentioned URIs.I am
> expecting the message should come to all URIs that i mentioned in the input
> xml (myqueue and output).Am I correct? Could you please explain the
> functionality of routing slip and explain me how can i really use it.
> Thanks for all ur help in Advance
>
> --
> View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21305734.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Re: configure routing slip

Posted by Karuna Arshakota <ka...@progress.com>.
Hi I got the output as mentioned below

Jan 13, 2009 2:40:00 PM org.apache.camel.processor.Logger process
INFO: ID-nbkarshkoxp/4717-1231837799623/2-0 -> interceptor1
Interceptor[Delegate(Pipeline[DeadLetterChannel[Delegate(TraceInterceptor[Processor[ref: 
mySetHeaderProcessor]]),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error],
RedeliveryPolicy[maximumRedeliveries=6]],
DeadLetterChannel[Delegate(TraceInterceptor[convertBodyTo[
java.lang.String]]),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error],
RedeliveryPolicy[maximumRedeliveries=6]],
DeadLetterChannel[Delegate(TraceInterceptor[RoutingSlip[
headerName=routingSlipHeader uriDelimiter=#]]),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error],
RedeliveryPolicy[maximumRedeliveries=6]]])] InOnly Properties:{}
Headers:{org.apache.camel.file.name=} BodyType:java.io.File Body:<?xml
version="1.0" encoding="UTF-8" standalone="yes"?>
<content>
    <entry type="1">
        <textMessage JMSCorrelationID=""  JMSDeliveryMode="2"
JMSExpiration="0" JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
JMSPriority="1" JMSRedelivered="true" JMSTimestamp="1230290093827"
JMSType="">
            <text>1</text>
        </textMessage>
    </entry>
</content>

Jan 13, 2009 2:40:00 PM org.apache.camel.processor.Logger process
INFO: ID-nbkarshkoxp/4717-1231837799623/2-0 -> processor1 Processor[ref: 
mySetHeaderProcessor] InOnly Properties:{CamelCauseException=null}
Headers:{org.apache.camel.file.name=} BodyType:java.io.File Body:<?xml
version="1.0" encoding="UTF-8" standalone="yes"?>
<content>
    <entry type="1">
        <textMessage JMSCorrelationID=""  JMSDeliveryMode="2"
JMSExpiration="0" JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
JMSPriority="1" JMSRedelivered="true" JMSTimestamp="1230290093827"
JMSType="">
            <text>1</text>
        </textMessage>
    </entry>
</content>

***Before Setting********
FileMessage:
D:\Eclipse3.4.1\runtime-New_configuration1\ABC\src\pick\Header.xml
org.apache.camel.component.file.FileMessage
file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop
******After setting*****
Jan 13, 2009 2:40:00 PM org.apache.camel.processor.Logger process
INFO: ID-nbkarshkoxp/4717-1231837799623/2-0 -> convertBodyTo1 convertBodyTo[
java.lang.String] InOnly Properties:{CamelCauseException=null}
Headers:{org.apache.camel.file.name=,
routingSlipHeader=file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop}
BodyType:java.io.File Body:<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<content>
    <entry type="1">
        <textMessage JMSCorrelationID=""  JMSDeliveryMode="2"
JMSExpiration="0" JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
JMSPriority="1" JMSRedelivered="true" JMSTimestamp="1230290093827"
JMSType="">
            <text>1</text>
        </textMessage>
    </entry>
</content>

Jan 13, 2009 2:40:00 PM org.apache.camel.processor.Logger process
INFO: ID-nbkarshkoxp/4717-1231837799623/2-0 -> Camel_RoutingSlip_4
RoutingSlip[ headerName=routingSlipHeader uriDelimiter=#] InOnly
Properties:{CamelCauseException=null} Headers:{org.apache.camel.file.name=,
routingSlipHeader=file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop}
BodyType:java.lang.String Body:<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<content>
    <entry type="1">
        <textMessage JMSCorrelationID=""  JMSDeliveryMode="2"
JMSExpiration="0" JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
JMSPriority="1" JMSRedelivered="true" JMSTimestamp="1230290093827"
JMSType="">
            <text>1</text>
        </textMessage>
    </entry>
</content>





James.Strachan wrote:
> 
> Have you tried enabling tracing? If so could you attach the output?
> http://activemq.apache.org/camel/tracer.html
> 
> 2009/1/9 Karuna Arshakota <ka...@progress.com>:
>>
>> Hi
>> i got the output when put
>>
>> System.out.println(exchange.getIn());
>> System.out.println(exchange.getIn().getClass().getName());
>>
>>  FileMessage:
>> D:\Eclipse3.4.1\runtime-New_configuration1\ABC\src\pick\Header.xml
>>  org.apache.camel.component.file.FileMessage
>>
>>
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> Can you output the exhange itself
>>>
>>> System.out.println(exchange.getIn());
>>> System.out.println(exchange.getIn().getClass().getName());
>>>
>>> In your processor between the before and after
>>>
>>> We want to see what kind of object you are working with.
>>>
>>>
>>>
>>> On Thu, Jan 8, 2009 at 12:28 PM, Karuna Arshakota
>>> <ka...@progress.com>
>>> wrote:
>>>>
>>>> Hi
>>>>  I tried like as you said but still am not able to route the message to
>>>> particular destination.I tried with file target and jms endpoints also.
>>>>
>>>> see the camel xml and class
>>>>
>>>> <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-2.0.xsd
>>>> http://activemq.apache.org/camel/schema/spring
>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>>>>        <import
>>>> resource="file:///D:\Eclipse3.4.1\runtime-New_configuration1\ABC\src\main\java\org\apache\camel\processor\routingslip\Callthis.xml"
>>>> /> "import bean xml here"
>>>>        <camelContext id="camelroute"
>>>>                xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>                <route
>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>                        <from
>>>>
>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick/Header.xml?autoCreate=false&amp;lock=false"
>>>>                                id="Camel_File_2" />
>>>>                        <process ref="mySetHeaderProcessor"></process>
>>>>                        <convertBodyTo
>>>> type="java.lang.String"></convertBodyTo>
>>>>                        <routingSlip uriDelimiter="#"
>>>> headerName="routingSlipHeader"
>>>>                                id="Camel_RoutingSlip_4" />
>>>>                </route>
>>>>        </camelContext>
>>>> </beans>
>>>>
>>>> class:
>>>> public class MySetHeaderProcessor implements Processor {
>>>>
>>>>        public void process(Exchange exchange) throws Exception {
>>>>                // TODO Auto-generated method stub
>>>>        System.out.println("***Before Setting********");
>>>>                exchange.getIn().setHeader("routingSlipHeader",
>>>> "file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop");
>>>>        System.out.println("******After setting*****");
>>>>
>>>>        }
>>>> }
>>>>
>>>> When i ran this i got output saying
>>>> ***Before Setting********
>>>> ******After setting*****
>>>> But no message was coming to
>>>> "file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop"
>>>> location.
>>>> If I set something like below in the class
>>>>
>>>> exchange.getIn().setHeader("routingSlipHeader", "jms:queue:myqueue");
>>>>
>>>> "cant convert org.apache.camel.DefaultMessage to
>>>> org.apache.camel.JMSMessage"
>>>>
>>>> Could you plz help me.....
>>>>
>>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> Ah <constant> was added in Camel 1.5.0 I think, so if you are running
>>>>> on an older release its not there.
>>>>>
>>>>> You can add the header from Java code. You can use a <process
>>>>> ref="mySetHeaderProcessor"/>
>>>>> And then add a spring bean with this id
>>>>>
>>>>> <bean id="mySetHeaderProcessor"
>>>>> class="com.mycompany.MySetHeaderProcessor"/>
>>>>>
>>>>> And then create a class with this name
>>>>> com.mycompany.MySetHeaderProcessor that implements the
>>>>> org.apache.camel.Processor interface.
>>>>>
>>>>> In there you can do:
>>>>>
>>>>> exchange.getIn().setHeader("routingSlipHeader", "and here the file
>>>>> target"/>
>>>>>
>>>>>
>>>>> On Thu, Jan 8, 2009 at 6:58 AM, Karuna Arshakota
>>>>> <ka...@progress.com>
>>>>> wrote:
>>>>>>
>>>>>> hi
>>>>>> I have set as u have mentioned but when i ran camel xml it it
>>>>>> throwing
>>>>>> exception saying
>>>>>>  "cvc-complex-type.2.4.a: Invalid content was found starting with
>>>>>> element
>>>>>> 'constant"
>>>>>>
>>>>>>
>>>>>>
>>>>>> Claus Ibsen-2 wrote:
>>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> You should use <constant> for constant expressions.
>>>>>>>
>>>>>>>                         <setHeader headerName="routingSlipHeader">
>>>>>>>
>>>>>>> <constant>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</constant>
>>>>>>>                         </setHeader>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Jan 8, 2009 at 6:40 AM, Karuna Arshakota
>>>>>>> <ka...@progress.com>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> hi
>>>>>>>>  I am sure that camel is running on my machine.I tried some thing
>>>>>>>> like
>>>>>>>> this.I am trying to send input file to which am setting some header
>>>>>>>> to
>>>>>>>> it
>>>>>>>> from camel xml.But the problem is while running the camel it
>>>>>>>> throwing
>>>>>>>> exception as mentioned below and also find camel xml.
>>>>>>>>
>>>>>>>> .............
>>>>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>>>                        <from
>>>>>>>>
>>>>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>>>>>                                id="Camel_File_2" />
>>>>>>>>                        <setHeader headerName="routingSlipHeader">
>>>>>>>>
>>>>>>>> <simple>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</simple>
>>>>>>>>                        </setHeader>
>>>>>>>>                        <routingSlip uriDelimiter="#"
>>>>>>>> headerName="routingSlipHeader"
>>>>>>>>                                id="Camel_RoutingSlip_4" />
>>>>>>>>                </route>
>>>>>>>> ...............
>>>>>>>>
>>>>>>>> Exception:
>>>>>>>>
>>>>>>>> org.apache.camel.language.IllegalSyntaxException: Illegal syntax
>>>>>>>> for
>>>>>>>> language: org.apache.camel.language.simple.SimpleLanguage@1f6f27b.
>>>>>>>> Expression:
>>>>>>>> file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target
>>>>>>>>        at
>>>>>>>> org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:139)
>>>>>>>>        at
>>>>>>>> org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:61)
>>>>>>>>        at
>>>>>>>> org.apache.camel.model.language.ExpressionType.createExpression(ExpressionType.java:141)
>>>>>>>>        at
>>>>>>>> org.apache.camel.model.SetHeaderType.createProcessor(SetHeaderType.java:75)
>>>>>>>>        at
>>>>>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:1635)
>>>>>>>>        at
>>>>>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:95)
>>>>>>>>        at
>>>>>>>> org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
>>>>>>>>        at
>>>>>>>> org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1519)
>>>>>>>>        at
>>>>>>>> org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:99)
>>>>>>>>        at
>>>>>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:221)
>>>>>>>>        at
>>>>>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
>>>>>>>>        at
>>>>>>>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
>>>>>>>>        at
>>>>>>>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
>>>>>>>>        at
>>>>>>>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
>>>>>>>>        at
>>>>>>>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>>>>>>>>        at
>>>>>>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>>>>>>>>        at
>>>>>>>> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>>>>>>>>        at
>>>>>>>> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>>>>>>>>        at
>>>>>>>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>>>>>>>>        at
>>>>>>>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
>>>>>>>>        at
>>>>>>>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
>>>>>>>>        at
>>>>>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
>>>>>>>>        at
>>>>>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
>>>>>>>>        at
>>>>>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:106)
>>>>>>>>        at
>>>>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.doLaunchDebuggedContext(CamelStandinRuntime.java:177)
>>>>>>>>        at
>>>>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.init(CamelStandinRuntime.java:131)
>>>>>>>>        at
>>>>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.main(CamelStandinRuntime.java:104)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Claus Ibsen-2 wrote:
>>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> We have to step back a bit on the routing slip to see that you can
>>>>>>>>> run
>>>>>>>>> camel and it can do something.
>>>>>>>>> So try the simple file mover without routingslip to see the file
>>>>>>>>> is
>>>>>>>>> moved. Then we now Camel is running and it can do something. Then
>>>>>>>>> we
>>>>>>>>> can address the routing slip issues afterwards
>>>>>>>>>
>>>>>>>>> When you copy a file in that folder, is it picked up by Camel,
>>>>>>>>> such
>>>>>>>>> as
>>>>>>>>> it will delete it after processing?
>>>>>>>>>
>>>>>>>>> In you case you are missing to parse the input file and set the
>>>>>>>>> header
>>>>>>>>> for the routing slip.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
>>>>>>>>> <ka...@progress.com> wrote:
>>>>>>>>>>
>>>>>>>>>> hi
>>>>>>>>>> I tried with file endpoints but it doesnt work.i am trying
>>>>>>>>>> resolve
>>>>>>>>>> the
>>>>>>>>>> problem but I am not able to do
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> this is camel xml
>>>>>>>>>> <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-2.0.xsd
>>>>>>>>>> http://activemq.apache.org/camel/schema/spring
>>>>>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
>>>>>>>>>> id="camelroute"
>>>>>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>>>>>    <from
>>>>>>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>>>>>>> id="Camel_File_2"/>
>>>>>>>>>>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>>>>>>>>>> id="Camel_RoutingSlip_4"/>
>>>>>>>>>> </route>
>>>>>>>>>> </camelContext></beans>
>>>>>>>>>>
>>>>>>>>>> and input file
>>>>>>>>>>
>>>>>>>>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>>>>>>>>> <content>
>>>>>>>>>>    <entry type="1">
>>>>>>>>>>        <textMessage JMSCorrelationID=""
>>>>>>>>>> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
>>>>>>>>>> JMSDeliveryMode="2" JMSExpiration="0"
>>>>>>>>>> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
>>>>>>>>>> JMSPriority="1"
>>>>>>>>>> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>>>>>>>>>>            <text>1</text>
>>>>>>>>>>        </textMessage>
>>>>>>>>>>    </entry>
>>>>>>>>>> </content>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Could you please check this and let me know any wrong in
>>>>>>>>>> configuring.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Claus Ibsen-2 wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi
>>>>>>>>>>>
>>>>>>>>>>> That is a bit odd. I added a JMS sample:
>>>>>>>>>>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>>>>>>>>>>
>>>>>>>>>>> Can you try with other kind of endpoints/transport to see if you
>>>>>>>>>>> for
>>>>>>>>>>> instance can get a file mover working?
>>>>>>>>>>>
>>>>>>>>>>> <from uri="file://inbox"/>
>>>>>>>>>>> <to uri="file://outbox"/>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota
>>>>>>>>>>> <ka...@progress.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> thanks for ur quick response.Ya I have read the link mentioned
>>>>>>>>>>>> in
>>>>>>>>>>>> wiki.Still
>>>>>>>>>>>> I am getting same problem that i have mentioned earlier.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Karuna Arshakota wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> hi,
>>>>>>>>>>>>>   I am new to Camel and found very interesting to work with
>>>>>>>>>>>>> patterns.I
>>>>>>>>>>>>> am
>>>>>>>>>>>>> trying different patterns but struck at routing slip pattern.I
>>>>>>>>>>>>> am
>>>>>>>>>>>>> using
>>>>>>>>>>>>> camel 1.4.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Please find that attached camel xml and input xml which am
>>>>>>>>>>>>> sending
>>>>>>>>>>>>> this
>>>>>>>>>>>>> through an endpoint('somequeue')
>>>>>>>>>>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>>>>>>>>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>>>>>>>>>>> camel-debugger-tmp6214.xml
>>>>>>>>>>>>>
>>>>>>>>>>>>> First time i got a message to the 'output' endpoint(URI) but
>>>>>>>>>>>>> when
>>>>>>>>>>>>> I
>>>>>>>>>>>>> ran
>>>>>>>>>>>>> after that many times but no message were coming to the
>>>>>>>>>>>>> mentioned
>>>>>>>>>>>>> URIs.I
>>>>>>>>>>>>> am expecting the message should come to all URIs that i
>>>>>>>>>>>>> mentioned
>>>>>>>>>>>>> in
>>>>>>>>>>>>> the
>>>>>>>>>>>>> input xml (myqueue and output).Am I correct? Could you please
>>>>>>>>>>>>> explain
>>>>>>>>>>>>> the
>>>>>>>>>>>>> functionality of routing slip and explain me how can i really
>>>>>>>>>>>>> use
>>>>>>>>>>>>> it.
>>>>>>>>>>>>> Thanks for all ur help in Advance
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>>>>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>>
>>>>>>>>>>> /Claus Ibsen
>>>>>>>>>>> Apache Camel Committer
>>>>>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> View this message in context:
>>>>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
>>>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> /Claus Ibsen
>>>>>>>>> Apache Camel Committer
>>>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>>>
>>>>>>>>>
>>>>>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>>>>>> RoutingSlipfile.xml
>>>>>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>>>>>> RoutingSlipfile.xml
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346200.html
>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> /Claus Ibsen
>>>>>>> Apache Camel Committer
>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346350.html
>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> /Claus Ibsen
>>>>> Apache Camel Committer
>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21350224.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> /Claus Ibsen
>>> Apache Camel Committer
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21366502.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21431830.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: configure routing slip

Posted by James Strachan <ja...@gmail.com>.
Have you tried enabling tracing? If so could you attach the output?
http://activemq.apache.org/camel/tracer.html

2009/1/9 Karuna Arshakota <ka...@progress.com>:
>
> Hi
> i got the output when put
>
> System.out.println(exchange.getIn());
> System.out.println(exchange.getIn().getClass().getName());
>
>  FileMessage:
> D:\Eclipse3.4.1\runtime-New_configuration1\ABC\src\pick\Header.xml
>  org.apache.camel.component.file.FileMessage
>
>
>
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> Can you output the exhange itself
>>
>> System.out.println(exchange.getIn());
>> System.out.println(exchange.getIn().getClass().getName());
>>
>> In your processor between the before and after
>>
>> We want to see what kind of object you are working with.
>>
>>
>>
>> On Thu, Jan 8, 2009 at 12:28 PM, Karuna Arshakota <ka...@progress.com>
>> wrote:
>>>
>>> Hi
>>>  I tried like as you said but still am not able to route the message to
>>> particular destination.I tried with file target and jms endpoints also.
>>>
>>> see the camel xml and class
>>>
>>> <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-2.0.xsd
>>> http://activemq.apache.org/camel/schema/spring
>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>>>        <import
>>> resource="file:///D:\Eclipse3.4.1\runtime-New_configuration1\ABC\src\main\java\org\apache\camel\processor\routingslip\Callthis.xml"
>>> /> "import bean xml here"
>>>        <camelContext id="camelroute"
>>>                xmlns="http://activemq.apache.org/camel/schema/spring">
>>>                <route
>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>                        <from
>>>
>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick/Header.xml?autoCreate=false&amp;lock=false"
>>>                                id="Camel_File_2" />
>>>                        <process ref="mySetHeaderProcessor"></process>
>>>                        <convertBodyTo
>>> type="java.lang.String"></convertBodyTo>
>>>                        <routingSlip uriDelimiter="#"
>>> headerName="routingSlipHeader"
>>>                                id="Camel_RoutingSlip_4" />
>>>                </route>
>>>        </camelContext>
>>> </beans>
>>>
>>> class:
>>> public class MySetHeaderProcessor implements Processor {
>>>
>>>        public void process(Exchange exchange) throws Exception {
>>>                // TODO Auto-generated method stub
>>>        System.out.println("***Before Setting********");
>>>                exchange.getIn().setHeader("routingSlipHeader",
>>> "file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop");
>>>        System.out.println("******After setting*****");
>>>
>>>        }
>>> }
>>>
>>> When i ran this i got output saying
>>> ***Before Setting********
>>> ******After setting*****
>>> But no message was coming to
>>> "file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop"
>>> location.
>>> If I set something like below in the class
>>>
>>> exchange.getIn().setHeader("routingSlipHeader", "jms:queue:myqueue");
>>>
>>> "cant convert org.apache.camel.DefaultMessage to
>>> org.apache.camel.JMSMessage"
>>>
>>> Could you plz help me.....
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> Hi
>>>>
>>>> Ah <constant> was added in Camel 1.5.0 I think, so if you are running
>>>> on an older release its not there.
>>>>
>>>> You can add the header from Java code. You can use a <process
>>>> ref="mySetHeaderProcessor"/>
>>>> And then add a spring bean with this id
>>>>
>>>> <bean id="mySetHeaderProcessor"
>>>> class="com.mycompany.MySetHeaderProcessor"/>
>>>>
>>>> And then create a class with this name
>>>> com.mycompany.MySetHeaderProcessor that implements the
>>>> org.apache.camel.Processor interface.
>>>>
>>>> In there you can do:
>>>>
>>>> exchange.getIn().setHeader("routingSlipHeader", "and here the file
>>>> target"/>
>>>>
>>>>
>>>> On Thu, Jan 8, 2009 at 6:58 AM, Karuna Arshakota <ka...@progress.com>
>>>> wrote:
>>>>>
>>>>> hi
>>>>> I have set as u have mentioned but when i ran camel xml it it throwing
>>>>> exception saying
>>>>>  "cvc-complex-type.2.4.a: Invalid content was found starting with
>>>>> element
>>>>> 'constant"
>>>>>
>>>>>
>>>>>
>>>>> Claus Ibsen-2 wrote:
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>> You should use <constant> for constant expressions.
>>>>>>
>>>>>>                         <setHeader headerName="routingSlipHeader">
>>>>>>
>>>>>> <constant>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</constant>
>>>>>>                         </setHeader>
>>>>>>
>>>>>>
>>>>>> On Thu, Jan 8, 2009 at 6:40 AM, Karuna Arshakota
>>>>>> <ka...@progress.com>
>>>>>> wrote:
>>>>>>>
>>>>>>> hi
>>>>>>>  I am sure that camel is running on my machine.I tried some thing
>>>>>>> like
>>>>>>> this.I am trying to send input file to which am setting some header
>>>>>>> to
>>>>>>> it
>>>>>>> from camel xml.But the problem is while running the camel it throwing
>>>>>>> exception as mentioned below and also find camel xml.
>>>>>>>
>>>>>>> .............
>>>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>>                        <from
>>>>>>>
>>>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>>>>                                id="Camel_File_2" />
>>>>>>>                        <setHeader headerName="routingSlipHeader">
>>>>>>>
>>>>>>> <simple>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</simple>
>>>>>>>                        </setHeader>
>>>>>>>                        <routingSlip uriDelimiter="#"
>>>>>>> headerName="routingSlipHeader"
>>>>>>>                                id="Camel_RoutingSlip_4" />
>>>>>>>                </route>
>>>>>>> ...............
>>>>>>>
>>>>>>> Exception:
>>>>>>>
>>>>>>> org.apache.camel.language.IllegalSyntaxException: Illegal syntax for
>>>>>>> language: org.apache.camel.language.simple.SimpleLanguage@1f6f27b.
>>>>>>> Expression:
>>>>>>> file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target
>>>>>>>        at
>>>>>>> org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:139)
>>>>>>>        at
>>>>>>> org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:61)
>>>>>>>        at
>>>>>>> org.apache.camel.model.language.ExpressionType.createExpression(ExpressionType.java:141)
>>>>>>>        at
>>>>>>> org.apache.camel.model.SetHeaderType.createProcessor(SetHeaderType.java:75)
>>>>>>>        at
>>>>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:1635)
>>>>>>>        at
>>>>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:95)
>>>>>>>        at
>>>>>>> org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
>>>>>>>        at
>>>>>>> org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1519)
>>>>>>>        at
>>>>>>> org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:99)
>>>>>>>        at
>>>>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:221)
>>>>>>>        at
>>>>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
>>>>>>>        at
>>>>>>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
>>>>>>>        at
>>>>>>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
>>>>>>>        at
>>>>>>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
>>>>>>>        at
>>>>>>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>>>>>>>        at
>>>>>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>>>>>>>        at
>>>>>>> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>>>>>>>        at
>>>>>>> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>>>>>>>        at
>>>>>>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>>>>>>>        at
>>>>>>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
>>>>>>>        at
>>>>>>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
>>>>>>>        at
>>>>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
>>>>>>>        at
>>>>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
>>>>>>>        at
>>>>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:106)
>>>>>>>        at
>>>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.doLaunchDebuggedContext(CamelStandinRuntime.java:177)
>>>>>>>        at
>>>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.init(CamelStandinRuntime.java:131)
>>>>>>>        at
>>>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.main(CamelStandinRuntime.java:104)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Claus Ibsen-2 wrote:
>>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> We have to step back a bit on the routing slip to see that you can
>>>>>>>> run
>>>>>>>> camel and it can do something.
>>>>>>>> So try the simple file mover without routingslip to see the file is
>>>>>>>> moved. Then we now Camel is running and it can do something. Then we
>>>>>>>> can address the routing slip issues afterwards
>>>>>>>>
>>>>>>>> When you copy a file in that folder, is it picked up by Camel, such
>>>>>>>> as
>>>>>>>> it will delete it after processing?
>>>>>>>>
>>>>>>>> In you case you are missing to parse the input file and set the
>>>>>>>> header
>>>>>>>> for the routing slip.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
>>>>>>>> <ka...@progress.com> wrote:
>>>>>>>>>
>>>>>>>>> hi
>>>>>>>>> I tried with file endpoints but it doesnt work.i am trying resolve
>>>>>>>>> the
>>>>>>>>> problem but I am not able to do
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> this is camel xml
>>>>>>>>> <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-2.0.xsd
>>>>>>>>> http://activemq.apache.org/camel/schema/spring
>>>>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
>>>>>>>>> id="camelroute"
>>>>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>>>>    <from
>>>>>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>>>>>> id="Camel_File_2"/>
>>>>>>>>>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>>>>>>>>> id="Camel_RoutingSlip_4"/>
>>>>>>>>> </route>
>>>>>>>>> </camelContext></beans>
>>>>>>>>>
>>>>>>>>> and input file
>>>>>>>>>
>>>>>>>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>>>>>>>> <content>
>>>>>>>>>    <entry type="1">
>>>>>>>>>        <textMessage JMSCorrelationID=""
>>>>>>>>> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
>>>>>>>>> JMSDeliveryMode="2" JMSExpiration="0"
>>>>>>>>> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
>>>>>>>>> JMSPriority="1"
>>>>>>>>> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>>>>>>>>>            <text>1</text>
>>>>>>>>>        </textMessage>
>>>>>>>>>    </entry>
>>>>>>>>> </content>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Could you please check this and let me know any wrong in
>>>>>>>>> configuring.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Claus Ibsen-2 wrote:
>>>>>>>>>>
>>>>>>>>>> Hi
>>>>>>>>>>
>>>>>>>>>> That is a bit odd. I added a JMS sample:
>>>>>>>>>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>>>>>>>>>
>>>>>>>>>> Can you try with other kind of endpoints/transport to see if you
>>>>>>>>>> for
>>>>>>>>>> instance can get a file mover working?
>>>>>>>>>>
>>>>>>>>>> <from uri="file://inbox"/>
>>>>>>>>>> <to uri="file://outbox"/>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota
>>>>>>>>>> <ka...@progress.com>
>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> thanks for ur quick response.Ya I have read the link mentioned in
>>>>>>>>>>> wiki.Still
>>>>>>>>>>> I am getting same problem that i have mentioned earlier.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Karuna Arshakota wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> hi,
>>>>>>>>>>>>   I am new to Camel and found very interesting to work with
>>>>>>>>>>>> patterns.I
>>>>>>>>>>>> am
>>>>>>>>>>>> trying different patterns but struck at routing slip pattern.I
>>>>>>>>>>>> am
>>>>>>>>>>>> using
>>>>>>>>>>>> camel 1.4.
>>>>>>>>>>>>
>>>>>>>>>>>> Please find that attached camel xml and input xml which am
>>>>>>>>>>>> sending
>>>>>>>>>>>> this
>>>>>>>>>>>> through an endpoint('somequeue')
>>>>>>>>>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>>>>>>>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>>>>>>>>>> camel-debugger-tmp6214.xml
>>>>>>>>>>>>
>>>>>>>>>>>> First time i got a message to the 'output' endpoint(URI) but
>>>>>>>>>>>> when
>>>>>>>>>>>> I
>>>>>>>>>>>> ran
>>>>>>>>>>>> after that many times but no message were coming to the
>>>>>>>>>>>> mentioned
>>>>>>>>>>>> URIs.I
>>>>>>>>>>>> am expecting the message should come to all URIs that i
>>>>>>>>>>>> mentioned
>>>>>>>>>>>> in
>>>>>>>>>>>> the
>>>>>>>>>>>> input xml (myqueue and output).Am I correct? Could you please
>>>>>>>>>>>> explain
>>>>>>>>>>>> the
>>>>>>>>>>>> functionality of routing slip and explain me how can i really
>>>>>>>>>>>> use
>>>>>>>>>>>> it.
>>>>>>>>>>>> Thanks for all ur help in Advance
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> View this message in context:
>>>>>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>>>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>>
>>>>>>>>>> /Claus Ibsen
>>>>>>>>>> Apache Camel Committer
>>>>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
>>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> /Claus Ibsen
>>>>>>>> Apache Camel Committer
>>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>>
>>>>>>>>
>>>>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>>>>> RoutingSlipfile.xml
>>>>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>>>>> RoutingSlipfile.xml
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346200.html
>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> /Claus Ibsen
>>>>>> Apache Camel Committer
>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346350.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> /Claus Ibsen
>>>> Apache Camel Committer
>>>> Blog: http://davsclaus.blogspot.com/
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21350224.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
>
> --
> View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21366502.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Re: configure routing slip

Posted by Karuna Arshakota <ka...@progress.com>.
Hi
i got the output when put 

System.out.println(exchange.getIn());
System.out.println(exchange.getIn().getClass().getName());

 FileMessage:
D:\Eclipse3.4.1\runtime-New_configuration1\ABC\src\pick\Header.xml
 org.apache.camel.component.file.FileMessage





Claus Ibsen-2 wrote:
> 
> Hi
> 
> Can you output the exhange itself
> 
> System.out.println(exchange.getIn());
> System.out.println(exchange.getIn().getClass().getName());
> 
> In your processor between the before and after
> 
> We want to see what kind of object you are working with.
> 
> 
> 
> On Thu, Jan 8, 2009 at 12:28 PM, Karuna Arshakota <ka...@progress.com>
> wrote:
>>
>> Hi
>>  I tried like as you said but still am not able to route the message to
>> particular destination.I tried with file target and jms endpoints also.
>>
>> see the camel xml and class
>>
>> <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-2.0.xsd
>> http://activemq.apache.org/camel/schema/spring
>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>>        <import
>> resource="file:///D:\Eclipse3.4.1\runtime-New_configuration1\ABC\src\main\java\org\apache\camel\processor\routingslip\Callthis.xml"
>> /> "import bean xml here"
>>        <camelContext id="camelroute"
>>                xmlns="http://activemq.apache.org/camel/schema/spring">
>>                <route
>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>                        <from
>>
>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick/Header.xml?autoCreate=false&amp;lock=false"
>>                                id="Camel_File_2" />
>>                        <process ref="mySetHeaderProcessor"></process>
>>                        <convertBodyTo
>> type="java.lang.String"></convertBodyTo>
>>                        <routingSlip uriDelimiter="#"
>> headerName="routingSlipHeader"
>>                                id="Camel_RoutingSlip_4" />
>>                </route>
>>        </camelContext>
>> </beans>
>>
>> class:
>> public class MySetHeaderProcessor implements Processor {
>>
>>        public void process(Exchange exchange) throws Exception {
>>                // TODO Auto-generated method stub
>>        System.out.println("***Before Setting********");
>>                exchange.getIn().setHeader("routingSlipHeader",
>> "file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop");
>>        System.out.println("******After setting*****");
>>
>>        }
>> }
>>
>> When i ran this i got output saying
>> ***Before Setting********
>> ******After setting*****
>> But no message was coming to
>> "file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop"
>> location.
>> If I set something like below in the class
>>
>> exchange.getIn().setHeader("routingSlipHeader", "jms:queue:myqueue");
>>
>> "cant convert org.apache.camel.DefaultMessage to
>> org.apache.camel.JMSMessage"
>>
>> Could you plz help me.....
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> Ah <constant> was added in Camel 1.5.0 I think, so if you are running
>>> on an older release its not there.
>>>
>>> You can add the header from Java code. You can use a <process
>>> ref="mySetHeaderProcessor"/>
>>> And then add a spring bean with this id
>>>
>>> <bean id="mySetHeaderProcessor"
>>> class="com.mycompany.MySetHeaderProcessor"/>
>>>
>>> And then create a class with this name
>>> com.mycompany.MySetHeaderProcessor that implements the
>>> org.apache.camel.Processor interface.
>>>
>>> In there you can do:
>>>
>>> exchange.getIn().setHeader("routingSlipHeader", "and here the file
>>> target"/>
>>>
>>>
>>> On Thu, Jan 8, 2009 at 6:58 AM, Karuna Arshakota <ka...@progress.com>
>>> wrote:
>>>>
>>>> hi
>>>> I have set as u have mentioned but when i ran camel xml it it throwing
>>>> exception saying
>>>>  "cvc-complex-type.2.4.a: Invalid content was found starting with
>>>> element
>>>> 'constant"
>>>>
>>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> You should use <constant> for constant expressions.
>>>>>
>>>>>                         <setHeader headerName="routingSlipHeader">
>>>>>
>>>>> <constant>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</constant>
>>>>>                         </setHeader>
>>>>>
>>>>>
>>>>> On Thu, Jan 8, 2009 at 6:40 AM, Karuna Arshakota
>>>>> <ka...@progress.com>
>>>>> wrote:
>>>>>>
>>>>>> hi
>>>>>>  I am sure that camel is running on my machine.I tried some thing
>>>>>> like
>>>>>> this.I am trying to send input file to which am setting some header
>>>>>> to
>>>>>> it
>>>>>> from camel xml.But the problem is while running the camel it throwing
>>>>>> exception as mentioned below and also find camel xml.
>>>>>>
>>>>>> .............
>>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>                        <from
>>>>>>
>>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>>>                                id="Camel_File_2" />
>>>>>>                        <setHeader headerName="routingSlipHeader">
>>>>>>
>>>>>> <simple>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</simple>
>>>>>>                        </setHeader>
>>>>>>                        <routingSlip uriDelimiter="#"
>>>>>> headerName="routingSlipHeader"
>>>>>>                                id="Camel_RoutingSlip_4" />
>>>>>>                </route>
>>>>>> ...............
>>>>>>
>>>>>> Exception:
>>>>>>
>>>>>> org.apache.camel.language.IllegalSyntaxException: Illegal syntax for
>>>>>> language: org.apache.camel.language.simple.SimpleLanguage@1f6f27b.
>>>>>> Expression:
>>>>>> file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target
>>>>>>        at
>>>>>> org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:139)
>>>>>>        at
>>>>>> org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:61)
>>>>>>        at
>>>>>> org.apache.camel.model.language.ExpressionType.createExpression(ExpressionType.java:141)
>>>>>>        at
>>>>>> org.apache.camel.model.SetHeaderType.createProcessor(SetHeaderType.java:75)
>>>>>>        at
>>>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:1635)
>>>>>>        at
>>>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:95)
>>>>>>        at
>>>>>> org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
>>>>>>        at
>>>>>> org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1519)
>>>>>>        at
>>>>>> org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:99)
>>>>>>        at
>>>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:221)
>>>>>>        at
>>>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
>>>>>>        at
>>>>>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
>>>>>>        at
>>>>>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
>>>>>>        at
>>>>>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
>>>>>>        at
>>>>>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>>>>>>        at
>>>>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>>>>>>        at
>>>>>> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>>>>>>        at
>>>>>> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>>>>>>        at
>>>>>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>>>>>>        at
>>>>>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
>>>>>>        at
>>>>>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
>>>>>>        at
>>>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
>>>>>>        at
>>>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
>>>>>>        at
>>>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:106)
>>>>>>        at
>>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.doLaunchDebuggedContext(CamelStandinRuntime.java:177)
>>>>>>        at
>>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.init(CamelStandinRuntime.java:131)
>>>>>>        at
>>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.main(CamelStandinRuntime.java:104)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Claus Ibsen-2 wrote:
>>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> We have to step back a bit on the routing slip to see that you can
>>>>>>> run
>>>>>>> camel and it can do something.
>>>>>>> So try the simple file mover without routingslip to see the file is
>>>>>>> moved. Then we now Camel is running and it can do something. Then we
>>>>>>> can address the routing slip issues afterwards
>>>>>>>
>>>>>>> When you copy a file in that folder, is it picked up by Camel, such
>>>>>>> as
>>>>>>> it will delete it after processing?
>>>>>>>
>>>>>>> In you case you are missing to parse the input file and set the
>>>>>>> header
>>>>>>> for the routing slip.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
>>>>>>> <ka...@progress.com> wrote:
>>>>>>>>
>>>>>>>> hi
>>>>>>>> I tried with file endpoints but it doesnt work.i am trying resolve
>>>>>>>> the
>>>>>>>> problem but I am not able to do
>>>>>>>>
>>>>>>>>
>>>>>>>> this is camel xml
>>>>>>>> <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-2.0.xsd
>>>>>>>> http://activemq.apache.org/camel/schema/spring
>>>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
>>>>>>>> id="camelroute"
>>>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>>>    <from
>>>>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>>>>> id="Camel_File_2"/>
>>>>>>>>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>>>>>>>> id="Camel_RoutingSlip_4"/>
>>>>>>>> </route>
>>>>>>>> </camelContext></beans>
>>>>>>>>
>>>>>>>> and input file
>>>>>>>>
>>>>>>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>>>>>>> <content>
>>>>>>>>    <entry type="1">
>>>>>>>>        <textMessage JMSCorrelationID=""
>>>>>>>> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
>>>>>>>> JMSDeliveryMode="2" JMSExpiration="0"
>>>>>>>> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
>>>>>>>> JMSPriority="1"
>>>>>>>> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>>>>>>>>            <text>1</text>
>>>>>>>>        </textMessage>
>>>>>>>>    </entry>
>>>>>>>> </content>
>>>>>>>>
>>>>>>>>
>>>>>>>> Could you please check this and let me know any wrong in
>>>>>>>> configuring.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Claus Ibsen-2 wrote:
>>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> That is a bit odd. I added a JMS sample:
>>>>>>>>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>>>>>>>>
>>>>>>>>> Can you try with other kind of endpoints/transport to see if you
>>>>>>>>> for
>>>>>>>>> instance can get a file mover working?
>>>>>>>>>
>>>>>>>>> <from uri="file://inbox"/>
>>>>>>>>> <to uri="file://outbox"/>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota
>>>>>>>>> <ka...@progress.com>
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> thanks for ur quick response.Ya I have read the link mentioned in
>>>>>>>>>> wiki.Still
>>>>>>>>>> I am getting same problem that i have mentioned earlier.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Karuna Arshakota wrote:
>>>>>>>>>>>
>>>>>>>>>>> hi,
>>>>>>>>>>>   I am new to Camel and found very interesting to work with
>>>>>>>>>>> patterns.I
>>>>>>>>>>> am
>>>>>>>>>>> trying different patterns but struck at routing slip pattern.I
>>>>>>>>>>> am
>>>>>>>>>>> using
>>>>>>>>>>> camel 1.4.
>>>>>>>>>>>
>>>>>>>>>>> Please find that attached camel xml and input xml which am
>>>>>>>>>>> sending
>>>>>>>>>>> this
>>>>>>>>>>> through an endpoint('somequeue')
>>>>>>>>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>>>>>>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>>>>>>>>> camel-debugger-tmp6214.xml
>>>>>>>>>>>
>>>>>>>>>>> First time i got a message to the 'output' endpoint(URI) but
>>>>>>>>>>> when
>>>>>>>>>>> I
>>>>>>>>>>> ran
>>>>>>>>>>> after that many times but no message were coming to the
>>>>>>>>>>> mentioned
>>>>>>>>>>> URIs.I
>>>>>>>>>>> am expecting the message should come to all URIs that i
>>>>>>>>>>> mentioned
>>>>>>>>>>> in
>>>>>>>>>>> the
>>>>>>>>>>> input xml (myqueue and output).Am I correct? Could you please
>>>>>>>>>>> explain
>>>>>>>>>>> the
>>>>>>>>>>> functionality of routing slip and explain me how can i really
>>>>>>>>>>> use
>>>>>>>>>>> it.
>>>>>>>>>>> Thanks for all ur help in Advance
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> View this message in context:
>>>>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> /Claus Ibsen
>>>>>>>>> Apache Camel Committer
>>>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> /Claus Ibsen
>>>>>>> Apache Camel Committer
>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>
>>>>>>>
>>>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>>>> RoutingSlipfile.xml
>>>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>>>> RoutingSlipfile.xml
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346200.html
>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> /Claus Ibsen
>>>>> Apache Camel Committer
>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346350.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> /Claus Ibsen
>>> Apache Camel Committer
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21350224.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21366502.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: configure routing slip

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Can you output the exhange itself

System.out.println(exchange.getIn());
System.out.println(exchange.getIn().getClass().getName());

In your processor between the before and after

We want to see what kind of object you are working with.



On Thu, Jan 8, 2009 at 12:28 PM, Karuna Arshakota <ka...@progress.com> wrote:
>
> Hi
>  I tried like as you said but still am not able to route the message to
> particular destination.I tried with file target and jms endpoints also.
>
> see the camel xml and class
>
> <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-2.0.xsd
> http://activemq.apache.org/camel/schema/spring
> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>        <import
> resource="file:///D:\Eclipse3.4.1\runtime-New_configuration1\ABC\src\main\java\org\apache\camel\processor\routingslip\Callthis.xml"
> /> "import bean xml here"
>        <camelContext id="camelroute"
>                xmlns="http://activemq.apache.org/camel/schema/spring">
>                <route xmlns="http://activemq.apache.org/camel/schema/spring">
>                        <from
>
> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick/Header.xml?autoCreate=false&amp;lock=false"
>                                id="Camel_File_2" />
>                        <process ref="mySetHeaderProcessor"></process>
>                        <convertBodyTo type="java.lang.String"></convertBodyTo>
>                        <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>                                id="Camel_RoutingSlip_4" />
>                </route>
>        </camelContext>
> </beans>
>
> class:
> public class MySetHeaderProcessor implements Processor {
>
>        public void process(Exchange exchange) throws Exception {
>                // TODO Auto-generated method stub
>        System.out.println("***Before Setting********");
>                exchange.getIn().setHeader("routingSlipHeader",
> "file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop");
>        System.out.println("******After setting*****");
>
>        }
> }
>
> When i ran this i got output saying
> ***Before Setting********
> ******After setting*****
> But no message was coming to
> "file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop" location.
> If I set something like below in the class
>
> exchange.getIn().setHeader("routingSlipHeader", "jms:queue:myqueue");
>
> "cant convert org.apache.camel.DefaultMessage to
> org.apache.camel.JMSMessage"
>
> Could you plz help me.....
>
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> Ah <constant> was added in Camel 1.5.0 I think, so if you are running
>> on an older release its not there.
>>
>> You can add the header from Java code. You can use a <process
>> ref="mySetHeaderProcessor"/>
>> And then add a spring bean with this id
>>
>> <bean id="mySetHeaderProcessor"
>> class="com.mycompany.MySetHeaderProcessor"/>
>>
>> And then create a class with this name
>> com.mycompany.MySetHeaderProcessor that implements the
>> org.apache.camel.Processor interface.
>>
>> In there you can do:
>>
>> exchange.getIn().setHeader("routingSlipHeader", "and here the file
>> target"/>
>>
>>
>> On Thu, Jan 8, 2009 at 6:58 AM, Karuna Arshakota <ka...@progress.com>
>> wrote:
>>>
>>> hi
>>> I have set as u have mentioned but when i ran camel xml it it throwing
>>> exception saying
>>>  "cvc-complex-type.2.4.a: Invalid content was found starting with element
>>> 'constant"
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> Hi
>>>>
>>>> You should use <constant> for constant expressions.
>>>>
>>>>                         <setHeader headerName="routingSlipHeader">
>>>>
>>>> <constant>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</constant>
>>>>                         </setHeader>
>>>>
>>>>
>>>> On Thu, Jan 8, 2009 at 6:40 AM, Karuna Arshakota <ka...@progress.com>
>>>> wrote:
>>>>>
>>>>> hi
>>>>>  I am sure that camel is running on my machine.I tried some thing like
>>>>> this.I am trying to send input file to which am setting some header to
>>>>> it
>>>>> from camel xml.But the problem is while running the camel it throwing
>>>>> exception as mentioned below and also find camel xml.
>>>>>
>>>>> .............
>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>                        <from
>>>>>
>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>>                                id="Camel_File_2" />
>>>>>                        <setHeader headerName="routingSlipHeader">
>>>>>
>>>>> <simple>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</simple>
>>>>>                        </setHeader>
>>>>>                        <routingSlip uriDelimiter="#"
>>>>> headerName="routingSlipHeader"
>>>>>                                id="Camel_RoutingSlip_4" />
>>>>>                </route>
>>>>> ...............
>>>>>
>>>>> Exception:
>>>>>
>>>>> org.apache.camel.language.IllegalSyntaxException: Illegal syntax for
>>>>> language: org.apache.camel.language.simple.SimpleLanguage@1f6f27b.
>>>>> Expression:
>>>>> file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target
>>>>>        at
>>>>> org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:139)
>>>>>        at
>>>>> org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:61)
>>>>>        at
>>>>> org.apache.camel.model.language.ExpressionType.createExpression(ExpressionType.java:141)
>>>>>        at
>>>>> org.apache.camel.model.SetHeaderType.createProcessor(SetHeaderType.java:75)
>>>>>        at
>>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:1635)
>>>>>        at
>>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:95)
>>>>>        at
>>>>> org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
>>>>>        at
>>>>> org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1519)
>>>>>        at
>>>>> org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:99)
>>>>>        at
>>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:221)
>>>>>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
>>>>>        at
>>>>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
>>>>>        at
>>>>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
>>>>>        at
>>>>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
>>>>>        at
>>>>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>>>>>        at
>>>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>>>>>        at
>>>>> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>>>>>        at
>>>>> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>>>>>        at
>>>>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>>>>>        at
>>>>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
>>>>>        at
>>>>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
>>>>>        at
>>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
>>>>>        at
>>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
>>>>>        at
>>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:106)
>>>>>        at
>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.doLaunchDebuggedContext(CamelStandinRuntime.java:177)
>>>>>        at
>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.init(CamelStandinRuntime.java:131)
>>>>>        at
>>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.main(CamelStandinRuntime.java:104)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Claus Ibsen-2 wrote:
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>> We have to step back a bit on the routing slip to see that you can run
>>>>>> camel and it can do something.
>>>>>> So try the simple file mover without routingslip to see the file is
>>>>>> moved. Then we now Camel is running and it can do something. Then we
>>>>>> can address the routing slip issues afterwards
>>>>>>
>>>>>> When you copy a file in that folder, is it picked up by Camel, such as
>>>>>> it will delete it after processing?
>>>>>>
>>>>>> In you case you are missing to parse the input file and set the header
>>>>>> for the routing slip.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
>>>>>> <ka...@progress.com> wrote:
>>>>>>>
>>>>>>> hi
>>>>>>> I tried with file endpoints but it doesnt work.i am trying resolve
>>>>>>> the
>>>>>>> problem but I am not able to do
>>>>>>>
>>>>>>>
>>>>>>> this is camel xml
>>>>>>> <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-2.0.xsd
>>>>>>> http://activemq.apache.org/camel/schema/spring
>>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
>>>>>>> id="camelroute"
>>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>>    <from
>>>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>>>> id="Camel_File_2"/>
>>>>>>>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>>>>>>> id="Camel_RoutingSlip_4"/>
>>>>>>> </route>
>>>>>>> </camelContext></beans>
>>>>>>>
>>>>>>> and input file
>>>>>>>
>>>>>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>>>>>> <content>
>>>>>>>    <entry type="1">
>>>>>>>        <textMessage JMSCorrelationID=""
>>>>>>> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
>>>>>>> JMSDeliveryMode="2" JMSExpiration="0"
>>>>>>> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
>>>>>>> JMSPriority="1"
>>>>>>> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>>>>>>>            <text>1</text>
>>>>>>>        </textMessage>
>>>>>>>    </entry>
>>>>>>> </content>
>>>>>>>
>>>>>>>
>>>>>>> Could you please check this and let me know any wrong in configuring.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Claus Ibsen-2 wrote:
>>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> That is a bit odd. I added a JMS sample:
>>>>>>>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>>>>>>>
>>>>>>>> Can you try with other kind of endpoints/transport to see if you for
>>>>>>>> instance can get a file mover working?
>>>>>>>>
>>>>>>>> <from uri="file://inbox"/>
>>>>>>>> <to uri="file://outbox"/>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota
>>>>>>>> <ka...@progress.com>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> thanks for ur quick response.Ya I have read the link mentioned in
>>>>>>>>> wiki.Still
>>>>>>>>> I am getting same problem that i have mentioned earlier.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Karuna Arshakota wrote:
>>>>>>>>>>
>>>>>>>>>> hi,
>>>>>>>>>>   I am new to Camel and found very interesting to work with
>>>>>>>>>> patterns.I
>>>>>>>>>> am
>>>>>>>>>> trying different patterns but struck at routing slip pattern.I am
>>>>>>>>>> using
>>>>>>>>>> camel 1.4.
>>>>>>>>>>
>>>>>>>>>> Please find that attached camel xml and input xml which am sending
>>>>>>>>>> this
>>>>>>>>>> through an endpoint('somequeue')
>>>>>>>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>>>>>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>>>>>>>> camel-debugger-tmp6214.xml
>>>>>>>>>>
>>>>>>>>>> First time i got a message to the 'output' endpoint(URI) but when
>>>>>>>>>> I
>>>>>>>>>> ran
>>>>>>>>>> after that many times but no message were coming to the mentioned
>>>>>>>>>> URIs.I
>>>>>>>>>> am expecting the message should come to all URIs that i mentioned
>>>>>>>>>> in
>>>>>>>>>> the
>>>>>>>>>> input xml (myqueue and output).Am I correct? Could you please
>>>>>>>>>> explain
>>>>>>>>>> the
>>>>>>>>>> functionality of routing slip and explain me how can i really use
>>>>>>>>>> it.
>>>>>>>>>> Thanks for all ur help in Advance
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> /Claus Ibsen
>>>>>>>> Apache Camel Committer
>>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> /Claus Ibsen
>>>>>> Apache Camel Committer
>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>
>>>>>>
>>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>>> RoutingSlipfile.xml
>>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>>> RoutingSlipfile.xml
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346200.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> /Claus Ibsen
>>>> Apache Camel Committer
>>>> Blog: http://davsclaus.blogspot.com/
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346350.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
>
> --
> View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21350224.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Re: configure routing slip

Posted by Karuna Arshakota <ka...@progress.com>.
Hi
  I tried like as you said but still am not able to route the message to
particular destination.I tried with file target and jms endpoints also.

see the camel xml and class

<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-2.0.xsd
http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
	<import
resource="file:///D:\Eclipse3.4.1\runtime-New_configuration1\ABC\src\main\java\org\apache\camel\processor\routingslip\Callthis.xml"
/> "import bean xml here"
	<camelContext id="camelroute"
		xmlns="http://activemq.apache.org/camel/schema/spring">
		<route xmlns="http://activemq.apache.org/camel/schema/spring">
			<from
			
uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick/Header.xml?autoCreate=false&amp;lock=false"
				id="Camel_File_2" />
			<process ref="mySetHeaderProcessor"></process>
			<convertBodyTo type="java.lang.String"></convertBodyTo>
			<routingSlip uriDelimiter="#" headerName="routingSlipHeader"
				id="Camel_RoutingSlip_4" />
		</route>
	</camelContext>
</beans>

class:
public class MySetHeaderProcessor implements Processor {

	public void process(Exchange exchange) throws Exception {
		// TODO Auto-generated method stub
        System.out.println("***Before Setting********");
		exchange.getIn().setHeader("routingSlipHeader",
"file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop"); 
        System.out.println("******After setting*****");
	  	 
	}
}

When i ran this i got output saying
***Before Setting********
******After setting*****
But no message was coming to
"file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop" location.
If I set something like below in the class

exchange.getIn().setHeader("routingSlipHeader", "jms:queue:myqueue"); 

"cant convert org.apache.camel.DefaultMessage to
org.apache.camel.JMSMessage"

Could you plz help me.....



Claus Ibsen-2 wrote:
> 
> Hi
> 
> Ah <constant> was added in Camel 1.5.0 I think, so if you are running
> on an older release its not there.
> 
> You can add the header from Java code. You can use a <process
> ref="mySetHeaderProcessor"/>
> And then add a spring bean with this id
> 
> <bean id="mySetHeaderProcessor"
> class="com.mycompany.MySetHeaderProcessor"/>
> 
> And then create a class with this name
> com.mycompany.MySetHeaderProcessor that implements the
> org.apache.camel.Processor interface.
> 
> In there you can do:
> 
> exchange.getIn().setHeader("routingSlipHeader", "and here the file
> target"/>
> 
> 
> On Thu, Jan 8, 2009 at 6:58 AM, Karuna Arshakota <ka...@progress.com>
> wrote:
>>
>> hi
>> I have set as u have mentioned but when i ran camel xml it it throwing
>> exception saying
>>  "cvc-complex-type.2.4.a: Invalid content was found starting with element
>> 'constant"
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> You should use <constant> for constant expressions.
>>>
>>>                         <setHeader headerName="routingSlipHeader">
>>>
>>> <constant>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</constant>
>>>                         </setHeader>
>>>
>>>
>>> On Thu, Jan 8, 2009 at 6:40 AM, Karuna Arshakota <ka...@progress.com>
>>> wrote:
>>>>
>>>> hi
>>>>  I am sure that camel is running on my machine.I tried some thing like
>>>> this.I am trying to send input file to which am setting some header to
>>>> it
>>>> from camel xml.But the problem is while running the camel it throwing
>>>> exception as mentioned below and also find camel xml.
>>>>
>>>> .............
>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>                        <from
>>>>
>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>                                id="Camel_File_2" />
>>>>                        <setHeader headerName="routingSlipHeader">
>>>>
>>>> <simple>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</simple>
>>>>                        </setHeader>
>>>>                        <routingSlip uriDelimiter="#"
>>>> headerName="routingSlipHeader"
>>>>                                id="Camel_RoutingSlip_4" />
>>>>                </route>
>>>> ...............
>>>>
>>>> Exception:
>>>>
>>>> org.apache.camel.language.IllegalSyntaxException: Illegal syntax for
>>>> language: org.apache.camel.language.simple.SimpleLanguage@1f6f27b.
>>>> Expression:
>>>> file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target
>>>>        at
>>>> org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:139)
>>>>        at
>>>> org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:61)
>>>>        at
>>>> org.apache.camel.model.language.ExpressionType.createExpression(ExpressionType.java:141)
>>>>        at
>>>> org.apache.camel.model.SetHeaderType.createProcessor(SetHeaderType.java:75)
>>>>        at
>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:1635)
>>>>        at
>>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:95)
>>>>        at
>>>> org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
>>>>        at
>>>> org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1519)
>>>>        at
>>>> org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:99)
>>>>        at
>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:221)
>>>>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
>>>>        at
>>>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
>>>>        at
>>>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
>>>>        at
>>>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
>>>>        at
>>>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>>>>        at
>>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>>>>        at
>>>> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>>>>        at
>>>> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>>>>        at
>>>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>>>>        at
>>>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
>>>>        at
>>>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
>>>>        at
>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
>>>>        at
>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
>>>>        at
>>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:106)
>>>>        at
>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.doLaunchDebuggedContext(CamelStandinRuntime.java:177)
>>>>        at
>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.init(CamelStandinRuntime.java:131)
>>>>        at
>>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.main(CamelStandinRuntime.java:104)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> We have to step back a bit on the routing slip to see that you can run
>>>>> camel and it can do something.
>>>>> So try the simple file mover without routingslip to see the file is
>>>>> moved. Then we now Camel is running and it can do something. Then we
>>>>> can address the routing slip issues afterwards
>>>>>
>>>>> When you copy a file in that folder, is it picked up by Camel, such as
>>>>> it will delete it after processing?
>>>>>
>>>>> In you case you are missing to parse the input file and set the header
>>>>> for the routing slip.
>>>>>
>>>>>
>>>>>
>>>>> Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
>>>>> <ka...@progress.com> wrote:
>>>>>>
>>>>>> hi
>>>>>> I tried with file endpoints but it doesnt work.i am trying resolve
>>>>>> the
>>>>>> problem but I am not able to do
>>>>>>
>>>>>>
>>>>>> this is camel xml
>>>>>> <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-2.0.xsd
>>>>>> http://activemq.apache.org/camel/schema/spring
>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
>>>>>> id="camelroute"
>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>    <from
>>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>>> id="Camel_File_2"/>
>>>>>>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>>>>>> id="Camel_RoutingSlip_4"/>
>>>>>> </route>
>>>>>> </camelContext></beans>
>>>>>>
>>>>>> and input file
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>>>>> <content>
>>>>>>    <entry type="1">
>>>>>>        <textMessage JMSCorrelationID=""
>>>>>> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
>>>>>> JMSDeliveryMode="2" JMSExpiration="0"
>>>>>> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
>>>>>> JMSPriority="1"
>>>>>> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>>>>>>            <text>1</text>
>>>>>>        </textMessage>
>>>>>>    </entry>
>>>>>> </content>
>>>>>>
>>>>>>
>>>>>> Could you please check this and let me know any wrong in configuring.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Claus Ibsen-2 wrote:
>>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> That is a bit odd. I added a JMS sample:
>>>>>>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>>>>>>
>>>>>>> Can you try with other kind of endpoints/transport to see if you for
>>>>>>> instance can get a file mover working?
>>>>>>>
>>>>>>> <from uri="file://inbox"/>
>>>>>>> <to uri="file://outbox"/>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota
>>>>>>> <ka...@progress.com>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> thanks for ur quick response.Ya I have read the link mentioned in
>>>>>>>> wiki.Still
>>>>>>>> I am getting same problem that i have mentioned earlier.
>>>>>>>>
>>>>>>>>
>>>>>>>> Karuna Arshakota wrote:
>>>>>>>>>
>>>>>>>>> hi,
>>>>>>>>>   I am new to Camel and found very interesting to work with
>>>>>>>>> patterns.I
>>>>>>>>> am
>>>>>>>>> trying different patterns but struck at routing slip pattern.I am
>>>>>>>>> using
>>>>>>>>> camel 1.4.
>>>>>>>>>
>>>>>>>>> Please find that attached camel xml and input xml which am sending
>>>>>>>>> this
>>>>>>>>> through an endpoint('somequeue')
>>>>>>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>>>>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>>>>>>> camel-debugger-tmp6214.xml
>>>>>>>>>
>>>>>>>>> First time i got a message to the 'output' endpoint(URI) but when
>>>>>>>>> I
>>>>>>>>> ran
>>>>>>>>> after that many times but no message were coming to the mentioned
>>>>>>>>> URIs.I
>>>>>>>>> am expecting the message should come to all URIs that i mentioned
>>>>>>>>> in
>>>>>>>>> the
>>>>>>>>> input xml (myqueue and output).Am I correct? Could you please
>>>>>>>>> explain
>>>>>>>>> the
>>>>>>>>> functionality of routing slip and explain me how can i really use
>>>>>>>>> it.
>>>>>>>>> Thanks for all ur help in Advance
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> /Claus Ibsen
>>>>>>> Apache Camel Committer
>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> /Claus Ibsen
>>>>> Apache Camel Committer
>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>
>>>>>
>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>> RoutingSlipfile.xml
>>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>>> RoutingSlipfile.xml
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346200.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> /Claus Ibsen
>>> Apache Camel Committer
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346350.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21350224.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: configure routing slip

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah <constant> was added in Camel 1.5.0 I think, so if you are running
on an older release its not there.

You can add the header from Java code. You can use a <process
ref="mySetHeaderProcessor"/>
And then add a spring bean with this id

<bean id="mySetHeaderProcessor" class="com.mycompany.MySetHeaderProcessor"/>

And then create a class with this name
com.mycompany.MySetHeaderProcessor that implements the
org.apache.camel.Processor interface.

In there you can do:

exchange.getIn().setHeader("routingSlipHeader", "and here the file target"/>


On Thu, Jan 8, 2009 at 6:58 AM, Karuna Arshakota <ka...@progress.com> wrote:
>
> hi
> I have set as u have mentioned but when i ran camel xml it it throwing
> exception saying
>  "cvc-complex-type.2.4.a: Invalid content was found starting with element
> 'constant"
>
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> You should use <constant> for constant expressions.
>>
>>                         <setHeader headerName="routingSlipHeader">
>>
>> <constant>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</constant>
>>                         </setHeader>
>>
>>
>> On Thu, Jan 8, 2009 at 6:40 AM, Karuna Arshakota <ka...@progress.com>
>> wrote:
>>>
>>> hi
>>>  I am sure that camel is running on my machine.I tried some thing like
>>> this.I am trying to send input file to which am setting some header to it
>>> from camel xml.But the problem is while running the camel it throwing
>>> exception as mentioned below and also find camel xml.
>>>
>>> .............
>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>                        <from
>>>
>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>                                id="Camel_File_2" />
>>>                        <setHeader headerName="routingSlipHeader">
>>>
>>> <simple>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</simple>
>>>                        </setHeader>
>>>                        <routingSlip uriDelimiter="#"
>>> headerName="routingSlipHeader"
>>>                                id="Camel_RoutingSlip_4" />
>>>                </route>
>>> ...............
>>>
>>> Exception:
>>>
>>> org.apache.camel.language.IllegalSyntaxException: Illegal syntax for
>>> language: org.apache.camel.language.simple.SimpleLanguage@1f6f27b.
>>> Expression:
>>> file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target
>>>        at
>>> org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:139)
>>>        at
>>> org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:61)
>>>        at
>>> org.apache.camel.model.language.ExpressionType.createExpression(ExpressionType.java:141)
>>>        at
>>> org.apache.camel.model.SetHeaderType.createProcessor(SetHeaderType.java:75)
>>>        at
>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:1635)
>>>        at
>>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:95)
>>>        at
>>> org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
>>>        at
>>> org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1519)
>>>        at
>>> org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:99)
>>>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:221)
>>>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
>>>        at
>>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
>>>        at
>>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
>>>        at
>>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
>>>        at
>>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>>>        at
>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>>>        at
>>> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>>>        at
>>> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>>>        at
>>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>>>        at
>>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
>>>        at
>>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
>>>        at
>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
>>>        at
>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
>>>        at
>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:106)
>>>        at
>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.doLaunchDebuggedContext(CamelStandinRuntime.java:177)
>>>        at
>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.init(CamelStandinRuntime.java:131)
>>>        at
>>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.main(CamelStandinRuntime.java:104)
>>>
>>>
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> Hi
>>>>
>>>> We have to step back a bit on the routing slip to see that you can run
>>>> camel and it can do something.
>>>> So try the simple file mover without routingslip to see the file is
>>>> moved. Then we now Camel is running and it can do something. Then we
>>>> can address the routing slip issues afterwards
>>>>
>>>> When you copy a file in that folder, is it picked up by Camel, such as
>>>> it will delete it after processing?
>>>>
>>>> In you case you are missing to parse the input file and set the header
>>>> for the routing slip.
>>>>
>>>>
>>>>
>>>> Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
>>>> <ka...@progress.com> wrote:
>>>>>
>>>>> hi
>>>>> I tried with file endpoints but it doesnt work.i am trying resolve the
>>>>> problem but I am not able to do
>>>>>
>>>>>
>>>>> this is camel xml
>>>>> <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-2.0.xsd
>>>>> http://activemq.apache.org/camel/schema/spring
>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
>>>>> id="camelroute" xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>    <from
>>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>>> id="Camel_File_2"/>
>>>>>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>>>>> id="Camel_RoutingSlip_4"/>
>>>>> </route>
>>>>> </camelContext></beans>
>>>>>
>>>>> and input file
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>>>> <content>
>>>>>    <entry type="1">
>>>>>        <textMessage JMSCorrelationID=""
>>>>> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
>>>>> JMSDeliveryMode="2" JMSExpiration="0"
>>>>> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
>>>>> JMSPriority="1"
>>>>> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>>>>>            <text>1</text>
>>>>>        </textMessage>
>>>>>    </entry>
>>>>> </content>
>>>>>
>>>>>
>>>>> Could you please check this and let me know any wrong in configuring.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Claus Ibsen-2 wrote:
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>> That is a bit odd. I added a JMS sample:
>>>>>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>>>>>
>>>>>> Can you try with other kind of endpoints/transport to see if you for
>>>>>> instance can get a file mover working?
>>>>>>
>>>>>> <from uri="file://inbox"/>
>>>>>> <to uri="file://outbox"/>
>>>>>>
>>>>>>
>>>>>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota
>>>>>> <ka...@progress.com>
>>>>>> wrote:
>>>>>>>
>>>>>>> thanks for ur quick response.Ya I have read the link mentioned in
>>>>>>> wiki.Still
>>>>>>> I am getting same problem that i have mentioned earlier.
>>>>>>>
>>>>>>>
>>>>>>> Karuna Arshakota wrote:
>>>>>>>>
>>>>>>>> hi,
>>>>>>>>   I am new to Camel and found very interesting to work with
>>>>>>>> patterns.I
>>>>>>>> am
>>>>>>>> trying different patterns but struck at routing slip pattern.I am
>>>>>>>> using
>>>>>>>> camel 1.4.
>>>>>>>>
>>>>>>>> Please find that attached camel xml and input xml which am sending
>>>>>>>> this
>>>>>>>> through an endpoint('somequeue')
>>>>>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>>>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>>>>>> camel-debugger-tmp6214.xml
>>>>>>>>
>>>>>>>> First time i got a message to the 'output' endpoint(URI) but when I
>>>>>>>> ran
>>>>>>>> after that many times but no message were coming to the mentioned
>>>>>>>> URIs.I
>>>>>>>> am expecting the message should come to all URIs that i mentioned in
>>>>>>>> the
>>>>>>>> input xml (myqueue and output).Am I correct? Could you please
>>>>>>>> explain
>>>>>>>> the
>>>>>>>> functionality of routing slip and explain me how can i really use
>>>>>>>> it.
>>>>>>>> Thanks for all ur help in Advance
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> /Claus Ibsen
>>>>>> Apache Camel Committer
>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> /Claus Ibsen
>>>> Apache Camel Committer
>>>> Blog: http://davsclaus.blogspot.com/
>>>>
>>>>
>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>> RoutingSlipfile.xml
>>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>>> RoutingSlipfile.xml
>>> --
>>> View this message in context:
>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346200.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
>
> --
> View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346350.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Re: configure routing slip

Posted by Karuna Arshakota <ka...@progress.com>.
hi
I have set as u have mentioned but when i ran camel xml it it throwing
exception saying
 "cvc-complex-type.2.4.a: Invalid content was found starting with element
'constant"



Claus Ibsen-2 wrote:
> 
> Hi
> 
> You should use <constant> for constant expressions.
> 
>                         <setHeader headerName="routingSlipHeader">
> 
> <constant>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</constant>
>                         </setHeader>
> 
> 
> On Thu, Jan 8, 2009 at 6:40 AM, Karuna Arshakota <ka...@progress.com>
> wrote:
>>
>> hi
>>  I am sure that camel is running on my machine.I tried some thing like
>> this.I am trying to send input file to which am setting some header to it
>> from camel xml.But the problem is while running the camel it throwing
>> exception as mentioned below and also find camel xml.
>>
>> .............
>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>                        <from
>>
>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>                                id="Camel_File_2" />
>>                        <setHeader headerName="routingSlipHeader">
>>
>> <simple>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</simple>
>>                        </setHeader>
>>                        <routingSlip uriDelimiter="#"
>> headerName="routingSlipHeader"
>>                                id="Camel_RoutingSlip_4" />
>>                </route>
>> ...............
>>
>> Exception:
>>
>> org.apache.camel.language.IllegalSyntaxException: Illegal syntax for
>> language: org.apache.camel.language.simple.SimpleLanguage@1f6f27b.
>> Expression:
>> file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target
>>        at
>> org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:139)
>>        at
>> org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:61)
>>        at
>> org.apache.camel.model.language.ExpressionType.createExpression(ExpressionType.java:141)
>>        at
>> org.apache.camel.model.SetHeaderType.createProcessor(SetHeaderType.java:75)
>>        at
>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:1635)
>>        at
>> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:95)
>>        at
>> org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
>>        at
>> org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1519)
>>        at
>> org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:99)
>>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:221)
>>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
>>        at
>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
>>        at
>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>>        at
>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>>        at
>> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>>        at
>> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>>        at
>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>>        at
>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
>>        at
>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
>>        at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
>>        at
>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
>>        at
>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:106)
>>        at
>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.doLaunchDebuggedContext(CamelStandinRuntime.java:177)
>>        at
>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.init(CamelStandinRuntime.java:131)
>>        at
>> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.main(CamelStandinRuntime.java:104)
>>
>>
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> We have to step back a bit on the routing slip to see that you can run
>>> camel and it can do something.
>>> So try the simple file mover without routingslip to see the file is
>>> moved. Then we now Camel is running and it can do something. Then we
>>> can address the routing slip issues afterwards
>>>
>>> When you copy a file in that folder, is it picked up by Camel, such as
>>> it will delete it after processing?
>>>
>>> In you case you are missing to parse the input file and set the header
>>> for the routing slip.
>>>
>>>
>>>
>>> Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
>>> <ka...@progress.com> wrote:
>>>>
>>>> hi
>>>> I tried with file endpoints but it doesnt work.i am trying resolve the
>>>> problem but I am not able to do
>>>>
>>>>
>>>> this is camel xml
>>>> <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-2.0.xsd
>>>> http://activemq.apache.org/camel/schema/spring
>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
>>>> id="camelroute" xmlns="http://activemq.apache.org/camel/schema/spring">
>>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>    <from
>>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>>> id="Camel_File_2"/>
>>>>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>>>> id="Camel_RoutingSlip_4"/>
>>>> </route>
>>>> </camelContext></beans>
>>>>
>>>> and input file
>>>>
>>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>>> <content>
>>>>    <entry type="1">
>>>>        <textMessage JMSCorrelationID=""
>>>> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
>>>> JMSDeliveryMode="2" JMSExpiration="0"
>>>> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
>>>> JMSPriority="1"
>>>> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>>>>            <text>1</text>
>>>>        </textMessage>
>>>>    </entry>
>>>> </content>
>>>>
>>>>
>>>> Could you please check this and let me know any wrong in configuring.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> That is a bit odd. I added a JMS sample:
>>>>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>>>>
>>>>> Can you try with other kind of endpoints/transport to see if you for
>>>>> instance can get a file mover working?
>>>>>
>>>>> <from uri="file://inbox"/>
>>>>> <to uri="file://outbox"/>
>>>>>
>>>>>
>>>>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota
>>>>> <ka...@progress.com>
>>>>> wrote:
>>>>>>
>>>>>> thanks for ur quick response.Ya I have read the link mentioned in
>>>>>> wiki.Still
>>>>>> I am getting same problem that i have mentioned earlier.
>>>>>>
>>>>>>
>>>>>> Karuna Arshakota wrote:
>>>>>>>
>>>>>>> hi,
>>>>>>>   I am new to Camel and found very interesting to work with
>>>>>>> patterns.I
>>>>>>> am
>>>>>>> trying different patterns but struck at routing slip pattern.I am
>>>>>>> using
>>>>>>> camel 1.4.
>>>>>>>
>>>>>>> Please find that attached camel xml and input xml which am sending
>>>>>>> this
>>>>>>> through an endpoint('somequeue')
>>>>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>>>>> camel-debugger-tmp6214.xml
>>>>>>>
>>>>>>> First time i got a message to the 'output' endpoint(URI) but when I
>>>>>>> ran
>>>>>>> after that many times but no message were coming to the mentioned
>>>>>>> URIs.I
>>>>>>> am expecting the message should come to all URIs that i mentioned in
>>>>>>> the
>>>>>>> input xml (myqueue and output).Am I correct? Could you please
>>>>>>> explain
>>>>>>> the
>>>>>>> functionality of routing slip and explain me how can i really use
>>>>>>> it.
>>>>>>> Thanks for all ur help in Advance
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> /Claus Ibsen
>>>>> Apache Camel Committer
>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> /Claus Ibsen
>>> Apache Camel Committer
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>>
>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>> RoutingSlipfile.xml
>> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml
>> RoutingSlipfile.xml
>> --
>> View this message in context:
>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346200.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346350.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: configure routing slip

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You should use <constant> for constant expressions.

                        <setHeader headerName="routingSlipHeader">
 <constant>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</constant>
                        </setHeader>


On Thu, Jan 8, 2009 at 6:40 AM, Karuna Arshakota <ka...@progress.com> wrote:
>
> hi
>  I am sure that camel is running on my machine.I tried some thing like
> this.I am trying to send input file to which am setting some header to it
> from camel xml.But the problem is while running the camel it throwing
> exception as mentioned below and also find camel xml.
>
> .............
> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>                        <from
>
> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>                                id="Camel_File_2" />
>                        <setHeader headerName="routingSlipHeader">
>
> <simple>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</simple>
>                        </setHeader>
>                        <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>                                id="Camel_RoutingSlip_4" />
>                </route>
> ...............
>
> Exception:
>
> org.apache.camel.language.IllegalSyntaxException: Illegal syntax for
> language: org.apache.camel.language.simple.SimpleLanguage@1f6f27b.
> Expression:
> file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target
>        at
> org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:139)
>        at
> org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:61)
>        at
> org.apache.camel.model.language.ExpressionType.createExpression(ExpressionType.java:141)
>        at
> org.apache.camel.model.SetHeaderType.createProcessor(SetHeaderType.java:75)
>        at
> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:1635)
>        at
> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:95)
>        at
> org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
>        at
> org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1519)
>        at org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:99)
>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:221)
>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
>        at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
>        at
> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
>        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>        at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>        at
> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>        at
> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>        at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>        at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
>        at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
>        at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
>        at
> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
>        at
> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:106)
>        at
> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.doLaunchDebuggedContext(CamelStandinRuntime.java:177)
>        at
> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.init(CamelStandinRuntime.java:131)
>        at
> com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.main(CamelStandinRuntime.java:104)
>
>
>
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> We have to step back a bit on the routing slip to see that you can run
>> camel and it can do something.
>> So try the simple file mover without routingslip to see the file is
>> moved. Then we now Camel is running and it can do something. Then we
>> can address the routing slip issues afterwards
>>
>> When you copy a file in that folder, is it picked up by Camel, such as
>> it will delete it after processing?
>>
>> In you case you are missing to parse the input file and set the header
>> for the routing slip.
>>
>>
>>
>> Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
>> <ka...@progress.com> wrote:
>>>
>>> hi
>>> I tried with file endpoints but it doesnt work.i am trying resolve the
>>> problem but I am not able to do
>>>
>>>
>>> this is camel xml
>>> <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-2.0.xsd
>>> http://activemq.apache.org/camel/schema/spring
>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
>>> id="camelroute" xmlns="http://activemq.apache.org/camel/schema/spring">
>>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>>    <from
>>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>>> id="Camel_File_2"/>
>>>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>>> id="Camel_RoutingSlip_4"/>
>>> </route>
>>> </camelContext></beans>
>>>
>>> and input file
>>>
>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>> <content>
>>>    <entry type="1">
>>>        <textMessage JMSCorrelationID=""
>>> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
>>> JMSDeliveryMode="2" JMSExpiration="0"
>>> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
>>> JMSPriority="1"
>>> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>>>            <text>1</text>
>>>        </textMessage>
>>>    </entry>
>>> </content>
>>>
>>>
>>> Could you please check this and let me know any wrong in configuring.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> Hi
>>>>
>>>> That is a bit odd. I added a JMS sample:
>>>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>>>
>>>> Can you try with other kind of endpoints/transport to see if you for
>>>> instance can get a file mover working?
>>>>
>>>> <from uri="file://inbox"/>
>>>> <to uri="file://outbox"/>
>>>>
>>>>
>>>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota <ka...@progress.com>
>>>> wrote:
>>>>>
>>>>> thanks for ur quick response.Ya I have read the link mentioned in
>>>>> wiki.Still
>>>>> I am getting same problem that i have mentioned earlier.
>>>>>
>>>>>
>>>>> Karuna Arshakota wrote:
>>>>>>
>>>>>> hi,
>>>>>>   I am new to Camel and found very interesting to work with patterns.I
>>>>>> am
>>>>>> trying different patterns but struck at routing slip pattern.I am
>>>>>> using
>>>>>> camel 1.4.
>>>>>>
>>>>>> Please find that attached camel xml and input xml which am sending
>>>>>> this
>>>>>> through an endpoint('somequeue')
>>>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>>>> camel-debugger-tmp6214.xml
>>>>>>
>>>>>> First time i got a message to the 'output' endpoint(URI) but when I
>>>>>> ran
>>>>>> after that many times but no message were coming to the mentioned
>>>>>> URIs.I
>>>>>> am expecting the message should come to all URIs that i mentioned in
>>>>>> the
>>>>>> input xml (myqueue and output).Am I correct? Could you please explain
>>>>>> the
>>>>>> functionality of routing slip and explain me how can i really use it.
>>>>>> Thanks for all ur help in Advance
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> /Claus Ibsen
>>>> Apache Camel Committer
>>>> Blog: http://davsclaus.blogspot.com/
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml RoutingSlipfile.xml
> http://www.nabble.com/file/p21346200/RoutingSlipfile.xml RoutingSlipfile.xml
> --
> View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346200.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Re: configure routing slip

Posted by Karuna Arshakota <ka...@progress.com>.
hi
  I am sure that camel is running on my machine.I tried some thing like
this.I am trying to send input file to which am setting some header to it
from camel xml.But the problem is while running the camel it throwing
exception as mentioned below and also find camel xml. 

.............
<route xmlns="http://activemq.apache.org/camel/schema/spring">
			<from
			
uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
				id="Camel_File_2" />
			<setHeader headerName="routingSlipHeader">
			
<simple>file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target</simple>
			</setHeader>
			<routingSlip uriDelimiter="#" headerName="routingSlipHeader"
				id="Camel_RoutingSlip_4" />
		</route>
...............

Exception:

org.apache.camel.language.IllegalSyntaxException: Illegal syntax for
language: org.apache.camel.language.simple.SimpleLanguage@1f6f27b.
Expression:
file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/target
	at
org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:139)
	at
org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:61)
	at
org.apache.camel.model.language.ExpressionType.createExpression(ExpressionType.java:141)
	at
org.apache.camel.model.SetHeaderType.createProcessor(SetHeaderType.java:75)
	at
org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:1635)
	at
org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:95)
	at
org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
	at
org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1519)
	at org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:99)
	at org.apache.camel.model.RouteType.addRoutes(RouteType.java:221)
	at org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
	at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:520)
	at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:512)
	at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
	at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
	at
org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
	at
org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
	at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
	at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
	at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
	at
org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
	at
org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:106)
	at
com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.doLaunchDebuggedContext(CamelStandinRuntime.java:177)
	at
com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.init(CamelStandinRuntime.java:131)
	at
com.iona.eitools.grinder.debugger.camel.scaffolded.CamelStandinRuntime.main(CamelStandinRuntime.java:104)





Claus Ibsen-2 wrote:
> 
> Hi
> 
> We have to step back a bit on the routing slip to see that you can run
> camel and it can do something.
> So try the simple file mover without routingslip to see the file is
> moved. Then we now Camel is running and it can do something. Then we
> can address the routing slip issues afterwards
> 
> When you copy a file in that folder, is it picked up by Camel, such as
> it will delete it after processing?
> 
> In you case you are missing to parse the input file and set the header
> for the routing slip.
> 
> 
> 
> Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
> <ka...@progress.com> wrote:
>>
>> hi
>> I tried with file endpoints but it doesnt work.i am trying resolve the
>> problem but I am not able to do
>>
>>
>> this is camel xml
>> <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-2.0.xsd
>> http://activemq.apache.org/camel/schema/spring
>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
>> id="camelroute" xmlns="http://activemq.apache.org/camel/schema/spring">
>> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>>    <from
>> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
>> id="Camel_File_2"/>
>>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
>> id="Camel_RoutingSlip_4"/>
>> </route>
>> </camelContext></beans>
>>
>> and input file
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> <content>
>>    <entry type="1">
>>        <textMessage JMSCorrelationID=""
>> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
>> JMSDeliveryMode="2" JMSExpiration="0"
>> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1"
>> JMSPriority="1"
>> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>>            <text>1</text>
>>        </textMessage>
>>    </entry>
>> </content>
>>
>>
>> Could you please check this and let me know any wrong in configuring.
>>
>>
>>
>>
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> That is a bit odd. I added a JMS sample:
>>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>>
>>> Can you try with other kind of endpoints/transport to see if you for
>>> instance can get a file mover working?
>>>
>>> <from uri="file://inbox"/>
>>> <to uri="file://outbox"/>
>>>
>>>
>>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota <ka...@progress.com>
>>> wrote:
>>>>
>>>> thanks for ur quick response.Ya I have read the link mentioned in
>>>> wiki.Still
>>>> I am getting same problem that i have mentioned earlier.
>>>>
>>>>
>>>> Karuna Arshakota wrote:
>>>>>
>>>>> hi,
>>>>>   I am new to Camel and found very interesting to work with patterns.I
>>>>> am
>>>>> trying different patterns but struck at routing slip pattern.I am
>>>>> using
>>>>> camel 1.4.
>>>>>
>>>>> Please find that attached camel xml and input xml which am sending
>>>>> this
>>>>> through an endpoint('somequeue')
>>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>>> camel-debugger-tmp6214.xml
>>>>>
>>>>> First time i got a message to the 'output' endpoint(URI) but when I
>>>>> ran
>>>>> after that many times but no message were coming to the mentioned
>>>>> URIs.I
>>>>> am expecting the message should come to all URIs that i mentioned in
>>>>> the
>>>>> input xml (myqueue and output).Am I correct? Could you please explain
>>>>> the
>>>>> functionality of routing slip and explain me how can i really use it.
>>>>> Thanks for all ur help in Advance
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> /Claus Ibsen
>>> Apache Camel Committer
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 
http://www.nabble.com/file/p21346200/RoutingSlipfile.xml RoutingSlipfile.xml 
http://www.nabble.com/file/p21346200/RoutingSlipfile.xml RoutingSlipfile.xml 
-- 
View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21346200.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: configure routing slip

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

We have to step back a bit on the routing slip to see that you can run
camel and it can do something.
So try the simple file mover without routingslip to see the file is
moved. Then we now Camel is running and it can do something. Then we
can address the routing slip issues afterwards

When you copy a file in that folder, is it picked up by Camel, such as
it will delete it after processing?

In you case you are missing to parse the input file and set the header
for the routing slip.



Does the On Wed, Jan 7, 2009 at 12:18 PM, Karuna Arshakota
<ka...@progress.com> wrote:
>
> hi
> I tried with file endpoints but it doesnt work.i am trying resolve the
> problem but I am not able to do
>
>
> this is camel xml
> <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-2.0.xsd
> http://activemq.apache.org/camel/schema/spring
> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
> id="camelroute" xmlns="http://activemq.apache.org/camel/schema/spring">
> <route xmlns="http://activemq.apache.org/camel/schema/spring">
>    <from
> uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
> id="Camel_File_2"/>
>    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
> id="Camel_RoutingSlip_4"/>
> </route>
> </camelContext></beans>
>
> and input file
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <content>
>    <entry type="1">
>        <textMessage JMSCorrelationID=""
> routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
> JMSDeliveryMode="2" JMSExpiration="0"
> JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1" JMSPriority="1"
> JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
>            <text>1</text>
>        </textMessage>
>    </entry>
> </content>
>
>
> Could you please check this and let me know any wrong in configuring.
>
>
>
>
>
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> That is a bit odd. I added a JMS sample:
>> http://svn.apache.org/viewvc?view=rev&revision=731874
>>
>> Can you try with other kind of endpoints/transport to see if you for
>> instance can get a file mover working?
>>
>> <from uri="file://inbox"/>
>> <to uri="file://outbox"/>
>>
>>
>> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota <ka...@progress.com>
>> wrote:
>>>
>>> thanks for ur quick response.Ya I have read the link mentioned in
>>> wiki.Still
>>> I am getting same problem that i have mentioned earlier.
>>>
>>>
>>> Karuna Arshakota wrote:
>>>>
>>>> hi,
>>>>   I am new to Camel and found very interesting to work with patterns.I
>>>> am
>>>> trying different patterns but struck at routing slip pattern.I am using
>>>> camel 1.4.
>>>>
>>>> Please find that attached camel xml and input xml which am sending this
>>>> through an endpoint('somequeue')
>>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>>> camel-debugger-tmp6214.xml
>>>>
>>>> First time i got a message to the 'output' endpoint(URI) but when I ran
>>>> after that many times but no message were coming to the mentioned URIs.I
>>>> am expecting the message should come to all URIs that i mentioned in the
>>>> input xml (myqueue and output).Am I correct? Could you please explain
>>>> the
>>>> functionality of routing slip and explain me how can i really use it.
>>>> Thanks for all ur help in Advance
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
>
> --
> View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Re: configure routing slip

Posted by Karuna Arshakota <ka...@progress.com>.
hi
I tried with file endpoints but it doesnt work.i am trying resolve the
problem but I am not able to do


this is camel xml
<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-2.0.xsd
http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"><camelContext
id="camelroute" xmlns="http://activemq.apache.org/camel/schema/spring">
<route xmlns="http://activemq.apache.org/camel/schema/spring">
    <from
uri="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/pick?autoCreate=false&amp;lock=false"
id="Camel_File_2"/>
    <routingSlip uriDelimiter="#" headerName="routingSlipHeader"
id="Camel_RoutingSlip_4"/>
</route>
</camelContext></beans>

and input file

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<content>
    <entry type="1">
        <textMessage JMSCorrelationID="" 
routingSlipHeader="file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/src/drop#file:///D:/Eclipse3.4.1/runtime-New_configuration1/ABC/target"
JMSDeliveryMode="2" JMSExpiration="0"
JMSMessageID="ID:nbkarshkoxp-1878-1230290090906-0:0:1:1:1" JMSPriority="1"
JMSRedelivered="true" JMSTimestamp="1230290093827" JMSType="">
            <text>1</text>
        </textMessage>
    </entry>
</content>


Could you please check this and let me know any wrong in configuring.







Claus Ibsen-2 wrote:
> 
> Hi
> 
> That is a bit odd. I added a JMS sample:
> http://svn.apache.org/viewvc?view=rev&revision=731874
> 
> Can you try with other kind of endpoints/transport to see if you for
> instance can get a file mover working?
> 
> <from uri="file://inbox"/>
> <to uri="file://outbox"/>
> 
> 
> On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota <ka...@progress.com>
> wrote:
>>
>> thanks for ur quick response.Ya I have read the link mentioned in
>> wiki.Still
>> I am getting same problem that i have mentioned earlier.
>>
>>
>> Karuna Arshakota wrote:
>>>
>>> hi,
>>>   I am new to Camel and found very interesting to work with patterns.I
>>> am
>>> trying different patterns but struck at routing slip pattern.I am using
>>> camel 1.4.
>>>
>>> Please find that attached camel xml and input xml which am sending this
>>> through an endpoint('somequeue')
>>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>>> camel-debugger-tmp6214.xml
>>>
>>> First time i got a message to the 'output' endpoint(URI) but when I ran
>>> after that many times but no message were coming to the mentioned URIs.I
>>> am expecting the message should come to all URIs that i mentioned in the
>>> input xml (myqueue and output).Am I correct? Could you please explain
>>> the
>>> functionality of routing slip and explain me how can i really use it.
>>> Thanks for all ur help in Advance
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21329355.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: configure routing slip

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

That is a bit odd. I added a JMS sample:
http://svn.apache.org/viewvc?view=rev&revision=731874

Can you try with other kind of endpoints/transport to see if you for
instance can get a file mover working?

<from uri="file://inbox"/>
<to uri="file://outbox"/>


On Wed, Jan 7, 2009 at 6:26 AM, Karuna Arshakota <ka...@progress.com> wrote:
>
> thanks for ur quick response.Ya I have read the link mentioned in wiki.Still
> I am getting same problem that i have mentioned earlier.
>
>
> Karuna Arshakota wrote:
>>
>> hi,
>>   I am new to Camel and found very interesting to work with patterns.I am
>> trying different patterns but struck at routing slip pattern.I am using
>> camel 1.4.
>>
>> Please find that attached camel xml and input xml which am sending this
>> through an endpoint('somequeue')
>>  http://www.nabble.com/file/p21305734/Header.xml Header.xml
>> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
>> camel-debugger-tmp6214.xml
>>
>> First time i got a message to the 'output' endpoint(URI) but when I ran
>> after that many times but no message were coming to the mentioned URIs.I
>> am expecting the message should come to all URIs that i mentioned in the
>> input xml (myqueue and output).Am I correct? Could you please explain the
>> functionality of routing slip and explain me how can i really use it.
>> Thanks for all ur help in Advance
>>
>>
>
> --
> View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Re: configure routing slip

Posted by Karuna Arshakota <ka...@progress.com>.
thanks for ur quick response.Ya I have read the link mentioned in wiki.Still
I am getting same problem that i have mentioned earlier.


Karuna Arshakota wrote:
> 
> hi,
>   I am new to Camel and found very interesting to work with patterns.I am
> trying different patterns but struck at routing slip pattern.I am using
> camel 1.4.
> 
> Please find that attached camel xml and input xml which am sending this
> through an endpoint('somequeue')
>  http://www.nabble.com/file/p21305734/Header.xml Header.xml 
> http://www.nabble.com/file/p21305734/camel-debugger-tmp6214.xml
> camel-debugger-tmp6214.xml 
> 
> First time i got a message to the 'output' endpoint(URI) but when I ran
> after that many times but no message were coming to the mentioned URIs.I
> am expecting the message should come to all URIs that i mentioned in the
> input xml (myqueue and output).Am I correct? Could you please explain the
> functionality of routing slip and explain me how can i really use it.
> Thanks for all ur help in Advance
> 
> 

-- 
View this message in context: http://www.nabble.com/configure-routing-slip-tp21305734s22882p21325171.html
Sent from the Camel - Users mailing list archive at Nabble.com.