Re: Routes controlling + thread dsl

2012-09-12 Thread Nafees
I will incorporate ur suggestions, and come back again. 

Thank you

Nafees



--
View this message in context: 
http://camel.465427.n5.nabble.com/Routes-controlling-thread-dsl-tp5719019p5719163.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issues with URI containing %40 or %26

2012-09-12 Thread Marco Crivellaro
Thanks for letting me know.
The ticket doesn't have any target milestone, is there a short term plan to
work on this issue?
Othewise I suppose the only way out for me would be to roll back to last
2.8.x...



--
View this message in context: 
http://camel.465427.n5.nabble.com/Issues-with-URI-containing-40-or-26-tp5719118p5719165.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SEDA and concurrentConsumers

2012-09-12 Thread Tim Dudgeon

Great. That works. Thanks.
BTW, the example in the Camel in Action book (p 322) seems wrong then as 
it describes it the way I originally had it.


Tim


On 12/09/2012 03:34, Willem jiang wrote:

You need set the seda endpoint parameter on the first one endpoint, because 
Camel will pickup the created queue in the next endpoint.

Please change the first route like this
…

.log('direct ${body}')
.to('seda:insert?blockWhenFull=truesize=5')




Re: SEDA and concurrentConsumers

2012-09-12 Thread Claus Ibsen
On Wed, Sep 12, 2012 at 8:52 AM, Tim Dudgeon tdudgeon...@gmail.com wrote:
 Great. That works. Thanks.
 BTW, the example in the Camel in Action book (p 322) seems wrong then as it
 describes it the way I originally had it.


The book is not wrong. The block parameter is on the *producer* side,
so you should have it in the to.


 Tim



 On 12/09/2012 03:34, Willem jiang wrote:

 You need set the seda endpoint parameter on the first one endpoint,
 because Camel will pickup the created queue in the next endpoint.

 Please change the first route like this
 …

 .log('direct ${body}')
 .to('seda:insert?blockWhenFull=truesize=5')





-- 
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: SEDA and concurrentConsumers

2012-09-12 Thread Claus Ibsen
On Wed, Sep 12, 2012 at 9:31 AM, Tim Dudgeon tdudgeon...@gmail.com wrote:
 OK, thanks. So I think I get it now. Some params need defining on the 'from'
 side and some on the 'to' side. And the order the queue appears in the
 routes is important. So this seems to work for me. Is this correct?

 from('seda:insert?concurrentConsumers=2size=3')
 .delay(1000)

 .log('seda ${body}')

 from('direct:start')
 .split(body())
 .log('direct ${body}')
 .to('seda:insert?blockWhenFull=true')


 For instance, if the two routes are defined in the other order its doesn't
 work as wanted.


Yes the size option matters, as the first endpoint that creates the
queue will control its size.
So if you want to limit then make sure to have size on the first
endpoint. Better yet on all the endpoints.

But the block option is only for the producer.

Another option is to define the endpoint, and then refer to it in the routes

