Re: CXF Policy cannot be satisfied

2012-08-20 Thread Willem jiang
Hi,

It is more like CXF issue than an Camel issue.
It looks like there are some WS policy relate issue in you application.

Did you double check the WSDL and cxfEndpoint related configuration ?
Did you have chance to invoke the service by using normal CXF client ?

--  
Willem Jiang

FuseSource
Web: http://www.fusesource.com (http://www.fusesource.com/)
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: willemjiang



On Tuesday, August 21, 2012 at 3:29 AM, pberkman wrote:

> sorry for the newbie question, i'm getting the following from a basic
> producer using CXF within Camel... any hints would be greatly appreciated!
>  
>  
> org.apache.cxf.interceptor.Fault: None of the policy alternatives can be
> satisfied.
>  
> at
> org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:47)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:457)
> at
> org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:112)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
> at
> org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
> at
> org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:360)
> at
> org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:331)
> at
> org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:227)
> at
> org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:331)
> at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:186)
> at
> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:115)
> at
> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:119)
> at
> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:136)
> at
> org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:284)
> at
> org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:314)
> at com.nextgate.ms.MMTest.testMMOk(MMTest.java:71)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47)
> at org.junit.rules.RunRules.evaluate(RunRules.java:18)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
> org.apache.camel.CamelExecutionException: Exception occurred during
> execution on the exchange: Exchange[Message: [Body is null]]
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
> at
> org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1296)
> at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
> at sun.reflect.NativeMethodAccessorIm

Re: Content Based Router Query

2012-08-20 Thread Claus Ibsen
On Mon, Aug 20, 2012 at 7:01 PM, Taariq Levack  wrote:
> Hi
>
> Yes, the CBR is rightly based on content, I think you want the recipient list 
> [1].
>
> [1] http://camel.apache.org/recipient-list.html
>

Yes that is a good EIP. There is also some of the dynamic ones like
dynamic router, routing slip etc.


> Taariq
>
> On 20 Aug 2012, at 18:09, gilboy  wrote:
>
>> Hi
>>
>> The content based router does not appear to support the routing of a message
>> to a particular destination based on a call to an external API. The examples
>> I have looked at appear to support the routing of messages to a destination
>> based on the message content.
>>
>> In a nutshell, I want to use a Content Based Router were the destination is
>> determined by making a call to an API. In other words, the API will return
>> "PATH1", "PATH2" etc which map to different destinations
>>
>> Any help much appreciated
>>
>> Thanks
>> Joe
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Content-Based-Router-Query-tp5717722.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: File Component: Rename an existing file

2012-08-20 Thread Claus Ibsen
On Mon, Aug 20, 2012 at 7:39 PM, santoshjoshi
 wrote:
> Hi Claus,
>
> I made some changes to existing API (camel 2.8.7), as well as created some
> test cases for this feature.
> I want to contribute this to Apache Camel, It would be great if Apache Camel
> Team reviews the changes and provide valuable feedback/comments.
>
> could you please tell where and how should i post my files for Review.
>

Yeah as Christian mentioned a patch attached to the JIRA ticket.

You can read more about how to contribute here
http://camel.apache.org/contributing.html

Thanks for your contribution to the community.


> Regards
> Santosh
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/File-Component-Rename-an-existing-file-tp5716075p5717724.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: File Component: Rename an existing file

2012-08-20 Thread santoshjoshi
Thanks Christian,

The patch has been attached to Jira 
https://issues.apache.org/jira/browse/CAMEL-5521
https://issues.apache.org/jira/browse/CAMEL-5521 

Regards
Santosh



--
View this message in context: 
http://camel.465427.n5.nabble.com/File-Component-Rename-an-existing-file-tp5716075p5717736.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to deploy a camel route in websphere application server 8.5

2012-08-20 Thread Willem jiang
It looks you didn't install the the camel-blueprint bundle rightly?
Can you double check it ?

-- 
Willem Jiang

FuseSource
Web: http://www.fusesource.com (http://www.fusesource.com/)
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang



On Monday, August 20, 2012 at 11:31 PM, Sriraman Gopalan wrote:

> Dear All,
> 
> Today, I tried to deploy a simple route in Websphere Application Server 8.5
> as an Asset (.eba file).
> 
> However, while deploying the asset, I got the following error:
> 
> org.apache.aries.application.modelling.ModellerException: CWSAL0126E: An
> exception occurred while modelling bundle ib-base_0.0.1.SNAPSHOT:
> org.apache.aries.application.modelling.ModellerException:
> org.osgi.service.blueprint.container.ComponentDefinitionException:
> Unsupported node namespace: http://camel.apache.org/schema/blueprint 
> 
> I use Camel 2.10.0.
> 
> My blueprint file snippet is as follows:
> 
> http://www.osgi.org/xmlns/blueprint/v1.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xmlns:camel="http://camel.apache.org/schema/blueprint";
> xsi:schemaLocation="
> http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
> http://camel.apache.org/schema/blueprint
> http://camel.apache.org/schema/blueprint/camel-blueprint.xsd";>
> 
> 
> 
> a.b.c.d
> 
> 
> 
> 
> best regards
> Sriraman.
> 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Unable-to-deploy-a-camel-route-in-websphere-application-server-8-5-tp5717720.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).





Re: Content Based Router Query

2012-08-20 Thread Willem jiang
Yeah, you can call the external API in a processor to setup the headers which 
could be use by the recipient-list to implement the CBR.

-- 
Willem Jiang

FuseSource
Web: http://www.fusesource.com (http://www.fusesource.com/)
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Tuesday, August 21, 2012 at 1:01 AM, Taariq Levack wrote:

> Hi
> 
> Yes, the CBR is rightly based on content, I think you want the recipient list 
> [1].
> 
> [1] http://camel.apache.org/recipient-list.html
> 
> Taariq
> 
> On 20 Aug 2012, at 18:09, gilboy  (mailto:josephoto...@gmail.com)> wrote:
> 
> > Hi
> > 
> > The content based router does not appear to support the routing of a message
> > to a particular destination based on a call to an external API. The examples
> > I have looked at appear to support the routing of messages to a destination
> > based on the message content.
> > 
> > In a nutshell, I want to use a Content Based Router were the destination is
> > determined by making a call to an API. In other words, the API will return
> > "PATH1", "PATH2" etc which map to different destinations
> > 
> > Any help much appreciated
> > 
> > Thanks
> > Joe
> > 
> > 
> > 
> > --
> > View this message in context: 
> > http://camel.465427.n5.nabble.com/Content-Based-Router-Query-tp5717722.html
> > Sent from the Camel - Users mailing list archive at Nabble.com 
> > (http://Nabble.com).
> 





CXF Policy cannot be satisfied

2012-08-20 Thread pberkman
sorry for the newbie question, i'm getting the following from a basic
producer using CXF within Camel...  any hints would be greatly appreciated!


org.apache.cxf.interceptor.Fault: None of the policy alternatives can be
satisfied.

at
org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:47)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:457)
at
org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:112)
at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
at
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:360)
at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:331)
at
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:227)
at
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:331)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:186)
at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:115)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:119)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:136)
at
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:284)
at
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:314)
at com.nextgate.ms.MMTest.testMMOk(MMTest.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47)
at org.junit.rules.RunRules.evaluate(RunRules.java:18)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
org.apache.camel.CamelExecutionException: Exception occurred during
execution on the exchange: Exchange[Message: [Body is null]]
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
at
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1296)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:618)
at
org.apache.maven.surefire.bo

Re: Passing arguments to a customer splitter

2012-08-20 Thread Christian Müller
You can set this as exchange property or message header befor you split the
message. Than you have access to this information in your custom splitter...

Best,
Christian

Sent from a mobile device
Am 20.08.2012 16:58 schrieb "Murari Raghavan" :