configure() {

   Endpoint insert =
endpoint('seda:insert?concurrentConsumers=2size=3blockWhenFull=true');

   from(insert)
  ...

 ...
 to(insert)


 Tim



 On 12/09/2012 07:54, Claus Ibsen wrote:

 On Wed, Sep 12, 2012 at 8:52 AM, Tim Dudgeon tdudgeon...@gmail.com
 wrote:

 Great. That works. Thanks.
 BTW, the example in the Camel in Action book (p 322) seems wrong then as
 it
 describes it the way I originally had it.

 The book is not wrong. The block parameter is on the *producer* side,
 so you should have it in the to.


 Tim



 On 12/09/2012 03:34, Willem jiang wrote:

 You need set the seda endpoint parameter on the first one endpoint,
 because Camel will pickup the created queue in the next endpoint.

 Please change the first route like this
 …

 .log('direct ${body}')
 .to('seda:insert?blockWhenFull=truesize=5')








-- 
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


Performing Sticky load balancing in Camel.

2012-09-12 Thread balkishore
Hi I would like to perform sticky load balncing in apache camel based on the
SOAP session, whcih is embedded in ServiceGroupID node of the first
response.

I wrote a small route as follow:

from(uri)
.loadBalance().sticky(xpath(query).namespaces(env).namespaces(wsa).namespaces(ax))
.to(BE1,BE2);

Where URI is the string to which the requests are passed and BE1 and BE2 are
the two backend servers.

And my query is 

String query =
/soapenv:Envelope/soapenv:Header/wsa:ReplyTo/wsa:ReferenceParameters/axis2:ServiceGroupId/text();

If i am not wrong this query would extract the servicegroupID from my SOAP
header.

But when I try to perform the balancing, due to some reason whatsoever, the
requets are not being passed to the same backend server.

and my env, wsa and ax are the namespaces, which are :

Namespaces env = new Namespaces(soapenv,
http://schemas.xmlsoap.org/soap/envelope/;);
Namespaces wsa = new Namespaces(wsa,
http://www.w3.org/2005/08/addressing;);
Namespaces ax = new Namespaces(axis2,
http://ws.apache.org/namespaces/axis2;);

Am I doing something wrong here?
If so what? I would appreciate any help.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Performing-Sticky-load-balancing-in-Camel-tp5719170.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Performing Sticky load balancing in Camel.

2012-09-12 Thread Claus Ibsen
As *always* with xpath, make sure it works first.

For example set it to a header, and then use the camel tracer / log
component etc. to log it.
Also with xpath the result type is usually some XML type. And thus you
need to set it to String if you want just text.

There is a resultType on the xpath builder for that. Then you can set
it to String.class.



On Wed, Sep 12, 2012 at 9:33 AM, balkishore balkishore.pan...@gmail.com wrote:
 Hi I would like to perform sticky load balncing in apache camel based on the
 SOAP session, whcih is embedded in ServiceGroupID node of the first
 response.

 I wrote a small route as follow:

 from(uri)
 .loadBalance().sticky(xpath(query).namespaces(env).namespaces(wsa).namespaces(ax))
 .to(BE1,BE2);

 Where URI is the string to which the requests are passed and BE1 and BE2 are
 the two backend servers.

 And my query is

 String query =
 /soapenv:Envelope/soapenv:Header/wsa:ReplyTo/wsa:ReferenceParameters/axis2:ServiceGroupId/text();

 If i am not wrong this query would extract the servicegroupID from my SOAP
 header.

 But when I try to perform the balancing, due to some reason whatsoever, the
 requets are not being passed to the same backend server.

 and my env, wsa and ax are the namespaces, which are :

 Namespaces env = new Namespaces(soapenv,
 http://schemas.xmlsoap.org/soap/envelope/;);
 Namespaces wsa = new Namespaces(wsa,
 http://www.w3.org/2005/08/addressing;);
 Namespaces ax = new Namespaces(axis2,
 http://ws.apache.org/namespaces/axis2;);

 Am I doing something wrong here?
 If so what? I would appreciate any help.




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Performing-Sticky-load-balancing-in-Camel-tp5719170.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: Performing Sticky load balancing in Camel.

2012-09-12 Thread Willem jiang
Instead of using camel-cxf component, this is most effective way to do the load 
balancing. 
I think you can do some tracing work to see if the xpath expression return the 
right ServiceGroupID first. 
Then we can keep digging if the sticky load balancing is doing its job.

-- 
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 Wednesday, September 12, 2012 at 3:33 PM, balkishore wrote:

 Hi I would like to perform sticky load balncing in apache camel based on the
 SOAP session, whcih is embedded in ServiceGroupID node of the first
 response.
 
 I wrote a small route as follow:
 
 from(uri)
 .loadBalance().sticky(xpath(query).namespaces(env).namespaces(wsa).namespaces(ax))
 .to(BE1,BE2);
 
 Where URI is the string to which the requests are passed and BE1 and BE2 are
 the two backend servers.
 
 And my query is 
 
 String query =
 /soapenv:Envelope/soapenv:Header/wsa:ReplyTo/wsa:ReferenceParameters/axis2:ServiceGroupId/text();
 
 If i am not wrong this query would extract the servicegroupID from my SOAP
 header.
 
 But when I try to perform the balancing, due to some reason whatsoever, the
 requets are not being passed to the same backend server.
 
 and my env, wsa and ax are the namespaces, which are :
 
 Namespaces env = new Namespaces(soapenv,
 http://schemas.xmlsoap.org/soap/envelope/;);
 Namespaces wsa = new Namespaces(wsa,
 http://www.w3.org/2005/08/addressing;);
 Namespaces ax = new Namespaces(axis2,
 http://ws.apache.org/namespaces/axis2;);
 
 Am I doing something wrong here?
 If so what? I would appreciate any help.
 
 
 
 
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Performing-Sticky-load-balancing-in-Camel-tp5719170.html
 Sent from the Camel - Users mailing list archive at Nabble.com 
 (http://Nabble.com).





Re: Performing Sticky load balancing in Camel.

2012-09-12 Thread balkishore
Hi,
I just created a small java program just to check if my xpath provides me
with the appropriate infromation that I want(i.e the ServiceGroup ID) And I
go the output as 

urn:uuid:99A029EBBC70DBEB221347349722532, the term after urn:uuid: is the
session Id. 

So are the terms urn:uuid: culprit? Should I try eliminating them so, that
the xpression would just provide me with the number? Will that help?

And BTW, my SOAP message XML is as follow:
?xml version=1.0 encoding=http://schemas.xmlsoap.org/soap/envelope/;
standalone=no?
soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
soapenv:Header xmlns:wsa=http://www.w3.org/2005/08/addressing;
wsa:ReplyTo
wsa:Addresshttp://www.w3.org/2005/08/addressing/none/wsa:Address
wsa:ReferenceParameters
axis2:ServiceGroupId
xmlns:axis2=http://ws.apache.org/namespaces/axis2;urn:uuid:99A029EBBC70DBEB221347349722532/axis2:ServiceGroupId
/wsa:ReferenceParameters
/wsa:ReplyTo
wsa:MessageIDurn:uuid:99A029EBBC70DBEB221347349722564/wsa:MessageID
wsa:ActionPerform some action/wsa:Action
wsa:RelatesTourn:uuid:63AD67826AA44DAE8C1347349721356/wsa:RelatesTo
/soapenv:Header
soapenv:Body
content of the body.
/soapenv:Body
/soapenv:Envelope

And My Xpath expression is 
xpath.compile(/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text())

Is it right?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Performing-Sticky-load-balancing-in-Camel-tp5719170p5719184.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Must File component write the body?

2012-09-12 Thread Tim Dudgeon
When using the File component to write to a file is it always the 
message body that is written, or is it possible to use an expression 
(e.g. simple)?
Of course body can be replaced with new content using an expression, but 
is that the only way to do this?


Tim


Re: Performing Sticky load balancing in Camel.

2012-09-12 Thread balkishore
Is substring supported in camel by the way?
some thing like this 

xpath.compile(substring(string(/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text()),
10));

Return me an error, saying
org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath:

But it is supported in the normal java language. When i use this expression
in my java program, it returns me the 31 digit servicegroup id without the
urn:uurn: term.

Any help could be appropriate.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Performing-Sticky-load-balancing-in-Camel-tp5719170p5719189.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Must File component write the body?

2012-09-12 Thread Claus Ibsen
On Wed, Sep 12, 2012 at 11:54 AM, Tim Dudgeon tdudgeon...@gmail.com wrote:
 When using the File component to write to a file is it always the message
 body that is written, or is it possible to use an expression (e.g. simple)?
 Of course body can be replaced with new content using an expression, but is
 that the only way to do this?


Yes, you can use wireTap with an expression to set the body which taps
to the file endpoint. Then you can write without changing the original
exchange.

Or just use a bean and write the file content yourself.


 Tim



-- 
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


Filtering on message body content

2012-09-12 Thread chris . odom
I created a route that I was trying to use to filter messages from a 
destination.


@Override
public void configure() throws Exception {

from(requestEndpoint).routeId(createRouteId())
.filter(body(String.class).contains(content))
.to(destinationEndpoint).end();
   }

The route runs and broker dispatches and dequeues every message no 
matter what and the route never places the message to its destination, 
no matter what. I know I can check to see if there are matching but I 
have not gotten around to putting in any of this logic to see if the 
expression matched. Just wondering if anyone knows why this is happening 
or if anyone seen this before.


Thanks
Chris Odom.


How to make Apache camel to search an expression in SOAP response.

2012-09-12 Thread balkishore
I am caught in this problem for a while now and am not able to figure out how
to solve it.

I have a client that sends a SOAP request and gets a SOAP response from the
servers.

I have written a wrote to do a sticky load balance:

from(uri)
.loadBalance().sticky(xpath(query2))
.to(BE1,BE2);

If i am not wrong xpath is performed to the first request recieved.
The problem here is my request does not contains the ServiceGroupID(session
id, to be used to do sticky load balancing), but my response does.
Due to which sticky load balancing is not being performed as desired and the
request are not passed to the same backend server.

How can I make camel to search and perform the xpath on the response instead
of request.
 
I would be really glad if someone can help me.

I did not find any thing regarding this on the Internet and on camel in
action book.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-make-Apache-camel-to-search-an-expression-in-SOAP-response-tp5719192.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to make Apache camel to search an expression in SOAP response.

2012-09-12 Thread Claus Ibsen
Hi

You have already posted about this in another thread. Please dont
start new topics about the same.


On Wed, Sep 12, 2012 at 3:49 PM, balkishore balkishore.pan...@gmail.com wrote:
 I am caught in this problem for a while now and am not able to figure out how
 to solve it.

 I have a client that sends a SOAP request and gets a SOAP response from the
 servers.

 I have written a wrote to do a sticky load balance:

 from(uri)
 .loadBalance().sticky(xpath(query2))
 .to(BE1,BE2);

 If i am not wrong xpath is performed to the first request recieved.
 The problem here is my request does not contains the ServiceGroupID(session
 id, to be used to do sticky load balancing), but my response does.
 Due to which sticky load balancing is not being performed as desired and the
 request are not passed to the same backend server.

 How can I make camel to search and perform the xpath on the response instead
 of request.

 I would be really glad if someone can help me.

 I did not find any thing regarding this on the Internet and on camel in
 action book.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-to-make-Apache-camel-to-search-an-expression-in-SOAP-response-tp5719192.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: Filtering on message body content

2012-09-12 Thread Claus Ibsen
If the messages gets dequed only, then the expression returns false,
so the message gets dropped.

Make sure the value content has been set before the configure method
is invoked.
For example you can do a System out println of content variable from
the configure meyhod. It may be null at the time.

On Wed, Sep 12, 2012 at 3:19 PM,  chris.o...@mediadriver.com wrote:
 I created a route that I was trying to use to filter messages from a
 destination.

 @Override
 public void configure() throws Exception {

 from(requestEndpoint).routeId(createRouteId())
 .filter(body(String.class).contains(content))
 .to(destinationEndpoint).end();
}

 The route runs and broker dispatches and dequeues every message no matter
 what and the route never places the message to its destination, no matter
 what. I know I can check to see if there are matching but I have not gotten
 around to putting in any of this logic to see if the expression matched.
 Just wondering if anyone knows why this is happening or if anyone seen this
 before.

 Thanks
 Chris Odom.



-- 
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


Setting properties on Camel CXF consumer endpoints

2012-09-12 Thread Jens
Hi,

I have a simple bridging route defined as



The toBean has a WS-Policy attached that demands a UsernameToken.

As per the CXF documentation I try to set the username and password on the
toBean like this:



However, it seems those properties are simply discarded, and the CXF Policy
Interceptor complains:
No username available.

That also seems to be true for arbitrary properties. If I set the properties
on the toBean instead, they do seem to be applied there (which isn't helping
in this case, but anyway). Is there a reason why unknown properties are
swallowed on the consumer side? Is there a way to avoid that?

Thanks,
Jens



--
View this message in context: 
http://camel.465427.n5.nabble.com/Setting-properties-on-Camel-CXF-consumer-endpoints-tp5719195.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Filtering on message body content

2012-09-12 Thread chris . odom

Thanks for the response Claus,

Here is the routes Description:

EventDrivenConsumerRoute[Endpoint[activemq://queue:esigSigRqst] - 
Instrumentation:route[UnitOfWork(RouteContextProcessor[Channel[Filter[if: 
bodyAs[java.lang.String] contains POS do: 
Channel[sendTo(Endpoint[activemq://queue:esigSigDecrypt]))]]


As you can see the content value is set 'POS' but still all messages 
get dequeued from the esigSigRqst queue and never get enqueued to 
esigSigDecrypt queue. The message bodies are text xml and I know that 
they contain 'POS' with in the text. The stranger part is I ran this 
same route with content set to 'DooDoo' and I got the same result, all 
messages dequeued and no messages enqueued.


Thanks.

On 2012-09-12 09:12, Claus Ibsen wrote:

If the messages gets dequed only, then the expression returns false,
so the message gets dropped.

Make sure the value content has been set before the configure 
method

is invoked.
For example you can do a System out println of content variable from
the configure meyhod. It may be null at the time.

On Wed, Sep 12, 2012 at 3:19 PM,  chris.o...@mediadriver.com wrote:

I created a route that I was trying to use to filter messages from a
destination.

@Override
public void configure() throws Exception {

from(requestEndpoint).routeId(createRouteId())
.filter(body(String.class).contains(content))
.to(destinationEndpoint).end();
   }

The route runs and broker dispatches and dequeues every message no 
matter
what and the route never places the message to its destination, no 
matter
what. I know I can check to see if there are matching but I have not 
gotten
around to putting in any of this logic to see if the expression 
matched.
Just wondering if anyone knows why this is happening or if anyone 
seen this

before.

Thanks
Chris Odom.


Re: Filtering on message body content

2012-09-12 Thread Claus Ibsen
And without the filter so its straight from - to. Does that work for you?


On Wed, Sep 12, 2012 at 4:26 PM,  chris.o...@mediadriver.com wrote:
 Thanks for the response Claus,

 Here is the routes Description:

 EventDrivenConsumerRoute[Endpoint[activemq://queue:esigSigRqst] -
 Instrumentation:route[UnitOfWork(RouteContextProcessor[Channel[Filter[if:
 bodyAs[java.lang.String] contains POS do:
 Channel[sendTo(Endpoint[activemq://queue:esigSigDecrypt]))]]

 As you can see the content value is set 'POS' but still all messages get
 dequeued from the esigSigRqst queue and never get enqueued to esigSigDecrypt
 queue. The message bodies are text xml and I know that they contain 'POS'
 with in the text. The stranger part is I ran this same route with content
 set to 'DooDoo' and I got the same result, all messages dequeued and no
 messages enqueued.

 Thanks.


 On 2012-09-12 09:12, Claus Ibsen wrote:

 If the messages gets dequed only, then the expression returns false,
 so the message gets dropped.

 Make sure the value content has been set before the configure method
 is invoked.
 For example you can do a System out println of content variable from
 the configure meyhod. It may be null at the time.

 On Wed, Sep 12, 2012 at 3:19 PM,  chris.o...@mediadriver.com wrote:

 I created a route that I was trying to use to filter messages from a
 destination.

 @Override
 public void configure() throws Exception {

 from(requestEndpoint).routeId(createRouteId())
 .filter(body(String.class).contains(content))
 .to(destinationEndpoint).end();
}

 The route runs and broker dispatches and dequeues every message no matter
 what and the route never places the message to its destination, no matter
 what. I know I can check to see if there are matching but I have not
 gotten
 around to putting in any of this logic to see if the expression matched.
 Just wondering if anyone knows why this is happening or if anyone seen
 this
 before.

 Thanks
 Chris Odom.



-- 
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: Filtering on message body content

2012-09-12 Thread chris . odom
The idea is to start up a route to selectively move messages from one 
queue to another based on an expression. This is, as far as I know, the 
Selective Consumer EIP. The idea would be if the filter returns true, 
move the message to the next destination otherwise leave it in the 
queuethought this would be pretty straight forward. Is there a 
better way of implementing a Selective Consumer EIP?



On 2012-09-12 10:09, Claus Ibsen wrote:
And without the filter so its straight from - to. Does that work for 
you?



On Wed, Sep 12, 2012 at 4:26 PM,  chris.o...@mediadriver.com wrote:

Thanks for the response Claus,

Here is the routes Description:

EventDrivenConsumerRoute[Endpoint[activemq://queue:esigSigRqst] -

Instrumentation:route[UnitOfWork(RouteContextProcessor[Channel[Filter[if:
bodyAs[java.lang.String] contains POS do:
Channel[sendTo(Endpoint[activemq://queue:esigSigDecrypt]))]]

As you can see the content value is set 'POS' but still all messages 
get
dequeued from the esigSigRqst queue and never get enqueued to 
esigSigDecrypt
queue. The message bodies are text xml and I know that they contain 
'POS'
with in the text. The stranger part is I ran this same route with 
content
set to 'DooDoo' and I got the same result, all messages dequeued and 
no

messages enqueued.

Thanks.


On 2012-09-12 09:12, Claus Ibsen wrote:


If the messages gets dequed only, then the expression returns 
false,

so the message gets dropped.

Make sure the value content has been set before the configure 
method

is invoked.
For example you can do a System out println of content variable 
from

the configure meyhod. It may be null at the time.

On Wed, Sep 12, 2012 at 3:19 PM,  chris.o...@mediadriver.com 
wrote:


I created a route that I was trying to use to filter messages from 
a

destination.

@Override
public void configure() throws Exception {

from(requestEndpoint).routeId(createRouteId())
.filter(body(String.class).contains(content))
.to(destinationEndpoint).end();
   }

The route runs and broker dispatches and dequeues every message no 
matter
what and the route never places the message to its destination, no 
matter
what. I know I can check to see if there are matching but I have 
not

gotten
around to putting in any of this logic to see if the expression 
matched.
Just wondering if anyone knows why this is happening or if anyone 
seen

this
before.

Thanks
Chris Odom.




Re: Filtering on message body content

2012-09-12 Thread chris . odom

I have also have another route that uses this which works correctly...


@Override
public void configure() throws Exception {

from(requestEndpoint).routeId(createRouteId())
.filter(header(headerName).isEqualTo(headerValue))
.to(destinationEndpoint).end();
}

On 2012-09-12 10:09, Claus Ibsen wrote:
And without the filter so its straight from - to. Does that work for 
you?



On Wed, Sep 12, 2012 at 4:26 PM,  chris.o...@mediadriver.com wrote:

Thanks for the response Claus,

Here is the routes Description:

EventDrivenConsumerRoute[Endpoint[activemq://queue:esigSigRqst] -

Instrumentation:route[UnitOfWork(RouteContextProcessor[Channel[Filter[if:
bodyAs[java.lang.String] contains POS do:
Channel[sendTo(Endpoint[activemq://queue:esigSigDecrypt]))]]

As you can see the content value is set 'POS' but still all messages 
get
dequeued from the esigSigRqst queue and never get enqueued to 
esigSigDecrypt
queue. The message bodies are text xml and I know that they contain 
'POS'
with in the text. The stranger part is I ran this same route with 
content
set to 'DooDoo' and I got the same result, all messages dequeued and 
no

messages enqueued.

Thanks.


On 2012-09-12 09:12, Claus Ibsen wrote:


If the messages gets dequed only, then the expression returns 
false,

so the message gets dropped.

Make sure the value content has been set before the configure 
method

is invoked.
For example you can do a System out println of content variable 
from

the configure meyhod. It may be null at the time.

On Wed, Sep 12, 2012 at 3:19 PM,  chris.o...@mediadriver.com 
wrote:


I created a route that I was trying to use to filter messages from 
a

destination.

@Override
public void configure() throws Exception {

from(requestEndpoint).routeId(createRouteId())
.filter(body(String.class).contains(content))
.to(destinationEndpoint).end();
   }

The route runs and broker dispatches and dequeues every message no 
matter
what and the route never places the message to its destination, no 
matter
what. I know I can check to see if there are matching but I have 
not

gotten
around to putting in any of this logic to see if the expression 
matched.
Just wondering if anyone knows why this is happening or if anyone 
seen

this
before.

Thanks
Chris Odom.


Re: Using correlationid to isolate jms queues in multiple camelContexts

2012-09-12 Thread Pontus Ullgren
Hello,

The way you see it behave is the way it should behave. If you have
competing consumers on a queue they will consume messages in that way.

If I interpreted your requirement correctly you have messages from a#
that can only be consumed by c# and messages from b# that can only be
consumed by d#.
In that case you should really use two different queues for this one
between each pair of producer and consumer.

Adding extra queues in activemq is simple and very low cost when it
comes to resources. So I would advice you to solve it this way.

If you for some reason still want to use one queue (legacy, crazy
customer requirement or let's say that you are building a example for
bad architecture ;-P) then you can set a header on the messages in the
producer and then use a selector in the consumer. See the
documentation on the Camel JMS component[1] and the JMS component unit
test.

But again: Use two queues.

[1] http://camel.apache.org/jms.html
[2] 
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSelectorTest.java
Best regards
Pontus Ullgren


On Wed, Sep 12, 2012 at 7:18 PM, garrydias garryd...@gmail.com wrote:
 Dear friends

 I´m facing the folowing problem: I have 2 producers systems sending messages
 to 1 jms queue that is consumed by 2 consumers systems. Ignore the VM where
 they are.

 #a) a producerSystem_1.war has the folowing camelContext:

 camelContext id=producerSystem-1-camelContext
   ...
   route
 from uri=direct:whatever /
 to uri=activemq:common_queue /
   /route
   ...
 /camelContext 


 #b) a producerSystem_2.war has the folowing camelContext:

 camelContext id=producerSystem-2-camelContext
   ...
   route
 from uri=direct:whatever /
 to uri=activemq:common_queue /
   /route
   ...
 /camelContext 


 #c) a consumerSystem_1.war has the folowing camelContext:

 camelContext id=context_1
   route
 from uri=activemq:common_queue /
 to uri=bean:consumer_a /
   /route
 /camelContext 


 #d) a consumerSystem_2.war has the folowing camelContext:

 camelContext id=context_2
   route
 from uri=activemq:common_queue /
 to uri=bean:consumer_b /
   /route
 /camelContext 


 The VM where these applications are running is not important.

 My *desired behavior *is:
 - Messages produced in #a must consumed in c#
 - Messages produced in #b must consumed in d#

 The *actual behavior* is:
 - Messages produced in #a sometimes is consumed in c# and sometimes in d#
 - Messages produced in #b sometimes is consumed in c# and sometimes in d#

 I understand that JMS endpoints were designed to execute in the *actual
 behavior*. But in this case, I need to run *my desired *behavior.

 There´s a way to do this using correlationIds (not send/receive approach)?

 Thanx a lot



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Using-correlationid-to-isolate-jms-queues-in-multiple-camelContexts-tp5719202.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel vs BPEL

2012-09-12 Thread Bing Lu
thanks for the links. I'm trying to convince them why camel is better than
BPEL in the system integration world, any suggestions welcome

On Wed, Sep 12, 2012 at 5:37 PM, chris snow chsnow...@gmail.com wrote:

 you may find these links useful:


 http://fusesource.com/apache-camel-conference-2012/videos/camelone-2012-kai-wahner-video

 http://camel.465427.n5.nabble.com/Camel-EAI-patterns-vs-BPEL-processes-td5713573.html


 On Wed, Sep 12, 2012 at 10:25 PM, realice real...@gmail.com wrote:
  Hi, can anyone give some really good convincing stuff that why should we
 use
  camel over BPEL? I'm trying to convince somebody here to use camel
 instead
  of oracle SOA 11g that has BPEL engine as so called 'orchestrator'. any
  references, materials are good, and especially like to have some input
 from
  the gurus
 
  many thanks
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Camel-vs-BPEL-tp5719214.html
  Sent from the Camel - Users mailing list archive at Nabble.com.



 --
 Chris Snow -
 http://uk.linkedin.com/pub/chris-snow-mba-tech-mgmt-cissp/6/0/316



Re: Camel vs BPEL

2012-09-12 Thread Donald Whytock
Camel's a lot cheaper than Oracle...?

On Wed, Sep 12, 2012 at 5:58 PM, Bing Lu real...@gmail.com wrote:
 thanks for the links. I'm trying to convince them why camel is better than
 BPEL in the system integration world, any suggestions welcome

 On Wed, Sep 12, 2012 at 5:37 PM, chris snow chsnow...@gmail.com wrote:

 you may find these links useful:


 http://fusesource.com/apache-camel-conference-2012/videos/camelone-2012-kai-wahner-video

 http://camel.465427.n5.nabble.com/Camel-EAI-patterns-vs-BPEL-processes-td5713573.html


 On Wed, Sep 12, 2012 at 10:25 PM, realice real...@gmail.com wrote:
  Hi, can anyone give some really good convincing stuff that why should we
 use
  camel over BPEL? I'm trying to convince somebody here to use camel
 instead
  of oracle SOA 11g that has BPEL engine as so called 'orchestrator'. any
  references, materials are good, and especially like to have some input
 from
  the gurus
 
  many thanks
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Camel-vs-BPEL-tp5719214.html
  Sent from the Camel - Users mailing list archive at Nabble.com.



 --
 Chris Snow -
 http://uk.linkedin.com/pub/chris-snow-mba-tech-mgmt-cissp/6/0/316



ApacheCon EU 2012 - Sinnsheim

2012-09-12 Thread Christian Müller
I want to know who is planning to join ApacheCon EU 2012 in Sinnsheim,
Germany (5th November - 8th November)? We will have 5 talks in the Camel
in Action track (one of them is about ActiveMQ and four talks about
Camel)...
Somebody interested in a get together evening event? If so, I would try to
organize something...

Best,
Christian

--


Multicast, redelivery and error handlers

2012-09-12 Thread jimbogaz
Hi all.

I think I'm missing something obvious, but I can't find anything here that
is similar to my problem, or any docs that tell me it's obvious James you
twerp:

I've put together a route that multicasts to three direct routes, which
simply return setBody type responses.  I have intentionally made one of them
take longer than the timeout on the multicast, with the intention that the
error handler retries the request.  It doesn't.  I have tried with both
having a TimeoutAwareAggregationStrategy with a setException (which I
thought would automatically invoke the error handler), and with just a plain
AggregationStrategy.

I'm on Camel 2.9.3, and below are my (sanitised to protect my client)
sections from beans.xml and my main method...  can anybody tell me where I'm
epic failing?


public static void main(String... args) throws Exception {
ApplicationContext appContext = new
ClassPathXmlApplicationContext(beans.xml);
LOG.info(Initialised Application Context);
CamelContext camelContext = appContext.getBean(camel-context,
CamelContext.class);
ProducerTemplate producerTemplate =
camelContext.createProducerTemplate();
producerTemplate.asyncCallbackRequestBody(direct:blah,
identitynameJames/named...@thingy.com/identity, callback);
Thread.sleep(15000);
LOG.info(FINISHED);
}

  camel:camelContext id=camel-context errorHandlerRef=defaultEH
xmlns=http://camel.apache.org/schema/spring;
camel:packagecom.rightmess.camel/camel:package

camel:errorHandler id=defaultEH
camel:redeliveryPolicy maximumRedeliveries=2
retryAttemptedLogLevel=WARN redeliveryDelay=200/
/camel:errorHandler
camel:route
  camel:from uri=direct:blah/
  camel:multicast strategyRef=aggregatedData
   parallelProcessing=true streaming=true timeout=700
camel:to uri=direct:DOB/
camel:to uri=direct:Address/
camel:to uri=direct:Telephone/
  /camel:multicast
/camel:route
camel:route
camel:from uri=direct:DOB/
camel:delaycamel:constant233/camel:constant/camel:delay

camel:setBodycamel:constant15/04/1868/camel:constant/camel:setBody
/camel:route
camel:route
camel:from uri=direct:Address/
camel:delaycamel:constant1500/camel:constant/camel:delay

camel:setBodycamel:constantStarbucks/camel:constant/camel:setBody
camel:to uri=log:log/
/camel:route
camel:route
camel:from uri=direct:Telephone/
camel:delaycamel:constant233/camel:constant/camel:delay

camel:setBodycamel:constant0982734786238746/camel:constant/camel:setBody
/camel:route
  /camel:camelContext
  




--
View this message in context: 
http://camel.465427.n5.nabble.com/Multicast-redelivery-and-error-handlers-tp5719208.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Multicast, redelivery and error handlers

2012-09-12 Thread jimbogaz
Oh, and the asyncCallbackRequestBody call is intentional (I am under the
impression that this is a way to have an InOut route that doesn't block the
initiating thread... my multicast routes will eventually be CXF over JMS
calls).



--
View this message in context: 
http://camel.465427.n5.nabble.com/Multicast-redelivery-and-error-handlers-tp5719208p5719209.html
Sent from the Camel - Users mailing list archive at Nabble.com.