> Hello:
>
> Is there a way to pass arguments to a custom splitter?
>
> For eg - Route Builder calls a custom splitter -
> DDSResponseSplitService.splitStatusResponse()
>
> from(routesprops.getString(Constants.INBOUND))
> .split().method(DDSResponseSplitService.class, "splitStatusResponse")
> .process(new Processor() {
>   public void process(Exchange exchange) throws Exception {
> 
>
> If the splitStatusResponse method accepts a property string xslfilepath,
> how
> can I pass this argument in the call to the splitter method -
> .split().method(DDSResponseSplitService.class, "splitStatusResponse")?
>
> public List splitStatusResponse(String ddsresponse, String
> xslfilepath) throws Exception {
>
> }
>
> Thanks,
> Murari
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Passing-arguments-to-a-customer-splitter-tp5717719.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: File Component: Rename an existing file

2012-08-20 Thread Christian Müller
Could you attach it as diff to the JIRA issue Claus created? And don't
forget to grant the license to Apache...

Best,
Christian

Sent from a mobile device
Am 20.08.2012 19:40 schrieb "santoshjoshi" :

> Hi Claus,
>
> I made some changes to existing API (camel 2.8.7), as well as created some
> test cases for this feature.
> I want to contribute this to Apache Camel, It would be great if Apache
> Camel
> Team reviews the changes and provide valuable feedback/comments.
>
> could you please tell where and how should i post my files for Review.
>
> Regards
> Santosh
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/File-Component-Rename-an-existing-file-tp5716075p5717724.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Dzone Refcard

2012-08-20 Thread Christian Müller
I think this is a good choice.

Best,
Chrostian

Sent from a mobile device
Am 20.08.2012 22:16 schrieb "ceposta" :

> suppose i could have asked this before i started… but i'm almost done with
> a
> dzone refcard for most-used camel components and their configs. I wanted to
> limit it to 6 components, and I chose:
>
> JMS/ActiveMQ
> CXF
> HTTP4/Jetty
> Direct/Seda
> Mock/Test
>
> Any comments? Are there any glaring ones that should have been considered
> ahead of those 6?
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Dzone-Refcard-tp5717729.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Dzone Refcard

2012-08-20 Thread ceposta
suppose i could have asked this before i started… but i'm almost done with a
dzone refcard for most-used camel components and their configs. I wanted to
limit it to 6 components, and I chose:

JMS/ActiveMQ
CXF
HTTP4/Jetty
Direct/Seda
Mock/Test

Any comments? Are there any glaring ones that should have been considered
ahead of those 6?





--
View this message in context: 
http://camel.465427.n5.nabble.com/Dzone-Refcard-tp5717729.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: File Component: Rename an existing file

2012-08-20 Thread santoshjoshi
Hi Claus,

I made some changes to existing API (camel 2.8.7), as well as created some
test cases for this feature.
I want to contribute this to Apache Camel, It would be great if Apache Camel
Team reviews the changes and provide valuable feedback/comments.

could you please tell where and how should i post my files for Review.

Regards
Santosh



--
View this message in context: 
http://camel.465427.n5.nabble.com/File-Component-Rename-an-existing-file-tp5716075p5717724.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Content Based Router Query

2012-08-20 Thread Taariq Levack
Hi

Yes, the CBR is rightly based on content, I think you want the recipient list 
[1].

[1] http://camel.apache.org/recipient-list.html

Taariq

On 20 Aug 2012, at 18:09, gilboy  wrote:

> Hi
> 
> The content based router does not appear to support the routing of a message
> to a particular destination based on a call to an external API. The examples
> I have looked at appear to support the routing of messages to a destination
> based on the message content.
> 
> In a nutshell, I want to use a Content Based Router were the destination is
> determined by making a call to an API. In other words, the API will return
> "PATH1", "PATH2" etc which map to different destinations
> 
> Any help much appreciated
> 
> Thanks
> Joe
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Content-Based-Router-Query-tp5717722.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Content Based Router Query

2012-08-20 Thread gilboy
Hi

The content based router does not appear to support the routing of a message
to a particular destination based on a call to an external API. The examples
I have looked at appear to support the routing of messages to a destination
based on the message content.

In a nutshell, I want to use a Content Based Router were the destination is
determined by making a call to an API. In other words, the API will return
"PATH1", "PATH2" etc which map to different destinations

Any help much appreciated

Thanks
Joe



--
View this message in context: 
http://camel.465427.n5.nabble.com/Content-Based-Router-Query-tp5717722.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Unable to deploy a camel route in websphere application server 8.5

2012-08-20 Thread Sriraman Gopalan
Dear All,

Today, I tried to deploy a simple route in Websphere Application Server 8.5
as an Asset (.eba file).

However, while deploying the asset, I got the following error:

org.apache.aries.application.modelling.ModellerException: CWSAL0126E: An
exception occurred while modelling bundle ib-base_0.0.1.SNAPSHOT:
org.apache.aries.application.modelling.ModellerException:
org.osgi.service.blueprint.container.ComponentDefinitionException:
Unsupported node namespace: http://camel.apache.org/schema/blueprint 

I use Camel 2.10.0.

My blueprint file snippet is as follows:

http://www.osgi.org/xmlns/blueprint/v1.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:camel="http://camel.apache.org/schema/blueprint";
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd";>



a.b.c.d




best regards
Sriraman.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-deploy-a-camel-route-in-websphere-application-server-8-5-tp5717720.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Passing arguments to a customer splitter

2012-08-20 Thread Murari Raghavan
Hello:

Is there a way to pass arguments to a custom splitter? 

For eg - Route Builder calls a custom splitter -
DDSResponseSplitService.splitStatusResponse()

from(routesprops.getString(Constants.INBOUND))
.split().method(DDSResponseSplitService.class, "splitStatusResponse")
.process(new Processor() {
  public void process(Exchange exchange) throws Exception {


If the splitStatusResponse method accepts a property string xslfilepath, how
can I pass this argument in the call to the splitter method -
.split().method(DDSResponseSplitService.class, "splitStatusResponse")?
 
public List splitStatusResponse(String ddsresponse, String
xslfilepath) throws Exception {

}

Thanks,
Murari




--
View this message in context: 
http://camel.465427.n5.nabble.com/Passing-arguments-to-a-customer-splitter-tp5717719.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Losing Messages in SEDA endpoint with polling consumer

2012-08-20 Thread SimonH
I'm using Camel 2.8.5, and am finding that messages sent to SEDA endpoints
that have polling consumers are sometimes lost - when sending more than 1000
messages.

My example scenario is shown below.  I have a timer endpoint to kick off my
experiment.  The route then proceeds as follows:

- Generate a list of 2000 Strings out of nowhere
- Split the message into 2000 separate messages
- For each message:
-- inOnly to SEDA queue 1
-- inOnly to SEDA queue 2
-- end
- use a ConsumerTemplate to poll all messages from SEDA queue 1 until no
more messages are found; count these messages
- display the total count of messages for queue 1

Separately, I have another route to count the messages to queue 2 in an
event-driven manner.  The count for this queue is shown alongside the count
for queue 1.

The ConsumerTemplate always finds at least 1000 messages on queue 1, and
sometimes more.  But it never finds all 2000.  Typical is very close to
1000.  The event-driven counter always finds all 2000.  Why does the polling
method not find all messages?

Some extra info:
- if I start with more than 2000 messages, the polling consumer still
generally finds around 1000 messages; the event-driven consumer finds them
all still
- if I start with less than 1000 messages, both consumers find all their
messages
- if I don't define a 'size' parameter on my polling consumer's queue, the
behaviour does not change



package com.example;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.camel.ConsumerTemplate;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.springframework.beans.factory.annotation.Autowired;

public class ConsumerTestRouteBuilder extends RouteBuilder {

private static final String EVENT_DRIVEN_Q = "seda:eventDrivenQ";
private static final String POLLING_Q = "seda:pollingQ?size=1";

 @Autowired
private ConsumerTemplate consumer;
 
 private AtomicInteger eventDrivenCount = new AtomicInteger();
 private AtomicInteger pollingCount = new AtomicInteger();

 @Override
 public void configure() throws Exception {
  
 from("timer://foo?fixedRate=true&period=2")
 .process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
System.out.println("Start of test");
eventDrivenCount.set(0);
pollingCount.set(0);
List answer = new ArrayList();
for(int i=0;i<2000;i++) {
answer.add("myString"+i);
}
exchange.getIn().setBody(answer);
}
})
.split(body())
.inOnly(POLLING_Q)
.inOnly(EVENT_DRIVEN_Q)
.end()
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
while(consumer.receive(POLLING_Q, 7000) !=null ) {
pollingCount.incrementAndGet();
}
};
})
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
System.out.println("Event-driven consumptions =
"+eventDrivenCount.get());
System.out.println("Polling consumptions =
"+pollingCount.get());
System.out.println("End of test");
System.out.println();
}
});
 
 from(EVENT_DRIVEN_Q)
 .process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
eventDrivenCount.incrementAndGet();
}
 });
 } 
}


I configure using Spring:



http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xmlns:cxf="http://camel.apache.org/schema/cxf";
xmlns:camel="http://camel.apache.org/schema/spring";
xmlns:context="http://www.springframework.org/schema/context";
 xmlns:jaxws="http://cxf.apache.org/jaxws";
 xsi:schemaLocation="http://www.springframework.org/schema/beans 
   
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/context
   
http://www.springframework.org/schema/context/spring-context.xsd";>

 



 http://camel.apache.org/schema/spring";>

  
 








--
View this message in context: 
http://camel.465427.n5.nabble.com/Losing-Messages-in-SEDA-endpoint-with-polling-consumer-tp5717711.html
Sent from the Camel - Users mailing list archive at Nabbl

Re: Creating endpoint uri dynamically

2012-08-20 Thread raheem
Thanks for the hint Claus!  I constructed the endpoint uri before sending
the message to the queue in the header and then using the
recipientList(header("header name").

Thanks again,
Raheem

On Mon, Aug 20, 2012 at 2:10 AM, Claus Ibsen-2 [via Camel] <
ml-node+s465427n5717679...@n5.nabble.com> wrote:

> Hi
>
> Take a look at this FAQ
> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
>
>
> On Mon, Aug 20, 2012 at 6:24 AM, raheem <[hidden 
> email]>
> wrote:
>
> > Hi,
> > I am sure this is possible, but can't figure out how.  Here is the
> scenario:
> > 1.  I need to read a list of directories from a remote server
> > 2.  I need to create a jms message and send it to a queue for each
> directory
> > 3.  I need to read the jms messages off the queue and retrieve each
> > directory to store locally
> >
> > I have accomplished #1 and #2 by using the ssh module and then using a
> > processor to tokenize the returned string and have successfully sent it
> to
> > the queue.  I am stuck on number 3.  I basically need to do something
> like
> > this:
> > fromfrom("jms:test.queue").to("sftp://someUser@server/"; + message body
> >
> +"?password=somePassword&binary=true&delay=6").to("file://target/test-reports");
>
> >
> > Any ideas as to how to get the message body from within the to?
> >
> > Thanks,
> > Raheem
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Creating-endpoint-uri-dynamically-tp5717675.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> FuseSource
> Email: [hidden email]
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Creating-endpoint-uri-dynamically-tp5717675p5717679.html
>  To unsubscribe from Creating endpoint uri dynamically, click 
> here
> .
> NAML
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Creating-endpoint-uri-dynamically-tp5717675p5717708.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File Component: Rename an existing file

2012-08-20 Thread Claus Ibsen
Hi

I logged a ticket to get such a feature into Camel
https://issues.apache.org/jira/browse/CAMEL-5521

On Mon, Jul 16, 2012 at 9:36 PM, Claus Ibsen  wrote:
> Hi
>
> I actually don't think this would be possible. I don't recall we have
> a hook to allow a custom plugin on the producer side, to eg as you
> want, to rename the existing file beforehand.
>
> We could possible introduce an out of the box solution with a new
> enum: MoveExisting
> And then have a new moveExisting option where you can set a pattern
> for the name (like the move, preMove options also support a pattern
> etc).
>
>
>
> On Mon, Jul 16, 2012 at 11:39 AM, santoshjoshi
>  wrote:
>> Environment:
>>
>> Camel :2.8.1
>> Java : jdk 6
>>
>>
>> The default behaviour of Camel file component is to Override an existing
>> file:
>>
>> Below are the options the applies when a file already exists
>> public enum GenericFileExist {
>> Override, Append, Fail, Ignore
>> }
>>
>> I would like to have an option like where an existing file is renamed,
>> before producing new file.
>> How can this be possible.
>>
>> Regards,
>> Santosh
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/File-Component-Rename-an-existing-file-tp5716075.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: JSON - Jackson return list rather than POJO

2012-08-20 Thread Jason Chaffee
I asked this same question before and this the example and answer I got about 
using a Map with Jackson.



 
 


I did not test it to confirm that it works correctly though.

On Aug 20, 2012, at 1:08 AM, Claus Ibsen 
mailto:claus.ib...@gmail.com>> wrote:

Hi

Maybe we could improve the camel-jackson to support list/map types as
responses more easily?
I just wonder what a good solution would be?

Either the user would need to explicit configure this on the data format?

Or we can look into a fallback type converter, so Camel automatic an
convert to a List/Map for you.
And if you want you can use



And then the fallback type converter would kick in.



On Tue, Aug 14, 2012 at 9:43 PM, ychawla 
mailto:premiergenerat...@yahoo.com>> wrote:
A simple workaround for this is a custom bean processor like so:

   public void processPersonSearchResponseJSON(Exchange exchange) throws
JsonParseException, JsonMappingException, IOException
   {
   ObjectMapper mapper = new ObjectMapper();

   List personSearchResponses =
mapper.readValue(exchange.getIn().getBody(String.class), new
TypeReference>() { });

   exchange.getIn().setBody(personSearchResponses);

   }

and in the camel context:












--
View this message in context: 
http://camel.465427.n5.nabble.com/JSON-Jackson-return-list-rather-than-POJO-tp5717341p5717347.html
Sent from the Camel - Users mailing list archive at 
Nabble.com.



--
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen



In order to protect our email recipients, Betfair Group use SkyScan from 
MessageLabs to scan all Incoming and Outgoing mail for viruses.



Re: Intercept processor/bean

2012-08-20 Thread Christian Müller
Yeah, I also favor to use

to("bean://myBean?method=foo")

which you can intercept...

Best,
Christian

On Mon, Aug 20, 2012 at 8:11 AM, Claus Ibsen  wrote:

> On Fri, Aug 17, 2012 at 10:17 PM, Łukasz Dywicki 
> wrote:
> > Hey all,
> > Is there a way to intercept custom processor execution?
> >
> > For example my route is following:
> > process(new LoggingProcessor())
> > or
> > processRef("loggingProcessor")
> >
> > Also, is it's even possible to use interceptSendToEndpoint with
> >
> > bean or beanRef DSL elements?
> >
>
> Hi
>
> I think Babak have covered this well. Just to add that if you use
> bean/beanRef instead of process/processRef then you can use the
> interceptSendToEndpoint etc. to intercept sending to the bean.
>
> in the bean you can still implement org.apache.camel.Processor, and
> have Camel leverage that. So its just a matter of changing in the
> route DSL.
>
> > Kind regards,
> > Lukasz
>
>
>
> --
> Claus Ibsen
> -
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>



--


Re: onCompletion with onWhen predicate

2012-08-20 Thread Claus Ibsen
Hi

What version of Camel are you using?

On Wed, Aug 15, 2012 at 5:01 PM, Hilde  wrote:
> Hello folks!
>
> I have figured out that onCompletion().onWhen() cannot be used multiple.
>
> Actually onCompletion().onWhen() suggests to use it multiple erroneously.
> I wrote the following route:
>
> from("seda:" + SedaDirectDestinations.SEDA_LOAD).routeId(ROUTE_ID)
>.onCompletion().onWhen(simple("${header.status} != 0"))
> .bean(loadPayloads, "finalFail")
> .to("activemq:topic:" + JmsDestinations.TOPIC_DASHBOARD_AUDITLOG)
>.end()
>   .onCompletion().onWhen(simple("${header.status} == 0"))
> .bean(loadPayloads, "finalSuccess")
> .to("activemq:topic:" + JmsDestinations.TOPIC_DASHBOARD_AUDITLOG)
>   .end()
> ...
>
> But that doesn't work because the latter onCompletion().onWhen() overwrites
> the first one.
> onCompletion().onWhen() must not exist more than once.
>
> Maybe you can publish that hint on http://camel.apache.org/oncompletion.html
>
> cheers
> Hilde
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/onCompletion-with-onWhen-predicate-tp5717401.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: JSON - Jackson return list rather than POJO

2012-08-20 Thread Claus Ibsen
Hi

Maybe we could improve the camel-jackson to support list/map types as
responses more easily?
I just wonder what a good solution would be?

Either the user would need to explicit configure this on the data format?

Or we can look into a fallback type converter, so Camel automatic an
convert to a List/Map for you.
And if you want you can use



And then the fallback type converter would kick in.



On Tue, Aug 14, 2012 at 9:43 PM, ychawla  wrote:
> A simple workaround for this is a custom bean processor like so:
>
> public void processPersonSearchResponseJSON(Exchange exchange) throws
> JsonParseException, JsonMappingException, IOException
> {
> ObjectMapper mapper = new ObjectMapper();
>
> List personSearchResponses =
> mapper.readValue(exchange.getIn().getBody(String.class), new
> TypeReference>() { });
>
> exchange.getIn().setBody(personSearchResponses);
>
> }
>
> and in the camel context:
>
> 
>
> 
>
> 
>
>  uri="bean:personSearchResponseJSONProcessor?method=processPersonSearchResponseJSON"/>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/JSON-Jackson-return-list-rather-than-POJO-tp5717341p5717347.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Aggregator not propagating exception back in camel version 1.6.2

2012-08-20 Thread Neeraj Mahajan
Thanks Claus

Now I think i have to use some thing else intead of aggregator as i cant
upgrate the version.

Thanks for your valuable support and time.
Neeraj Mahajan



--
View this message in context: 
http://camel.465427.n5.nabble.com/Aggregator-not-propagating-exception-back-in-camel-version-1-6-2-tp5717629p5717693.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator not propagating exception back in camel version 1.6.2

2012-08-20 Thread Claus Ibsen
On Mon, Aug 20, 2012 at 9:29 AM, Neeraj Mahajan
 wrote:
> I have intentionally disabled the error handlling, As I *required the message
> to be redelivered* in case of any exception/error in any route. I have
> applied transaction policy in my root route(not shown here in the above code
> sniphet) from where this splitter and aggregator gets called.
>

The Aggregator EIP in Camel 1.x does *not* support redelivery or
persistent storage out of the box.
You would need Camel 2.3 onwards for that.

If an exception occurs, you would have to deal with that and handle
your own kind of redelivery.



> Thanks
> Neeraj Mahajan
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Aggregator-not-propagating-exception-back-in-camel-version-1-6-2-tp5717629p5717689.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Aggregator not propagating exception back in camel version 1.6.2

2012-08-20 Thread Neeraj Mahajan
I have intentionally disabled the error handlling, As I *required the message
to be redelivered* in case of any exception/error in any route. I have
applied transaction policy in my root route(not shown here in the above code
sniphet) from where this splitter and aggregator gets called.

Thanks
Neeraj Mahajan



--
View this message in context: 
http://camel.465427.n5.nabble.com/Aggregator-not-propagating-exception-back-in-camel-version-1-6-2-tp5717629p5717689.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: aggregator aggregation completion

2012-08-20 Thread Claus Ibsen
On Fri, Aug 17, 2012 at 5:51 AM, javakurious  wrote:
> I am looking for some tips to correctly use Aggregator component.
>
> The scenario is that I am getting a request in xml format, and I process
> that request and get a response in XML format as well. But the request and
> response are two completely different format. My goal is to create a new XML
> document that combines the original request and the corresponding response,
> set it as a body of the Aggregated Exchange and send the exchange to a bean
> to write to database.
>
>  
> 
> 
> 
> 
>  
>
> 
> 
>  completionSize="2">
> 
> header.breadcrumbId
> 
> 
> 
> 
>
> Above, I am trying to send the request and the response to
> 'seda:auditRequestQueue'. The strategy ref is supposed to run a
> transformation to create a new xml document. I am using header.breadcrumbId
> as the correlation expression. I have set the completionSize to '2', so once
> both request and response is set to auditRequestQueue, the strategyRef is
> going to be executed.
>
> But, for some reason the strategyRef is never executed, the route keeps
> waiting for 2 related messages to arrive.
>
> What am I doing wrong ??? How can I debug it ?
>

Make sure your correlation expression would give the same result for
the 2 messages, otherwise the aggregator EIP cannot match the 2
messages. And then it wont call the strategyRef to "merge" the 2 of
them.

So can you double check that header is the same for the 2 of them?


> Thanks for any help !
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/aggregator-aggregation-completion-tp5717567.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Aggregator not propagating exception back in camel version 1.6.2

2012-08-20 Thread Claus Ibsen
On Mon, Aug 20, 2012 at 8:44 AM, Neeraj Mahajan
 wrote:
> Once aggregated result(exchange) is commited, the control does not come back
> to the aggregation strategy. And also I dont want to handle the exception, I
> need it to be progagated back from the aggregator component.
>

You have disabled error handling in your direct route. You would need
to re-enable that and use the Camel error handler to deal with the
exceptions.

> Thanks
> Neeraj Mahajan
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Aggregator-not-propagating-exception-back-in-camel-version-1-6-2-tp5717629p5717685.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen