Re: log4j.properties in camel

2011-08-23 Thread bvahdat
Hi Ben,

thanks for your reply.

To make it concrete, the pluginManagment entry in [1] would be something
like:

build
 pluginManagement
...
...
  plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-surefire-plugin/artifactId
configuration
 redirectTestOutputToFiletrue/redirectTestOutputToFile
 failIfNoTeststrue/failIfNoTests
/configuration
  /plugin
...
...
 /pluginManagement
/build

And for example in the case of camel-core, the change in [2] would be *out*
instead of *file*.

log4j.rootLogger=INFO, out

I wonder what others think about this...

[1] https://svn.apache.org/repos/asf/camel/trunk/parent/pom.xml
[2]
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/resources/log4j.properties

Regards, Babak

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


Re: i use wsdl file and payload dataFormat, but IllegalArgumentException

2011-08-23 Thread xiangqiuzhao
thanks, i had make mistake with the namespace, so i debug it in cxf endpoint
with the exception.

and my code like:

DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
Document doc = factory.newDocumentBuilder().parse(D:/a.xml);
Element element = doc.getDocumentElement();  
body.add(element);
CxfPayload in = new CxfPayload(null, body);

and the a.xml content with:
?xml version=1.0 encoding=UTF-8?
iws:helloServiceRequest
xmlns:iws=http://www.wstest.sunyard.com/IWSTestService/;
namemy name/name
/iws:helloServiceRequest

but my application had MAP context with contains the key with name only. 
so, i don't know how to make the xml content by the map. because i don't
know the xmlns and PORT name.

so i look at the cxf URI options description, what  the mean with
defaultOperationNameSpace option?

i use with:

.to(cxf://http://localhost:8000/wsdemo/services/IWSTestService?synchronous=true;
+ 
   
wsdlURL=IWSTestService.wsdldataFormat=PAYLOADdefaultOperationNameSpace=http://www.wstest.sunyard.com/IWSTestService/;)

but exception with  Exception in thread main
org.apache.camel.FailedToCreateRouteException...Unknown parameters..

my camel version is 2.7.2

i want my xml content look like only:

?xml version=1.0 encoding=UTF-8?
helloServiceRequest
namemy name/name
/helloServiceRequest 




--
View this message in context: 
http://camel.465427.n5.nabble.com/i-use-wsdl-file-and-payload-dataFormat-but-IllegalArgumentException-tp4719896p4725659.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: log4j.properties in camel

2011-08-23 Thread Willem Jiang

Hi

I'm only care about the log when there are some thing is wrong or the 
test is failed. So I'm OK to store the log in the file.
If you are working on the application code which use camel as a lib, you 
can always override the log4j.properties in your application.


Willem

On 8/23/11 2:17 PM, bvahdat wrote:

Hi Ben,

thanks for your reply.

To make it concrete, the pluginManagment entry in [1] would be something
like:

build
  pluginManagement
...
...
   plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-surefire-plugin/artifactId
 configuration
  redirectTestOutputToFiletrue/redirectTestOutputToFile
  failIfNoTeststrue/failIfNoTests
 /configuration
   /plugin
...
...
  /pluginManagement
/build

And for example in the case of camel-core, the change in [2] would be *out*
instead of *file*.

log4j.rootLogger=INFO, out

I wonder what others think about this...

[1] https://svn.apache.org/repos/asf/camel/trunk/parent/pom.xml
[2]
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/resources/log4j.properties

Regards, Babak

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





Re: Teach a man to fish ..

2011-08-23 Thread julian+activ...@dotr.com
we have (limited) success !!

Thanks very much - I can now receive plain text emails from google. 

1) I had to download the springsource framework and put all of the .jar
files into the optional directory as well
2) some of the demo parameters have changed since camel 2.0. These include
deleteProcessedMessages now delete and processOnlyUnseenMessages now
unseen

However, my stomp client only gets the headers and properties for email with
a header of Content_HYPHEN_Type:multipart/alternative;  for plain text
email, I get the full body.

I presume that this is something to do with plaintext vs binary in the stomp
message, but how do I get MQ to send a binary stomp message to a client ?

Many thanks for the help so far. Impossible to have done this without the
help.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Teach-a-man-to-fish-tp4722377p4725645.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: log4j.properties in camel

2011-08-23 Thread bvahdat
Hi Willem,

thanks for your feedback.

Imagine your are working on a patch and there you do some LOGGER.trace() ,
debug(), info() etc.

Wouldn't you prefer to see your *new* log statements directly in your IDE
while unit-testing *your* changes to verify if the patch's log entries seem
as you expect.

Regards, Babak

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


Sending binary message to stomp client

2011-08-23 Thread julian+activ...@dotr.com
I have a producer that polls an email inbox, and sends any new messages into
a queue. This queue has a stomp consumer.

for plain text emails, this works just fine. All headers are received, and
the body of the email is the body of the inbound stomp message.

However, for multipart messages, all the stomp client receives is the
headers and en empty body. There is no content-length header on the stomp
header so I presume that the body was not sent as it is binary.

Is there any way of getting activeMQ to send either plain-text stomp
messages, or binary messages as and when required ?

--
View this message in context: 
http://camel.465427.n5.nabble.com/Sending-binary-message-to-stomp-client-tp4725715p4725715.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: inProgressRepository not cleaned in GenericFileEndpoint ?

2011-08-23 Thread Claus Ibsen
On Mon, Aug 22, 2011 at 2:07 PM, aurelienmasse ama...@financeactive.com wrote:
 I'm using 2.8.0


I created an unit test on trunk, and it works fine there
http://svn.apache.org/viewvc?rev=1160565view=rev


 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/inProgressRepository-not-cleaned-in-GenericFileEndpoint-tp4722713p4723151.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.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: i use wsdl file and payload dataFormat, but IllegalArgumentException

2011-08-23 Thread Willem Jiang

The defaultOperationNameSpace should be defaultOperationNamespace.
I just update the wiki page entry of it.
But this operation should be used with defaultOperationName at the same 
time to help camel-cxf locate the BindingOperationInfo.


On 8/23/11 2:35 PM, xiangqiuzhao wrote:

thanks, i had make mistake with the namespace, so i debug it in cxf endpoint
with the exception.

and my code like:

 DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
 factory.setNamespaceAware(true);
 Document doc = factory.newDocumentBuilder().parse(D:/a.xml);
 Element element = doc.getDocumentElement();
 body.add(element);
 CxfPayload in = new CxfPayload(null, body);

and the a.xml content with:
?xml version=1.0 encoding=UTF-8?
iws:helloServiceRequest
xmlns:iws=http://www.wstest.sunyard.com/IWSTestService/;
 namemy name/name
/iws:helloServiceRequest

but my application had MAP context with contains the key with name only.
so, i don't know how to make the xml content by the map. because i don't
know the xmlns and PORT name.

so i look at the cxf URI options description, what  the mean with
defaultOperationNameSpace option?

i use with:

.to(cxf://http://localhost:8000/wsdemo/services/IWSTestService?synchronous=true;
+

wsdlURL=IWSTestService.wsdldataFormat=PAYLOADdefaultOperationNameSpace=http://www.wstest.sunyard.com/IWSTestService/;)

but exception with  Exception in thread main
org.apache.camel.FailedToCreateRouteException...Unknown parameters..

my camel version is 2.7.2

i want my xml content look like only:

?xml version=1.0 encoding=UTF-8?
helloServiceRequest
 namemy name/name
/helloServiceRequest




--
View this message in context: 
http://camel.465427.n5.nabble.com/i-use-wsdl-file-and-payload-dataFormat-but-IllegalArgumentException-tp4719896p4725659.html
Sent from the Camel - Users mailing list archive at Nabble.com.




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


Re: cxfrs response headers

2011-08-23 Thread Willem Jiang

Hi

With the help of Reponse/ ResponseBuilder, you can build the response 
for the bookResource like this


 Response r = 
Response.status(200).entity(bookResource).header(xxx,xxx).build();

 exchange.getOut().setBody(r);

On 8/23/11 2:22 AM, bird bird wrote:

Hi all.

How do I set response headers when implementing REST using the CXFRS
component.  I am new and learning camel by developing a small bundle for my
own use.  I have developed services which return XML (from the exchange
body) when the requests cannot be serviced I use the class
javax.ws.rs.core.Response to return a status code.  All working, followed
example as http://camel.apache.org/cxfrs.html.

Using the Response / ResponseBuilder classes I can set headers in the http
response when in error, but my question is  how do I do this when returning
a successful payload. i.e status 200 with the XML in the body i.e.
exchange.getOut().setBody(bookResource).  Following the principles of REST
it is quite common to set the response Location: and Content-Location:
headers in the URL of the resource.

Any ideas - loving camel/EIP,

Rango.




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


Re: inProgressRepository not cleaned in GenericFileEndpoint ?

2011-08-23 Thread aurelienmasse
Hello Claus

Ok i've found the problem, it appeared to be a simple mistake on my code.
It works perfectly now using the ConsumerTemplate.

Thanks a lot for your help and for the time you spent.



--
View this message in context: 
http://camel.465427.n5.nabble.com/inProgressRepository-not-cleaned-in-GenericFileEndpoint-tp4722713p4725854.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using a drools server in a route?

2011-08-23 Thread Willem Jiang

Drool is just using the camel processor to integrate it with Camel.
Your drool bean way is another solution which is more easy way to expose 
the drool service to camel route.


I'm not sure why do you choice camel-cxf component, can you explain more 
about it ?



On 8/23/11 8:33 AM, dunnlow wrote:

First, I'm pretty new to camel (and drools) and this question teeters between
the two.  I've combed the Drools forum for an answer to this question, but
the discussions there relate more to using camel within drools - they are
not camel centric.  So, my question:

I'm trying to find out the best best to integrate a call to a drools server
into my camel route.

I stood up a drools server and I can send a java bean to it via small java
client app that builds the drools command then makes a call to the rest
service (using HTTPClient).  The drools server looks at a few bean
attributes, sets a field accordingly and returns the result which I can
read.

Now, I'd like my camel application to use that service (basically a Content
Enricher) -- and I'll probably eventually route differently depending on the
return.  I believe I can move the code that builds the drools command, etc.
from my little client app and into a method in my Bean.  Then, I'd call that
bean method to send the response and another method to unmarshall/convert
it, like
...beanRef(myBean,sendToDrools).beanRef(myBean,convertDroolsResponse)

It seems like I could use the cxf component to handle some of the data
transfer, but it seems like I would still need to build the drools command
and convert the results.

Isn't there a cleaner/better way?  I've looked at the camel section in the
drools integration guide, but no help.

Any thoughts, best practices or references?

Thanks very much,
-J






--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-a-drools-server-in-a-route-tp4724999p4724999.html
Sent from the Camel - Users mailing list archive at Nabble.com.




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


setHeader using xpath returns Object?

2011-08-23 Thread heinrichheine
Hi,

i'm building my first route using the java DSL and i'm running in a small
trouble setting a header field.

I had a spring route looking and working like this:

camel:setHeader headerName=incomingDate
 camel:xpath
resultType=java.lang.String//incoming:Value[1]/@date/camel:xpath
/camel:setHeader

I want to build exactly the same in the java dsl:

 .setHeader(incomingDate)
 .xpath(//incoming:Value[1]/@date, String.class, ns)

The problem is, that xpath returns an Object, so i cannot continue
configuring my route from this point.
I want to put a choice as next step in the route, but thats not working
because xpath returns an Object.
And also i get a compiler warning due to type safety.
Does anyone have an idea for this?

Thanks in advance

 martin



--
View this message in context: 
http://camel.465427.n5.nabble.com/setHeader-using-xpath-returns-Object-tp4726154p4726154.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: i use wsdl file and payload dataFormat, but IllegalArgumentException

2011-08-23 Thread xiangqiuzhao
i need to invoke service operationName decide by program logic.

so i want to config the URI point the service address and not appoint the
special operationName.

but how to know the namespace and the webservice wsdl:message by camel? if i
appoint the operationName, 
why camel can't know the wsdl:message that i want to send?

--
View this message in context: 
http://camel.465427.n5.nabble.com/i-use-wsdl-file-and-payload-dataFormat-but-IllegalArgumentException-tp4719896p4726155.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: setHeader using xpath returns Object?

2011-08-23 Thread Freeman Fang

Hi,

It should be

setHeader(incomingDate, xpath(//incoming:Value[1]/@date,  
String.class, ns))


but not
setHeader(incomingDate)
.xpath(//incoming:Value[1]/@date, String.class, ns)


Freeman
On 2011-8-23, at 下午5:43, heinrichheine wrote:


Hi,

i'm building my first route using the java DSL and i'm running in a  
small

trouble setting a header field.

I had a spring route looking and working like this:

camel:setHeader headerName=incomingDate
camel:xpath
resultType=java.lang.String//incoming:Value[1]/@date/camel:xpath
/camel:setHeader

I want to build exactly the same in the java dsl:

.setHeader(incomingDate)
.xpath(//incoming:Value[1]/@date, String.class, ns)

The problem is, that xpath returns an Object, so i cannot continue
configuring my route from this point.
I want to put a choice as next step in the route, but thats not  
working

because xpath returns an Object.
And also i get a compiler warning due to type safety.
Does anyone have an idea for this?

Thanks in advance

martin



--
View this message in context: 
http://camel.465427.n5.nabble.com/setHeader-using-xpath-returns-Object-tp4726154p4726154.html
Sent from the Camel - Users mailing list archive at Nabble.com.


-
Freeman Fang

FuseSource
Email:ff...@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com











Re: setHeader using xpath returns Object?

2011-08-23 Thread heinrichheine
Your totally right,

but if i do it, i get:
The method xpath(String) in the type BuilderSupport is not applicable for
the arguments (String, ClassString, Namespaces)

compile error.

--
View this message in context: 
http://camel.465427.n5.nabble.com/setHeader-using-xpath-returns-Object-tp4726154p4726222.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Stop a route for unit testing

2011-08-23 Thread Willem Jiang

Hi Christian,

I just played with your test case with Camel trunk code.
I found the test can be passed when you remove the route instead of stop 
the route.


Please update the setUp() code like this

context.removeRoute(Route2.class.getName());


On 8/23/11 4:36 AM, Christian Müller wrote:

Hello all!

I'm using Camel 2.6.0 (I got the same result with Camel 2.8.0).

I have a Camel context with two simple routes:

public class Route1 extends RouteBuilder {
 @Override
 public void configure() throws Exception {

from(file://src/test/data?noop=trueinitialDelay=5000).routeId(Route1.class.getName())
 .split(body().tokenize(,)) // the content is
1,2,3,4,5,6,7,8,9,0
 .to(activemq:queue:foo)
 .end();
 }
}

public class Route2 extends RouteBuilder {
 @Override
 public void configure() throws Exception {
 from(activemq:queue:foo).routeId(Route2.class.getName())
 .to(activemq:queue:bar);
 }
}

My Camel context look as following:

?xml version=1.0 encoding=UTF-8?
beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:camel=http://camel.apache.org/schema/spring;
 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;

bean id=route1 class=org.apache.cmueller.test.Route1 /

bean id=route2 class=org.apache.cmueller.test.Route2 /

bean id=activemq
class=org.apache.activemq.camel.component.ActiveMQComponent
property name=connectionFactory ref=connectionFactory /
/bean

bean id=connectionFactory
class=org.apache.activemq.pool.PooledConnectionFactory
constructor-arg
value=vm://localhost?broker.persistent=falseamp;broker.useJmx=false/
/bean

camel:camelContext trace=true
camel:routeBuilder ref=route1 /
camel:routeBuilder ref=route2 /
/camel:camelContext
/beans


I would like to test my Route1 implementation in isolation (without
Route2). Because of this, I need to stop Route2. But it doesn't work for
my with the following code:

public class Route1Test extends CamelSpringTestSupport {

 @EndpointInject(uri = mock:foo)
 private MockEndpoint mockEndpointFoo;

 @Override
 @Before
 public void setUp() throws Exception {
 super.setUp();

 DefaultRoute route2 = (DefaultRoute)
context.getRoute(Route2.class.getName());
 route2.stop();

 context.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(activemq:queue:foo)
 .to(mockEndpointFoo);
 }
 });
 }

 @Test
 public void test() throws Exception {
 mockEndpointFoo.expectedBodiesReceived(1, 2, 3, 4, 5,
6, 7, 8, 9, 0);

 mockEndpointFoo.assertIsSatisfied();
 }

 @Override
 protected AbstractApplicationContext createApplicationContext() {
 return new
ClassPathXmlApplicationContext(META-INF/spring/bundle-context.xml);
 }
}

Does have anybody an idea what I did wrong?

I attached my Eclipse sample project for convenience.

Best,
Christian



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


Re: CXF can't set the holder object into the message content list of the out message

2011-08-23 Thread Mick Knutson
Hmm. Thanks for helping me start to think about things.
So it looks like I was originally trying to do this:

1. take RS or WS Object into process method
2. wiretap Object into queue
3. write tapped Object to file
4. return from process method

So, what _should_ I do if all I want is to take an CXF RS Object in, then
add it to a queue which is part of a totally different flow?

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (855) BASE-LOGIC: (227-3564-42)
p. (478) BASE-LOGIC (227-3564-42)
f. (855) BASE-LOGIC: (227-3564-42)

Website: http://www.baselogic.com
Blog: http://www.baselogic.com/blog/
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
---



On Mon, Aug 22, 2011 at 9:11 PM, Willem Jiang willem.ji...@gmail.comwrote:

 Hi,

 It looks like your route doesn't consume the parameter of the message body
 from the camel-cxf consumer, and the CXF HolderOutInterceptor complains
 about it.

 You may need to set the response message in the MappingProcessor or add
 another processor after the wrieTap(INPUT_TAP).


 On 8/23/11 1:35 AM, Mick Knutson wrote:

 I am trying to modify the cxf example in the camel source to write the
 contents of the incoming CXF request object to a file:

 public static final String INPUT_TAP = seda:tap;
 public static final String WRITE_TO_FILE = direct:writeToFile;
 public static final String PROCESSED_FILE_DIR = file:target/reports;
 public static final String PROCESSED_FILE_NAME = processed-${in.header.+
 SESSION_ID +}.txt;

 // populate the message queue with some messages
 from(SOAP_ENDPOINT_URI)
 .process(new MappingProcessor(new BookStoreImpl(false)))
 .wireTap(INPUT_TAP)
 ;
 from(WRITE_TO_FILE).routeId(**WRITE_TO_FILE)
 .log(--WRITE_TO_FILE)
 .setHeader(Exchange.FILE_NAME,
 constant(PROCESSED_FILE_NAME))
 .to(PROCESSED_FILE_DIR)
 ;
 from(INPUT_TAP).routeId(**INPUT_TAP)
 .log(--INPUT_TAP)
 .multicast()
 .to(WRITE_TO_FILE)
 ;


 I keep getting this error:

 [qtp25163668-15] HolderOutInterceptor   ERROR The
 message content list of the in message and out message are same, CXF can't
 set the holder object into the message content list of the out message.

 and no files are written

 I have spent the entire day trying to get this simple example to work and
 feel I have not made any progress. I really would appreciate some
 assistance
 with this.



 ---
 Thank You…

 Mick Knutson, President

 BASE Logic, Inc.
 Enterprise Architecture, Design, Mentoring  Agile Consulting
 p. (855) BASE-LOGIC: (227-3564-42)
 p. (478) BASE-LOGIC (227-3564-42)
 f. (855) BASE-LOGIC: (227-3564-42)

 Website: http://www.baselogic.com
 Blog: http://www.baselogic.com/blog/
 Linked IN: 
 http://linkedin.com/in/**mickknutsonhttp://linkedin.com/in/mickknutson
 Twitter: http://twitter.com/mickknutson
 ---



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



Filtering of mbeans in mbean server of camel

2011-08-23 Thread Sachin
I have configured camel jmx to combine with my application's jmx console by
doing the below configuration in camel-context.xml

jmxAgent id=JMXAgent disabled =false statisticsLevel=Off
createConnector = false mbeanServerDefaultDomain=MyApplication
usePlatformMBeanServer=false/

I am successful in doing this. 

This is how it is getting displayed in my application's jmx console(see
below).

My requirement is to filter on required type and show only those mbeans on
console. Example i want to see only mbeans of routes. 
Is this can be done? 

Appreciate your help

# org.apache.camel

* context=BLRGT24/camel,type=components,name=ActiveMQ
* context=BLRGT24/camel,type=components,name=direct
* context=BLRGT24/camel,type=components,name=file
* context=BLRGT24/camel,type=components,name=http
* context=BLRGT24/camel,type=components,name=mina
* context=BLRGT24/camel,type=consumers,name=DirectConsumer(0x33528d)
* context=BLRGT24/camel,type=consumers,name=DirectConsumer(0xbb50e0)
* context=BLRGT24/camel,type=consumers,name=JmsConsumer(0x16231b4)
* context=BLRGT24/camel,type=context,name=camel
* context=BLRGT24/camel,type=endpoints,name=ActiveMQ://queue:BFInQueue
*
context=BLRGT24/camel,type=endpoints,name=ActiveMQ://queue:BFReqQueue
*
context=BLRGT24/camel,type=endpoints,name=ActiveMQ://queue:BFResQueue
* context=BLRGT24/camel,type=endpoints,name=direct://requestQueue
* context=BLRGT24/camel,type=endpoints,name=direct://responseQueue
* context=BLRGT24/camel,type=endpoints,name=file://E:/Alternate/
*
context=BLRGT24/camel,type=endpoints,name=http://localhost:8080/bfweb;
*
context=BLRGT24/camel,type=endpoints,name=mina://tcp://localhost:\?timeout=5000
* context=BLRGT24/camel,type=endpoints,name=spring-event://default
*
context=BLRGT24/camel,type=errorhandlers,name=DefaultErrorHandlerBuilder(ref:CamelDefaultErrorHandlerBuilder)
* context=BLRGT24/camel,type=processors,name=bean1
* context=BLRGT24/camel,type=processors,name=bean2
* context=BLRGT24/camel,type=processors,name=bean3
* context=BLRGT24/camel,type=processors,name=bean4
* context=BLRGT24/camel,type=processors,name=bean5
* context=BLRGT24/camel,type=processors,name=to1
* context=BLRGT24/camel,type=processors,name=to2
* context=BLRGT24/camel,type=routes,name=consumer1
* context=BLRGT24/camel,type=routes,name=producer
* context=BLRGT24/camel,type=routes,name=producer1
*
context=BLRGT24/camel,type=services,name=DefaultExecutorServiceStrategy(0x137019c)
*
context=BLRGT24/camel,type=services,name=DefaultInflightRepository(0x1bc369c)
*
context=BLRGT24/camel,type=services,name=DefaultShutdownStrategy(0x10f7374)
* context=BLRGT24/camel,type=services,name=ProducerCache(0x102dd19)
* context=BLRGT24/camel,type=services,name=ProducerCache(0x37a3ed)
*
context=BLRGT24/camel,type=services,name=SharedProducerServicePool(0x1af1c4d)
*
context=BLRGT24/camel,type=threadpools,name=DefaultErrorHandler(0x17b1b46)
* context=BLRGT24/camel,type=threadpools,name=MinaComponent(0x169a4ce)
* context=BLRGT24/camel,type=tracer,name=Tracer(0xfc6ed7) 

--
View this message in context: 
http://camel.465427.n5.nabble.com/Filtering-of-mbeans-in-mbean-server-of-camel-tp4726520p4726520.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Occational NPE in CamelNamespaceHandler

2011-08-23 Thread Paul Nyheim
Hi.
Occationally I get a NPE that seems related to CamelNamespaceHandler
when running under Java 7. Switching back to Java 6 I don't seem to
get this problem.

The problem seems very similar to the one from this thread
http://camel.465427.n5.nabble.com/Occasional-CamelNamespaceHandler-exception-when-running-with-Spring-DM-1-2-tt476984.html
, however as the thread is quite old, I would like to know if anyone
else has experienced this, and how to avoid it.

My setup is a Grails 1.3.7 Application, using Camel 2.8.0, jdk1.7.0

I have a camelContext configured in the spring resources.xml like this:

  camel:camelContext id=camel
camel:routeBuilder ref=eventReceiverRouteBuilder /
  /camel:camelContext

I also get the same error if I try to configure it in resources.groovy
like this:

 xmlns camel: 'http://camel.apache.org/schema/spring'

camel{
camelContext(id:camel){
routeBuilder(ref:eventReceiverRouteBuilder)
}
}

Relevant parts of stacktrace: (complete stacktrace posted here:
http://pastebin.com/b88JZx6z )

2011-08-23 14:53:20,918 [main] WARN  spring.GrailsRuntimeConfigurator
- [RuntimeConfiguration] Unable to perform post initialization config:
/WEB-INF/spring/resources.xml
org.springframework.beans.factory.BeanDefinitionStoreException:
Unexpected exception parsing XML document from URL
[file:./grails-app/conf/spring/resources.xml]; nested exception is
java.lang.NullPointerException
at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at 
org.springframework.beans.factory.xml.XmlBeanFactory.init(XmlBeanFactory.java:73)
..
Caused by: java.lang.NullPointerException
at 
com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.checkOverrideProperties(ClassBeanInfoImpl.java:190)
at 
com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.init(ClassBeanInfoImpl.java:171)
at 
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
at 
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)
..
at javax.xml.bind.ContextFinder.find(ContextFinder.java:347)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:431)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:394)
at 
org.apache.camel.spring.handler.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:185)
at 
org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:172)
at 
org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:300)
at 
org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:85)

Regards,
Paul Nyheim


Re: log4j.properties in camel

2011-08-23 Thread Daniel Kulp

Another option would be to move the restricted log4j.properties file into 
something like src/test/log4j  and then add a system property to surefire 
configuration to pick it up from there.   When running with maven, it would be 
used.   When running in your IDE, it wouldn't be picked up and the default 
log4j stuff.

Another option MIGHT be to change to using slf4j-jdk14 instead of log4j in 
combination with the above.   By default, the jul stuff doesn't really pick up 
a config file so in the IDE, you get INFO level and stuff printed.   By 
passing in the properties file via maven surefire config, maven can use a more 
restricted one.   This is somewhat what CXF does.  (although CXF uses jul 
natively, but does use slf4j-jdk14 for the stuff that needs it) 

I definitely agree that when running in the IDE, I would like to see the logs 
on the console.

Dan


On Monday, August 22, 2011 9:03:41 AM bvahdat wrote:
 Hi,
 
 while running the camel's own test cases one can't see the logs directly in
 his IDE as always the 'org.apache.log4j.FileAppender' is used/active in
 log4j.properties under camel-xyz/src/test/resources/log4j.properties. So you
 always have to switch from your IDE to the redirected outputs in
 target/camel-xyz-test.log to see the logs. To me this was annoying but don't
 know what others think about it. Other than that while changing/working on
 the camel code  running the unit-tests the Camel Riders would prefer to
 see the logs directly in their IDE, I assume!
 
 On the other hand, I think the reason for that was not to flood the maven
 console while doing 'mvn test', 'mvn install', etc. right?
 
 IMHO I think one can change them to out instead of file, that's
 
 log4j.rootLogger='LOG_LEVEL', out
 
 But instruct sunfire-plugin in [1] (a pluginManagment entry in there) to
 redirect the output to files through the option [2].
 
 Would it make sense to you? At least that's the way I do it by my client's
 projects.
 
 [1] https://svn.apache.org/repos/asf/camel/trunk/parent/pom.xml
 [2]
 http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#redirec
 tTestOutputToFile
 
 Regards, Babak
 
 --
 View this message in context:
 http://camel.465427.n5.nabble.com/log4j-properties-in-camel-tp4723887p47238
 87.html Sent from the Camel - Users mailing list archive at Nabble.com.
-- 
Daniel Kulp
dk...@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com


Re: Using a drools server in a route?

2011-08-23 Thread Willem Jiang

On 8/23/11 8:21 PM, dunnlow wrote:

Thanks for your response.  My application is a web-based, stand-alone Camel
Spring application.  I have a separate server for Drools that should:
receive pojo beans from my Camel app via web service, run my business rules,
then return the result to my Camel app.

My thought on the cxf component is to use it rather than using code in my
bean to handle communication with the drools web service.  Does this seem
like correct usage?
I don't think it's a good idea, unless the drools web service only has 
few operations like execute etc.
Because you should know the operation and prepare the parameter before 
sending the request from camel-cxf component.




Thanks again for any insight.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-a-drools-server-in-a-route-tp4724999p4726590.html
Sent from the Camel - Users mailing list archive at Nabble.com.




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


Re: CXF can't set the holder object into the message content list of the out message

2011-08-23 Thread Willem Jiang

Hi Mick,

I just committed a simple unit test[1] into camel-cxf, you make take a 
look and add the missing part that you need.


[1]http://svn.apache.org/viewvc?rev=1160701view=rev

On 8/23/11 7:43 PM, Mick Knutson wrote:

Hmm. Thanks for helping me start to think about things.
So it looks like I was originally trying to do this:

1. take RS or WS Object into process method
2. wiretap Object into queue
3. write tapped Object to file
4. return from process method

So, what _should_ I do if all I want is to take an CXF RS Object in, then
add it to a queue which is part of a totally different flow?

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (855) BASE-LOGIC: (227-3564-42)
p. (478) BASE-LOGIC (227-3564-42)
f. (855) BASE-LOGIC: (227-3564-42)

Website: http://www.baselogic.com
Blog: http://www.baselogic.com/blog/
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
---



On Mon, Aug 22, 2011 at 9:11 PM, Willem Jiangwillem.ji...@gmail.comwrote:


Hi,

It looks like your route doesn't consume the parameter of the message body
from the camel-cxf consumer, and the CXF HolderOutInterceptor complains
about it.

You may need to set the response message in the MappingProcessor or add
another processor after the wrieTap(INPUT_TAP).


On 8/23/11 1:35 AM, Mick Knutson wrote:


I am trying to modify the cxf example in the camel source to write the
contents of the incoming CXF request object to a file:

 public static final String INPUT_TAP = seda:tap;
public static final String WRITE_TO_FILE = direct:writeToFile;
 public static final String PROCESSED_FILE_DIR = file:target/reports;
public static final String PROCESSED_FILE_NAME = processed-${in.header.+
SESSION_ID +}.txt;

 // populate the message queue with some messages
 from(SOAP_ENDPOINT_URI)
 .process(new MappingProcessor(new BookStoreImpl(false)))
 .wireTap(INPUT_TAP)
 ;
 from(WRITE_TO_FILE).routeId(**WRITE_TO_FILE)
 .log(--WRITE_TO_FILE)
 .setHeader(Exchange.FILE_NAME,
constant(PROCESSED_FILE_NAME))
 .to(PROCESSED_FILE_DIR)
 ;
 from(INPUT_TAP).routeId(**INPUT_TAP)
 .log(--INPUT_TAP)
 .multicast()
 .to(WRITE_TO_FILE)
 ;


I keep getting this error:

[qtp25163668-15] HolderOutInterceptor   ERROR The
message content list of the in message and out message are same, CXF can't
set the holder object into the message content list of the out message.

and no files are written

I have spent the entire day trying to get this simple example to work and
feel I have not made any progress. I really would appreciate some
assistance
with this.



---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring   Agile Consulting
p. (855) BASE-LOGIC: (227-3564-42)
p. (478) BASE-LOGIC (227-3564-42)
f. (855) BASE-LOGIC: (227-3564-42)

Website: http://www.baselogic.com
Blog: http://www.baselogic.com/blog/
Linked IN: 
http://linkedin.com/in/**mickknutsonhttp://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
---




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






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


Maven dependencies for camel-ftp

2011-08-23 Thread Tristan23
I made a simple example using Camels FTP component. For that I added
  artifactIdcamel-ftp/artifactId
to my pom.xml file.

Unfortunately when running the code I got some strange error messages.

What solved the problem was adding an additional line to my pom.xml file:
  artifactIdcamel-spring/artifactId

Question: Why does Maven not automatically add this dependency when using
camel-ftp ?

cheers,
T.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Maven-dependencies-for-camel-ftp-tp4727138p4727138.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Maven dependencies for camel-ftp

2011-08-23 Thread Jon Anstey
What was the error message and what Camel version are you using? camel-ftp
shouldn't require camel-spring.

On Tue, Aug 23, 2011 at 12:45 PM, Tristan23 tristanlst...@gmail.com wrote:

 I made a simple example using Camels FTP component. For that I added
  artifactIdcamel-ftp/artifactId
 to my pom.xml file.

 Unfortunately when running the code I got some strange error messages.

 What solved the problem was adding an additional line to my pom.xml file:
  artifactIdcamel-spring/artifactId

 Question: Why does Maven not automatically add this dependency when using
 camel-ftp ?

 cheers,
 T.

 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Maven-dependencies-for-camel-ftp-tp4727138p4727138.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Cheers,
Jon
---
FuseSource
Email: j...@fusesource.com
Web: fusesource.com
Twitter: jon_anstey
Blog: http://janstey.blogspot.com
Author of Camel in Action: http://manning.com/ibsen


Camel No XPathfactory Implementation error.

2011-08-23 Thread jackkirsten
Hi, I'm using WebSphere 6.1.0.29 on AIX trying to run Camel 2.6 on it.  I'm
getting following exceptions when the app server starts. It seems like I
have some conflicts with xerces ml-apis jars.

[8/23/11 13:29:52:848 EDT] 0016 WebAppE   Exception caught while
initializing context
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route route1
at:  Transacted[ref:null]  in route:
Route[[From[jmsStartCamel:StartCamelProcess]] - [OnExceptio... becaus
e of XPathFactory#newInstance() failed to create an XPathFactory for the
default object model: http://java.sun.com/jaxp/xpath/dom with the
XPathFactoryConfigurationException:
javax.xml.xpath.XPathFactoryConfigurationException: No
XPathFctory implementation found for the object model:
http://java.sun.com/jaxp/xpath/dom
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:237)
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:274)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at
com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:653)
at
com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:370)
at
com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:293)
at
com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:93)
at
com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:162)
at
com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:673)
at
com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:626)
at
com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)
at
com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)
at
com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1250)
at
com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1140)
at
com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)
at
com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:819)
at
com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:921)
at
com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2100)
at
com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)


I'm using these versions of jar files in WEB-INF/lib folder.

xercesImpl-2.9.1.jar
xml-apis-1.3.04.jar
jaxb-xercesImpl-1.5.jar

From the class loader stand-point, I have set to PARENT_LAST (i.e.,
application first).

How do I fix this xpathfactory error?  Thanks for your help.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-No-XPathfactory-Implementation-error-tp4727601p4727601.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Recursive Property Placeholder

2011-08-23 Thread Raji
It would be nice to have the Property Placeholder support recursive
substitution. I use this feature in Spring to configure properties for
various environments. For example:

db.URL= ${${env}.db.URL}

dev.db.URL=jdbc:jtds:sqlserver://S08DX01:7531/UserAcnt
test.db.URL=jdbc:jtds:sqlserver://S08DXK01:1433/UserAcnt
prod.db.URL=jdbc:jtds:sqlserver://S08DXJ01:8413/UserAcnt

Then in the JVM launch I just have to use -Denv=dev for the dev environment.
But this concept does not work for the Camel Property Place Holder.  I tried
to invoke Spring's Place Holder using the Endpoint URI option but there also
it fails.

I can achieve something similar by using the Spring Placeholder to specify
the name of the properties file for the different environment:

propertyPlaceholder id=properties
location=classpath:${env}-file-poll.properties/

and then have three separate properties file dev-file-poll.properties,
test-file-poll.properties,etc. 

I am trying to avoid creating separate properties file for this as it
becomes a maintenance headache. Probably using the Registry or the Blueprint
services I can achieve similar results. Any other options?

Thanks
Raji

--
View this message in context: 
http://camel.465427.n5.nabble.com/Recursive-Property-Placeholder-tp4727692p4727692.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Recursive Property Placeholder

2011-08-23 Thread boday
the best way that I've found to do this is to use a default file for common
props and just override the differences in an environment specific file. 
Spring has support for this...

   bean id=propertyPlaceholderConfigurer
class=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
property name=ignoreResourceNotFound value=true /
property name=locations
list
   
valueclasspath:/environments/default.properties/value
valueclasspath:/environments/${env}.properties/value
 ...

then, you can run your app using -Denv=dev, etc...


Raji wrote:
 
 It would be nice to have the Property Placeholder support recursive
 substitution. I use this feature in Spring to configure properties for
 various environments. For example:
 
 db.URL= ${${env}.db.URL}
 
 dev.db.URL=jdbc:jtds:sqlserver://S08DX01:7531/UserAcnt
 test.db.URL=jdbc:jtds:sqlserver://S08DXK01:1433/UserAcnt
 prod.db.URL=jdbc:jtds:sqlserver://S08DXJ01:8413/UserAcnt
 
 Then in the JVM launch I just have to use -Denv=dev for the dev
 environment. But this concept does not work for the Camel Property Place
 Holder.  I tried to invoke Spring's Place Holder using the Endpoint URI
 option but there also it fails.
 
 I can achieve something similar by using the Spring Placeholder to specify
 the name of the properties file for the different environment:
 
 propertyPlaceholder id=properties
 location=classpath:${env}-file-poll.properties/
 
 and then have three separate properties file dev-file-poll.properties,
 test-file-poll.properties,etc. 
 
 I am trying to avoid creating separate properties file for this as it
 becomes a maintenance headache. Probably using the Registry or the
 Blueprint services I can achieve similar results. Any other options?
 
 Thanks
 Raji
 


-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Recursive-Property-Placeholder-tp4727692p4727819.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel Validator Eats the Message

2011-08-23 Thread dougman82
Hello all,

Just to be quick, I've got a camel route that looks something like this:

route id=myRoute
   from uri=blahblah /
   to uri=anEndpointThatGivesAResponse /
   to uri=xslt:/path/to/transform /
/route

Basically, a message is delivered to an endpoint and a response is received
which is then transformed using an XSL stylesheet, and the result is given
back to the original requester. This works just fine.

My new requirement is to add an XML schema validation step:

route id=myRoute
   from uri=blahblah /
   to uri=anEndpointThatGivesAResponse /
   to uri=xslt:/path/to/transform /
   to uri=validator:/path/to/schema/file /
/route

When I add that last step to the route, the XML message is successfully
validated, but in the process, the message gets eaten. It seems that the
validation step stops the route, and the original requester gets nothing
back.

I'm hoping I have overlooked something very basic about Camel. Any thoughts?

By the way, I am using Camel 2.6 with Spring 3.0.5.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Validator-Eats-the-Message-tp4728003p4728003.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Validator Eats the Message

2011-08-23 Thread Mirko Caserta
Hi,
try to enable stream caching:

http://camel.apache.org/stream-caching.html

It has worked for me with disappearing messages :)

Mirko

On Tue, Aug 23, 2011 at 9:47 PM, dougman82 dougma...@gmail.com wrote:
 Hello all,

 Just to be quick, I've got a camel route that looks something like this:

 route id=myRoute
   from uri=blahblah /
   to uri=anEndpointThatGivesAResponse /
   to uri=xslt:/path/to/transform /
 /route

 Basically, a message is delivered to an endpoint and a response is received
 which is then transformed using an XSL stylesheet, and the result is given
 back to the original requester. This works just fine.

 My new requirement is to add an XML schema validation step:

 route id=myRoute
   from uri=blahblah /
   to uri=anEndpointThatGivesAResponse /
   to uri=xslt:/path/to/transform /
   to uri=validator:/path/to/schema/file /
 /route

 When I add that last step to the route, the XML message is successfully
 validated, but in the process, the message gets eaten. It seems that the
 validation step stops the route, and the original requester gets nothing
 back.

 I'm hoping I have overlooked something very basic about Camel. Any thoughts?

 By the way, I am using Camel 2.6 with Spring 3.0.5.

 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-Validator-Eats-the-Message-tp4728003p4728003.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel Validator Eats the Message

2011-08-23 Thread dougman82
Ok, I tried giving the stream caching a go, both on the route level, and on
the Camel context level, and neither seemed to alleviate the issue.

Just out of curiosity, I added another step in the route in which the
message gets sent to a method of a Java bean. The method does nothing but
return the very message that it receives (a crude pass-through). When I do
this, the message makes it all the way through and gets received by the
requester. Why would the validator endpoint function one way in the middle
of the route, but differently if it's at the end of the route?



Mirko Caserta wrote:
 
 Hi,
 try to enable stream caching:
 
 http://camel.apache.org/stream-caching.html
 
 It has worked for me with disappearing messages :)
 
 Mirko
 
 On Tue, Aug 23, 2011 at 9:47 PM, dougman82 lt;dougma...@gmail.comgt;
 wrote:
 Hello all,

 Just to be quick, I've got a camel route that looks something like this:

 route id=myRoute
   from uri=blahblah /
   to uri=anEndpointThatGivesAResponse /
   to uri=xslt:/path/to/transform /
 /route

 Basically, a message is delivered to an endpoint and a response is
 received
 which is then transformed using an XSL stylesheet, and the result is
 given
 back to the original requester. This works just fine.

 My new requirement is to add an XML schema validation step:

 route id=myRoute
   from uri=blahblah /
   to uri=anEndpointThatGivesAResponse /
   to uri=xslt:/path/to/transform /
   to uri=validator:/path/to/schema/file /
 /route

 When I add that last step to the route, the XML message is successfully
 validated, but in the process, the message gets eaten. It seems that the
 validation step stops the route, and the original requester gets nothing
 back.

 I'm hoping I have overlooked something very basic about Camel. Any
 thoughts?

 By the way, I am using Camel 2.6 with Spring 3.0.5.

 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-Validator-Eats-the-Message-tp4728003p4728003.html
 Sent from the Camel - Users mailing list archive at Nabble.com.

 


--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Validator-Eats-the-Message-tp4728003p4728117.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Validator Eats the Message

2011-08-23 Thread Christian Müller
Could you try:

route id=myRoute
  from uri=blahblah /
  to uri=anEndpointThatGivesAResponse /
  to uri=xslt:/path/to/transform /
  to uri=validator:/path/to/schema/file /
  transform /
/route


Best,
Christian


Re: CXF can't set the holder object into the message content list of the out message

2011-08-23 Thread Mick Knutson
Thanks for the test case, but I am having issues following it as it pertains
to the original example.

Here is the processor from the original:

private class MappingProcessor implements Processor {

private Class? beanClass;
private Object instance;

public MappingProcessor(Object obj) {
beanClass = obj.getClass();
instance = obj;
}

public void process(Exchange exchange) throws Exception {
String operationName =
exchange.getIn().getHeader(CxfConstants.OPERATION_NAME, String.class);
Method method = findMethod(operationName,
exchange.getIn().getBody(Object[].class));
try {
Object response = method.invoke(instance,
exchange.getIn().getBody(Object[].class));
if (response instanceof CallEvent) {
logger.info(we have a CallEvent);
}
exchange.getOut().setBody(response);
} catch (InvocationTargetException e) {
throw (Exception) e.getCause();
}
}

private Method findMethod(String operationName, Object[] parameters)
throws SecurityException, NoSuchMethodException {
return beanClass.getMethod(operationName,
getParameterTypes(parameters));
}

private Class?[] getParameterTypes(Object[] parameters) {
if (parameters == null) {
return new Class[0];
}
Class?[] answer = new Class[parameters.length];
int i = 0;
for (Object object : parameters) {
answer[i] = object.getClass();
i++;
}
return answer;
}
}


And I still get the error
HolderOutInterceptor   ERROR The message content list of the in
message and out message are same, CXF can't set the holder object into the
message content list of the out message.


So far I was able to get a custom Object sent into my seda:tap like:


from(Routes.INPUT_TAP).routeId(INPUT_TAP)
.doTry()
.log(--INPUT_TAP)
.marshal().json()
.to(Routes.INPUT_MARSHALED)
.doCatch(Exception.class)
.bean(ExceptionProcessor.class,
ExceptionProcessor.HANDLE_MARSHAL_ERROR)
.end()
;


and this is the json I get:

*{org.apache.cxf.message.MessageContentsList*
:{@serialization:custom,unserializable-parents:,list:{default:{size:1},int:6,com.comcast.ivr.integration.domain.CallEvent:{browserType:AVAYA,dasSessionId:JAXWS-2-d46502d4-23c2-4cbf-b517-808a2674e1a8,applicationType:AGENT,ani:1234567890,dnis:0987654321,languageSelected:ENGLISH,callEndReason:CALLER_HUNGUP,functionalArea:PRE_MAIN_MENU,startTime:0,endTime:0

I thought I would get something like (or similar to):


*{com.comcast.ivr.integration.domain.CallEvent*
:{browserType:AVAYA,dasSessionId:JAXWS-2-d46502d4-23c2-4cbf-b517-808a2674e1a8,applicationType:AGENT,ani:1234567890,dnis:0987654321,languageSelected:ENGLISH,callEndReason:CALLER_HUNGUP,functionalArea:PRE_MAIN_MENU,startTime:0,endTime:0}}


---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (855) BASE-LOGIC: (227-3564-42)
p. (478) BASE-LOGIC (227-3564-42)
f. (855) BASE-LOGIC: (227-3564-42)

Website: http://www.baselogic.com
Blog: http://www.baselogic.com/blog/
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
---



On Tue, Aug 23, 2011 at 10:10 AM, Willem Jiang willem.ji...@gmail.comwrote:

 Hi Mick,

 I just committed a simple unit test[1] into camel-cxf, you make take a look
 and add the missing part that you need.

 [1]http://svn.apache.org/**viewvc?rev=1160701view=revhttp://svn.apache.org/viewvc?rev=1160701view=rev


 On 8/23/11 7:43 PM, Mick Knutson wrote:

 Hmm. Thanks for helping me start to think about things.
 So it looks like I was originally trying to do this:

 1. take RS or WS Object into process method
 2. wiretap Object into queue
 3. write tapped Object to file
 4. return from process method

 So, what _should_ I do if all I want is to take an CXF RS Object in, then
 add it to a queue which is part of a totally different flow?

 ---
 Thank You…

 Mick Knutson, President

 BASE Logic, Inc.
 Enterprise Architecture, Design, Mentoring  Agile Consulting
 p. (855) BASE-LOGIC: (227-3564-42)
 p. (478) BASE-LOGIC (227-3564-42)
 f. (855) BASE-LOGIC: (227-3564-42)

 Website: http://www.baselogic.com
 Blog: http://www.baselogic.com/blog/
 Linked IN: 
 http://linkedin.com/in/**mickknutsonhttp://linkedin.com/in/mickknutson
 Twitter: http://twitter.com/mickknutson
 ---



 On Mon, Aug 22, 2011 at 9:11 PM, Willem Jiangwillem.ji...@gmail.com**
 wrote:

  Hi,

 It looks like your route doesn't consume the parameter of the message
 body
 from the camel-cxf consumer, and the CXF HolderOutInterceptor complains
 about it.

 You may need to set 

DeadLetterChannel useOriginalMessage Behaviour

2011-08-23 Thread devram
Hi,

I have a camel route which reads xml messages from a jms queue, performs a
series of steps (decrypts, transforms, enriches, etc.) to the message and
then finally persists the updated object to a database.  What I'm trying to
do now is configure a dead letter queue which will route the */original/*
message recieved from the jms endpoint (which is the xml message) to an
error queue, but having some difficulty accomplishing this in my route.

I'm using camel 2.8 and here is my context:

  camel:camelContext id=globalCamelContext errorHandlerRef=defaultEH
camel:errorHandler id=defaultEH /
camel:errorHandler id=deadLetterEH type=DeadLetterChannel
deadLetterUri=direct:dealLetterChannel
useOriginalMessage=true /

camel:endpoint id=jmsMQReceiverEndPoint
   
uri=jms:queue:receiver?testConnectionOnStartup=trueamp;disableReplyTo=trueamp;exchangePattern=InOnly
/
camel:endpoint id=jmsMQErrorEndPoint
   
uri=jms:queue:$error?testConnectionOnStartup=trueamp;disableReplyTo=true
/

camel:route id=messageRoute errorHandlerRef=deadLetterEH 
  camel:from ref=jmsMQReceiverEndPoint / 
  camel:log message=Request message came ${id} ${body} /
  camel:to uri=bean:Marshaller?method=processPayload / 
  camel:to uri=bean:Converter?method=processPayload / 
  camel:to uri=bean:Enricher?method=processPayload / 
  camel:to uri=bean:Persister?method=processPayload / 
/camel:route

camel:route id=deadLetterRoute 
  camel:from uri=direct:dealLetterChannel /
  camel:log message=Message in error: ${id} ${body} /
  camel:to ref=jmsMQErrorEndPoint /
/camel:route 
  /camel:camelContext

Let's say an exception occurs at the Persister step, what ends up happening
is the POJO that was passed in to the Persister step is picked up by the
deadLetterHandler instead of the xml message which I want.  How can I
configure my route to pass the original xml message received from the jms
end point to the deadletterhandler when exceptions occur?  Based on what
I've read in the CamelInAction Book (chapter 5), Wiki page
(DeadLetterChannel  Error Handling section)  on this site; it would seem
all I needed to do was set useOriginalMessage to true, but that didn't
work...any help would be appreciated.

--
View this message in context: 
http://camel.465427.n5.nabble.com/DeadLetterChannel-useOriginalMessage-Behaviour-tp4728373p4728373.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: JMS Websphere MQ Error - MQJE001: Completion Code 2, Reason 2027

2011-08-23 Thread devram
Thanks All.

Changing the receiver endpoint to use an InOnly exchange pattern solved
the problem. E.g. - 

camel:endpoint id=jmsMQReceiverEndPoint 
   
uri=jmsQueue:queue:${mq.receiver.queue}?testConnectionOnStartup=trueamp;disableReplyTo=trueamp;exchangePattern=InOnly
/


--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Websphere-MQ-Error-MQJE001-Completion-Code-2-Reason-2027-tp4713509p4728417.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Socket-based Asynchronous Calls...

2011-08-23 Thread James Carman
Well, it looks like the camel-netty component won't work for me.  It
appears that it opens the connection for each exchange.  Am I reading
that right?  What I need is a persistent connection with automatic
reconnects.  Oh well, back to the drawing board.

On Wed, Aug 17, 2011 at 7:59 AM, James Carman
ja...@carmanconsulting.com wrote:
 That's what I've been staring at! :)  Here's what I'm thinking I'm
 going to need to write.  I need an async processor that remembers the
 AsyncCallback and associates it with a correlation id.  Then, when
 another exchange comes in that has the same correlation id, it will
 lookup the previous callback and say that it's done.  I have a lot of
 questions, though.  I've never had to get so down and dirty with
 Camel before.  The components have just worked for me off the shelf.

 1.  Do I just copy the input message of the Exchange that comes in
 second to the output message of the originating exchange?
 2.  How do I do a timeout for the original caller (the CXF request)?
 3.  How do I detect that the caller has timed out if they do?

 I'm sure I'll have more questions, but these are the ones off the top
 of my head.

 On Wed, Aug 17, 2011 at 1:48 AM, Taariq Levack taar...@gmail.com wrote:
 James I think the rest of your puzzle is solved by Camel's async API,
 you might have to check if your task is done, maybe your
 requestResponse populates some collection of responses and provides
 some API to return the response given a correlationID.
 Stare at the async docs [1] a few more times and I'm sure you'll find
 your answer.

 [1] http://camel.apache.org/async.html

 Taariq

 On Tue, Aug 16, 2011 at 11:16 PM, James Carman
 ja...@carmanconsulting.com wrote:
 No worries!  Thank you for your help.  It helped me understand a bit
 more about how these aggregators work..  However, I still don't
 understand how to take care of my problem.  I guess I'm going to have
 to roll my own processor or something.

 On Tue, Aug 16, 2011 at 4:50 PM, Taariq Levack taar...@gmail.com wrote:
 Hmmm.
 Maybe others can help with that if it's possible, I haven't had to wrestle 
 with it.

 In my case it is actually a cxf service too, but it's asynchronous  and I 
 send the response once I have it, indicating either timeout or the actual 
 response.

 Sorry I responded to your question without going back to see your other 
 posts.

 Taariq

 On 16 Aug 2011, at 10:33 PM, James Carman ja...@carmanconsulting.com 
 wrote:

 In my case, the originating request comes from CXF.  How do I send the
 aggregated response back to CXF?

 On Tue, Aug 16, 2011 at 4:29 PM, Taariq Levack taar...@gmail.com wrote:
 The consumer that handles the aggregated/timed-out request or response.

 I have to resend a few times if it's the request, I simply feed it back 
 into direct:socketRequestRoute with the header for the number of retry 
 attempts incremented.
 If it's the response I can forward to some process.

 Taariq

 On 16 Aug 2011, at 10:18 PM, James Carman ja...@carmanconsulting.com 
 wrote:

 What's listening on the:

 to(direct:requestResponse)

 On Tue, Aug 16, 2011 at 3:56 PM, Taariq Levack taar...@gmail.com 
 wrote:
 Sure

 You can of course solve what I've described many ways, but I'll
 explain using 3 routes as that's what I used.

 This first route is the main route I mentioned earlier, so you send
 your socket messages here and it's multicast to both the aggregator
 and to the socket.

 from(direct:socketRequestRoute).multicast().to(direct:requestResponseAggregator,
  someOutboundSocketEndpoint);


 This next route will aggregate, both requests and responses are sent
 here as you envisaged.
 from(direct:requestResponseAggregator).
                .aggregate(header(someCorrellationId),
 requestResponseAggregator)
                .completionSize(2)
                .completionTimeout(5000)
                .to(direct:requestResponse); //Here you can send the
 aggregated message, in my case it's only the response I forward
 unless there's a timeout, then I forward the request of course.

 Finally the route that consumes the socket responses.
 from(someInboundSocketEndpoint).processRef(headerEnricher).to(direct:requestResponseAggregator);
   //this headerEnricher doesn't have to be a processor, you have many
 options to add a header.

 If that's not clear feel free to ask.

 Taariq


 On Tue, Aug 16, 2011 at 9:30 PM, James Carman
 ja...@carmanconsulting.com wrote:
 Care to share an example?  I'm not picturing it.

 On Tue, Aug 16, 2011 at 3:23 PM, Taariq Levack taar...@gmail.com 
 wrote:
 Hi James

 I did that too for what it's worth.
 I send the message to a route that forwards to both the aggregator 
 and to the socket.
 When the response comes in I use an enricher to add the ID to the 
 headers and then forward to the aggregator.

 Taariq

 On 16 Aug 2011, at 8:55 PM, James Carman 
 ja...@carmanconsulting.com wrote:

 Willem,

 Thank you for your help.  I don't think this is doing exactly what I
 need, though.  The 

Sending message to different environment

2011-08-23 Thread newbiee
I have just started learning CAMEL. There are some good basic examples to
learn CAMEL. It seems that, using CAMEL, it is so simple to send a message
from one queue to the other. For example he is one example:

from(activemq:queue1”)
.to(activemq:queue2);

The above two lines will do the job. I have tested and it works. I want to
apply this to real world scenario, I need help from experts how can I do
this:

I have a queue say queue1 defined in the production environment and I have
queue2 defined in the Staging environment. There is customerQueue
defined in our customer's production environment. From
queue1 I want to send messages to  queue2 and to customerQueue. I can
use EIP to send messages from queue1  to queue2 and to customerQueue
(more than one recipients). What I don't know is how to tell CAMEL where is 
queue2 and where is customerQueue. Please help me.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Sending-message-to-different-environment-tp4728380p4728380.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Validator Eats the Message

2011-08-23 Thread David Karlsen
Try enabling trace: http://camel.apache.org/tracer.html.
One of your route steps might be throwing an exception which is dealt with
by a default error handler:
http://camel.apache.org/error-handler.html

2011/8/23 dougman82 dougma...@gmail.com

 Hello all,

 Just to be quick, I've got a camel route that looks something like this:

 route id=myRoute
   from uri=blahblah /
   to uri=anEndpointThatGivesAResponse /
   to uri=xslt:/path/to/transform /
 /route

 Basically, a message is delivered to an endpoint and a response is received
 which is then transformed using an XSL stylesheet, and the result is given
 back to the original requester. This works just fine.

 My new requirement is to add an XML schema validation step:

 route id=myRoute
   from uri=blahblah /
   to uri=anEndpointThatGivesAResponse /
   to uri=xslt:/path/to/transform /
   to uri=validator:/path/to/schema/file /
 /route

 When I add that last step to the route, the XML message is successfully
 validated, but in the process, the message gets eaten. It seems that the
 validation step stops the route, and the original requester gets nothing
 back.

 I'm hoping I have overlooked something very basic about Camel. Any
 thoughts?

 By the way, I am using Camel 2.6 with Spring 3.0.5.

 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-Validator-Eats-the-Message-tp4728003p4728003.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Sending message to different environment

2011-08-23 Thread boday
when you setup your activemq component (generally in spring xml), you have
to specify the broker to connect to.  this is generally localhost, but can
be an external broker, etc.  So, just setup multiple activemq components
(and give them an appropriate ID)...like this

   bean id=activemq_production 
  class=org.apache.activemq.camel.component.ActiveMQComponent
  property name=brokerURL value=tcp://production-host:61616/
   /bean

   bean id=activemq_customer 
  class=org.apache.activemq.camel.component.ActiveMQComponent
  property name=brokerURL value=tcp://customer-host:61616/
   /bean

   bean id=activemq_staging 
  class=org.apache.activemq.camel.component.ActiveMQComponent
  property name=brokerURL value=tcp://staging-host:61616/
   /bean

then, your route simply references these components/queues, etc...

from(activemq_production:queue:queue1”)
.to(activemq_staging:queue:queue2,activemq_customer:queue:customerQueue);



newbiee wrote:
 
 I have just started learning CAMEL. There are some good basic examples to
 learn CAMEL. It seems that, using CAMEL, it is so simple to send a message
 from one queue to the other. For example he is one example:
 
 from(activemq:queue1”)
 .to(activemq:queue2);
 
 The above two lines will do the job. I have tested and it works. I want to
 apply this to real world scenario, I need help from experts how can I do
 this:
 
 I have a queue say queue1 defined in the production environment and I
 have queue2 defined in the Staging environment. There is customerQueue
 defined in our customer's production environment. From
 queue1 I want to send messages to  queue2 and to customerQueue. I
 can use EIP to send messages from queue1  to queue2 and to
 customerQueue (more than one recipients). What I don't know is how to
 tell CAMEL where is  queue2 and where is customerQueue. Please help
 me.
 


-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Sending-message-to-different-environment-tp4728380p4728626.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXF can't set the holder object into the message content list of the out message

2011-08-23 Thread Willem Jiang

Hi,

Which version of CXF are you using?
If you are using CXF 2.4.1, you need to upgrade it to CXF 2.4.2.
There is a issue about the holder object checking in the CXF 2.4.1.


On 8/24/11 5:23 AM, Mick Knutson wrote:

Thanks for the test case, but I am having issues following it as it pertains
to the original example.

Here is the processor from the original:

 private class MappingProcessor implements Processor {

 private Class?  beanClass;
 private Object instance;

 public MappingProcessor(Object obj) {
 beanClass = obj.getClass();
 instance = obj;
 }

 public void process(Exchange exchange) throws Exception {
 String operationName =
exchange.getIn().getHeader(CxfConstants.OPERATION_NAME, String.class);
 Method method = findMethod(operationName,
exchange.getIn().getBody(Object[].class));
 try {
 Object response = method.invoke(instance,
exchange.getIn().getBody(Object[].class));
 if (response instanceof CallEvent) {
 logger.info(we have a CallEvent);
 }
 exchange.getOut().setBody(response);
 } catch (InvocationTargetException e) {
 throw (Exception) e.getCause();
 }
 }

 private Method findMethod(String operationName, Object[] parameters)
throws SecurityException, NoSuchMethodException {
 return beanClass.getMethod(operationName,
getParameterTypes(parameters));
 }

 private Class?[] getParameterTypes(Object[] parameters) {
 if (parameters == null) {
 return new Class[0];
 }
 Class?[] answer = new Class[parameters.length];
 int i = 0;
 for (Object object : parameters) {
 answer[i] = object.getClass();
 i++;
 }
 return answer;
 }
 }


And I still get the error
HolderOutInterceptor   ERROR The message content list of the in
message and out message are same, CXF can't set the holder object into the
message content list of the out message.


So far I was able to get a custom Object sent into my seda:tap like:


 from(Routes.INPUT_TAP).routeId(INPUT_TAP)
 .doTry()
 .log(--INPUT_TAP)
 .marshal().json()
 .to(Routes.INPUT_MARSHALED)
 .doCatch(Exception.class)
 .bean(ExceptionProcessor.class,
ExceptionProcessor.HANDLE_MARSHAL_ERROR)
 .end()
 ;


and this is the json I get:

*{org.apache.cxf.message.MessageContentsList*
:{@serialization:custom,unserializable-parents:,list:{default:{size:1},int:6,com.comcast.ivr.integration.domain.CallEvent:{browserType:AVAYA,dasSessionId:JAXWS-2-d46502d4-23c2-4cbf-b517-808a2674e1a8,applicationType:AGENT,ani:1234567890,dnis:0987654321,languageSelected:ENGLISH,callEndReason:CALLER_HUNGUP,functionalArea:PRE_MAIN_MENU,startTime:0,endTime:0

I thought I would get something like (or similar to):


*{com.comcast.ivr.integration.domain.CallEvent*
:{browserType:AVAYA,dasSessionId:JAXWS-2-d46502d4-23c2-4cbf-b517-808a2674e1a8,applicationType:AGENT,ani:1234567890,dnis:0987654321,languageSelected:ENGLISH,callEndReason:CALLER_HUNGUP,functionalArea:PRE_MAIN_MENU,startTime:0,endTime:0}}


---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (855) BASE-LOGIC: (227-3564-42)
p. (478) BASE-LOGIC (227-3564-42)
f. (855) BASE-LOGIC: (227-3564-42)

Website: http://www.baselogic.com
Blog: http://www.baselogic.com/blog/
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
---



On Tue, Aug 23, 2011 at 10:10 AM, Willem Jiangwillem.ji...@gmail.comwrote:


Hi Mick,

I just committed a simple unit test[1] into camel-cxf, you make take a look
and add the missing part that you need.

[1]http://svn.apache.org/**viewvc?rev=1160701view=revhttp://svn.apache.org/viewvc?rev=1160701view=rev


On 8/23/11 7:43 PM, Mick Knutson wrote:


Hmm. Thanks for helping me start to think about things.
So it looks like I was originally trying to do this:

1. take RS or WS Object into process method
2. wiretap Object into queue
3. write tapped Object to file
4. return from process method

So, what _should_ I do if all I want is to take an CXF RS Object in, then
add it to a queue which is part of a totally different flow?

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring   Agile Consulting
p. (855) BASE-LOGIC: (227-3564-42)
p. (478) BASE-LOGIC (227-3564-42)
f. (855) BASE-LOGIC: (227-3564-42)

Website: http://www.baselogic.com
Blog: http://www.baselogic.com/blog/
Linked IN: 
http://linkedin.com/in/**mickknutsonhttp://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
---



On Mon, Aug 22, 2011 at 9:11 

Re: i use wsdl file and payload dataFormat, but IllegalArgumentException

2011-08-23 Thread Willem Jiang
You can specify the operationName and operationNamespace at the runtime 
by setting the message header with those key.
In most case you don't need to specify the operationNamespace if it is 
same with the ServiceName namespace.


On Tue Aug 23 17:43:44 2011, xiangqiuzhao wrote:

i need to invoke service operationName decide by program logic.

so i want to config the URI point the service address and not appoint the
special operationName.

but how to know the namespace and the webservice wsdl:message by camel? if i
appoint the operationName,
why camel can't know the wsdl:message that i want to send?

--
View this message in context: 
http://camel.465427.n5.nabble.com/i-use-wsdl-file-and-payload-dataFormat-but-IllegalArgumentException-tp4719896p4726155.html
Sent from the Camel - Users mailing list archive at Nabble.com.




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



Re: Stop a route for unit testing

2011-08-23 Thread Willem Jiang

Hi Christian,

I tried to run the test with Camel 2.8.0 and Camel 2.9-SNAPSHOT.
I don't have the issue that you meet.

On 8/24/11 4:28 AM, Christian Müller wrote:

Hello Willem!

Thank you for you reply. Unfortunately it doesn't work for me. I updated me
test to

public class Route1Test extends CamelSpringTestSupport {

 @EndpointInject(uri = mock:foo)
 private MockEndpoint mockEndpointFoo;

 @Override
 @Before
 public void setUp() throws Exception {
 super.setUp();

 context.removeRoute(Route2.class.getName());

 context.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(activemq:queue:foo)
 .to(mockEndpointFoo);
 }
 });
 }

 @Test
 public void test() throws Exception {
 mockEndpointFoo.expectedBodiesReceived(1, 2, 3, 4, 5, 6,
7, 8, 9, 0);

 mockEndpointFoo.assertIsSatisfied();
 }

 @Override
 protected AbstractApplicationContext createApplicationContext() {
 return new ClassPathXmlApplicationContext(new String[]
{META-INF/spring/bundle-context.xml},
getRouteExcludingApplicationContext());
 }

 @Override
 protected Class?  excludeRoute() {
 return Route2.class;
 }
}

and from the log I can see, the Route2 is still running (attached at the end
of the file). Do you have another idea how it could work?

I'm thinking to raise a JIRA, because it looks like stopping/removing the
route doesn't work for this test.

I also hat a look at the chapter 'Test time exclusion' in [1], but it
doesn't work either for me. I'm running out of ideas... :-(

[1] http://camel.apache.org/spring.html

Best,
Christian

Aug 23, 2011 10:21:28 PM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing
org.springframework.context.support.GenericApplicationContext@f01a1e:
startup date [Tue Aug 23 22:21:28 CEST 2011]; root of context hierarchy
Aug 23, 2011 10:21:28 PM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@60961dff:
defining beans [excludingResolver]; root of factory hierarchy
Aug 23, 2011 10:21:28 PM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@353c375:
startup date [Tue Aug 23 22:21:28 CEST 2011]; parent:
org.springframework.context.support.GenericApplicationContext@f01a1e
Aug 23, 2011 10:21:28 PM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/spring/bundle-context.xml]
Aug 23, 2011 10:21:28 PM
org.apache.camel.spring.handler.CamelNamespaceHandler init
INFO: OSGi environment not detected.
Aug 23, 2011 10:21:29 PM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@2b76086d:
defining beans
[route1,route2,activemq,connectionFactory,template,consumerTemplate,camel:beanPostProcessor,camel];
parent:
org.springframework.beans.factory.support.DefaultListableBeanFactory@60961dff
Aug 23, 2011 10:21:29 PM
org.apache.camel.core.xml.AbstractCamelContextFactoryBean afterPropertiesSet
INFO: Using custom PackageScanClassResolver:
org.apache.camel.test.junit4.CamelSpringTestSupport$ExcludingPackageScanClassResolver@5e95215b
Aug 23, 2011 10:21:29 PM
org.apache.camel.impl.converter.AnnotationTypeConverterLoader load
INFO: Found 4 packages with 15 @Converter classes to load
Aug 23, 2011 10:21:29 PM
org.apache.camel.impl.converter.BaseTypeConverterRegistry loadTypeConverters
INFO: Loaded 150 type converters in 0.318 seconds
Aug 23, 2011 10:21:30 PM org.apache.camel.impl.DefaultCamelContext start
INFO: Apache Camel 2.6.0 (CamelContext: camel) is starting
Aug 23, 2011 10:21:30 PM org.apache.camel.impl.DefaultCamelContext
doStartCamel
INFO: Tracing is enabled on CamelContext: camel
Aug 23, 2011 10:21:30 PM org.apache.camel.impl.DefaultCamelContext
createManagementStrategy
INFO: JMX enabled. Using ManagedManagementStrategy.
Aug 23, 2011 10:21:30 PM org.apache.camel.component.file.FileEndpoint
createConsumer
INFO: Endpoint is configured with noop=true so forcing endpoint to be
idempotent as well
Aug 23, 2011 10:21:30 PM org.apache.camel.component.file.FileEndpoint
createConsumer
INFO: Using default memory based idempotent repository with cache max size:
1000
Aug 23, 2011 10:21:30 PM org.apache.camel.impl.DefaultCamelContext
doStartOrResumeRouteConsumers
INFO: Route: org.apache.cmueller.test.Route1 started and consuming from:
Endpoint[file://src/test/data?initialDelay=5000noop=true]
Aug 23, 2011 10:21:30 PM org.apache.activemq.broker.BrokerService start
INFO: Using 

Re: i use wsdl file and payload dataFormat, but IllegalArgumentException

2011-08-23 Thread xiangqiuzhao
I set the keys at runtime, but can't find the service in the server.

Exchange exchange = endpoint.createExchange();
exchange.getIn().setHeader(operationName, helloService);
exchange.getIn().setHeader(operationNamespace,
http://www.wstest.sunyard.com/IWSTestService/;);
exchange.getIn().setBody(in);
producer.process(exchange);

the CxfPayLoad body is the helloServiceRequest Element, content like:

helloServiceRequest
namefldsjaflkjdsa/name
/helloServiceRequest

but service server exception with org.apache.cxf.binding.soap.SoapFault:
Parameter helloServiceRequest does not exist!

i want to send message like this. but what i need to do set others info
about the service request?


--
View this message in context: 
http://camel.465427.n5.nabble.com/i-use-wsdl-file-and-payload-dataFormat-but-IllegalArgumentException-tp4719896p4728933.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: i use wsdl file and payload dataFormat, but IllegalArgumentException

2011-08-23 Thread Willem Jiang

Does you service is provided from CXF ?
There are some unit test in the camel-cxf module that you can take a look.

On 8/24/11 10:11 AM, xiangqiuzhao wrote:

I set the keys at runtime, but can't find the service in the server.

Exchange exchange = endpoint.createExchange();
exchange.getIn().setHeader(operationName, helloService);
exchange.getIn().setHeader(operationNamespace,
http://www.wstest.sunyard.com/IWSTestService/;);
exchange.getIn().setBody(in);
producer.process(exchange);

the CxfPayLoad body is the helloServiceRequest Element, content like:

helloServiceRequest
 namefldsjaflkjdsa/name
/helloServiceRequest

but service server exception with org.apache.cxf.binding.soap.SoapFault:
Parameter helloServiceRequest does not exist!

i want to send message like this. but what i need to do set others info
about the service request?


--
View this message in context: 
http://camel.465427.n5.nabble.com/i-use-wsdl-file-and-payload-dataFormat-but-IllegalArgumentException-tp4719896p4728933.html
Sent from the Camel - Users mailing list archive at Nabble.com.




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


Re: Socket-based Asynchronous Calls...

2011-08-23 Thread Taariq Levack
That doesn't sound right, what have you read? Logs/docs?
And are you using keep-alive?

Taariq


On 24 Aug 2011, at 12:12 AM, James Carman ja...@carmanconsulting.com wrote:

 Well, it looks like the camel-netty component won't work for me.  It
 appears that it opens the connection for each exchange.  Am I reading
 that right?  What I need is a persistent connection with automatic
 reconnects.  Oh well, back to the drawing board.
 
 On Wed, Aug 17, 2011 at 7:59 AM, James Carman
 ja...@carmanconsulting.com wrote:
 That's what I've been staring at! :)  Here's what I'm thinking I'm
 going to need to write.  I need an async processor that remembers the
 AsyncCallback and associates it with a correlation id.  Then, when
 another exchange comes in that has the same correlation id, it will
 lookup the previous callback and say that it's done.  I have a lot of
 questions, though.  I've never had to get so down and dirty with
 Camel before.  The components have just worked for me off the shelf.
 
 1.  Do I just copy the input message of the Exchange that comes in
 second to the output message of the originating exchange?
 2.  How do I do a timeout for the original caller (the CXF request)?
 3.  How do I detect that the caller has timed out if they do?
 
 I'm sure I'll have more questions, but these are the ones off the top
 of my head.
 
 On Wed, Aug 17, 2011 at 1:48 AM, Taariq Levack taar...@gmail.com wrote:
 James I think the rest of your puzzle is solved by Camel's async API,
 you might have to check if your task is done, maybe your
 requestResponse populates some collection of responses and provides
 some API to return the response given a correlationID.
 Stare at the async docs [1] a few more times and I'm sure you'll find
 your answer.
 
 [1] http://camel.apache.org/async.html
 
 Taariq
 
 On Tue, Aug 16, 2011 at 11:16 PM, James Carman
 ja...@carmanconsulting.com wrote:
 No worries!  Thank you for your help.  It helped me understand a bit
 more about how these aggregators work..  However, I still don't
 understand how to take care of my problem.  I guess I'm going to have
 to roll my own processor or something.
 
 On Tue, Aug 16, 2011 at 4:50 PM, Taariq Levack taar...@gmail.com wrote:
 Hmmm.
 Maybe others can help with that if it's possible, I haven't had to 
 wrestle with it.
 
 In my case it is actually a cxf service too, but it's asynchronous  and I 
 send the response once I have it, indicating either timeout or the actual 
 response.
 
 Sorry I responded to your question without going back to see your other 
 posts.
 
 Taariq
 
 On 16 Aug 2011, at 10:33 PM, James Carman ja...@carmanconsulting.com 
 wrote:
 
 In my case, the originating request comes from CXF.  How do I send the
 aggregated response back to CXF?
 
 On Tue, Aug 16, 2011 at 4:29 PM, Taariq Levack taar...@gmail.com wrote:
 The consumer that handles the aggregated/timed-out request or response.
 
 I have to resend a few times if it's the request, I simply feed it back 
 into direct:socketRequestRoute with the header for the number of 
 retry attempts incremented.
 If it's the response I can forward to some process.
 
 Taariq
 
 On 16 Aug 2011, at 10:18 PM, James Carman ja...@carmanconsulting.com 
 wrote:
 
 What's listening on the:
 
 to(direct:requestResponse)
 
 On Tue, Aug 16, 2011 at 3:56 PM, Taariq Levack taar...@gmail.com 
 wrote:
 Sure
 
 You can of course solve what I've described many ways, but I'll
 explain using 3 routes as that's what I used.
 
 This first route is the main route I mentioned earlier, so you send
 your socket messages here and it's multicast to both the aggregator
 and to the socket.
 
 from(direct:socketRequestRoute).multicast().to(direct:requestResponseAggregator,
  someOutboundSocketEndpoint);
 
 
 This next route will aggregate, both requests and responses are sent
 here as you envisaged.
 from(direct:requestResponseAggregator).
.aggregate(header(someCorrellationId),
 requestResponseAggregator)
.completionSize(2)
.completionTimeout(5000)
.to(direct:requestResponse); //Here you can send the
 aggregated message, in my case it's only the response I forward
 unless there's a timeout, then I forward the request of course.
 
 Finally the route that consumes the socket responses.
 from(someInboundSocketEndpoint).processRef(headerEnricher).to(direct:requestResponseAggregator);
   //this headerEnricher doesn't have to be a processor, you have many
 options to add a header.
 
 If that's not clear feel free to ask.
 
 Taariq
 
 
 On Tue, Aug 16, 2011 at 9:30 PM, James Carman
 ja...@carmanconsulting.com wrote:
 Care to share an example?  I'm not picturing it.
 
 On Tue, Aug 16, 2011 at 3:23 PM, Taariq Levack taar...@gmail.com 
 wrote:
 Hi James
 
 I did that too for what it's worth.
 I send the message to a route that forwards to both the aggregator 
 and to the socket.
 When the response comes in I use an enricher to add the ID to the 
 headers and then 

Re: setHeader using xpath returns Object?

2011-08-23 Thread Willem Jiang

Hi,

You may consider to use the XPathBuilder to setup the expression for the 
setHeader().



On 8/23/11 6:06 PM, heinrichheine wrote:

Your totally right,

but if i do it, i get:
The method xpath(String) in the type BuilderSupport is not applicable for
the arguments (String, ClassString, Namespaces)

compile error.

--
View this message in context: 
http://camel.465427.n5.nabble.com/setHeader-using-xpath-returns-Object-tp4726154p4726222.html
Sent from the Camel - Users mailing list archive at Nabble.com.




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


Re: i use wsdl file and payload dataFormat, but IllegalArgumentException

2011-08-23 Thread xiangqiuzhao
your means i can set message body like 

helloServiceRequest
namefldsjaflkjdsa/name
/helloServiceRequest

and invoke helloService in remote?

--
View this message in context: 
http://camel.465427.n5.nabble.com/i-use-wsdl-file-and-payload-dataFormat-but-IllegalArgumentException-tp4719896p4729146.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: i use wsdl file and payload dataFormat, but IllegalArgumentException

2011-08-23 Thread Willem Jiang
PAYLOAD body is a list of element, you should create the element 
yourself and set it into the PAYLOAD.


On Wed Aug 24 11:48:05 2011, xiangqiuzhao wrote:

your means i can set message body like

helloServiceRequest
 namefldsjaflkjdsa/name
/helloServiceRequest

and invoke helloService in remote?

--
View this message in context: 
http://camel.465427.n5.nabble.com/i-use-wsdl-file-and-payload-dataFormat-but-IllegalArgumentException-tp4719896p4729146.html
Sent from the Camel - Users mailing list archive at Nabble.com.




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



Re: Camel No XPathfactory Implementation error.

2011-08-23 Thread Willem Jiang

Can you try to set the class loader parent first?
It looks like there are some issue loading the sun jaxp dom module.

On 8/24/11 1:42 AM, jackkirsten wrote:

Hi, I'm using WebSphere 6.1.0.29 on AIX trying to run Camel 2.6 on it.  I'm
getting following exceptions when the app server starts. It seems like I
have some conflicts with xerces ml-apis jars.

[8/23/11 13:29:52:848 EDT] 0016 WebAppE   Exception caught while
initializing context
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route route1
at:  Transacted[ref:null]  in route:
Route[[From[jmsStartCamel:StartCamelProcess]] -  [OnExceptio... becaus
e of XPathFactory#newInstance() failed to create an XPathFactory for the
default object model: http://java.sun.com/jaxp/xpath/dom with the
XPathFactoryConfigurationException:
javax.xml.xpath.XPathFactoryConfigurationException: No
XPathFctory implementation found for the object model:
http://java.sun.com/jaxp/xpath/dom
 at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)
 at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
 at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:237)
 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:274)
 at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
 at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
 at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
 at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
 at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
 at
com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:653)
 at
com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:370)
 at
com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:293)
 at
com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:93)
 at
com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:162)
 at
com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:673)
 at
com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:626)
 at
com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)
 at
com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)
 at
com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1250)
 at
com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1140)
 at
com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)
 at
com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:819)
 at
com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:921)
 at
com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2100)
 at
com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)
 at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)


I'm using these versions of jar files in WEB-INF/lib folder.

xercesImpl-2.9.1.jar
xml-apis-1.3.04.jar
jaxb-xercesImpl-1.5.jar


From the class loader stand-point, I have set to PARENT_LAST (i.e.,

application first).

How do I fix this xpathfactory error?  Thanks for your help.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-No-XPathfactory-Implementation-error-tp4727601p4727601.html
Sent from the Camel - Users mailing list archive at Nabble.com.




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


Re: DeadLetterChannel useOriginalMessage Behaviour

2011-08-23 Thread boday
it should behave as you described...at first glance, not sure why you are
seeing otherwise...

here is a unit test that I created a while back to validate this...

public class UseOriginalMessageRouteTest extends CamelTestSupport {

private static final Logger logger =
Logger.getLogger(UseOriginalMessageRouteTest.class.getName());

protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
String url =
vm://test-broker?broker.persistent=falsebroker.useJmx=false;
ConnectionFactory connectionFactory = new 
ActiveMQConnectionFactory(url);
camelContext.addComponent(activemq,
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
return camelContext;
}

@EndpointInject(uri = mock:mock)
protected MockEndpoint mock;

@Test
public void testAMQWithBean() throws Exception {
mock.setExpectedMessageCount(1);
mock.expectedBodiesReceived(message);
template.sendBody(activemq:queue:order, message);
Thread.sleep(100);
mock.assertIsSatisfied();
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {

ErrorHandlerBuilder eh =
deadLetterChannel(direct:mock).maximumRedeliveries(2).redeliveryDelay(0).logStackTrace(false).useOriginalMessage();

from(activemq:queue:order)
.errorHandler(eh)
.log(request ${body})
.bean(ValidateOrder.class)
.bean(TransformOrder.class)
.throwException(new Exception(error));

from(direct:mock).log(mock 
${body}).to(mock:mock);
}
};
}

public static class ValidateOrder {
public String process(String body) {
return body + :validated;
}
}

public static class TransformOrder {
public String process(String body) {
return body + :tranformed;
}
}
}


devram wrote:
 
 Let's say an exception occurs at the Persister step, what ends up
 happening is the POJO that was passed in to the Persister step is picked
 up by the deadLetterHandler instead of the xml message which I want.  How
 can I configure my route to pass the original xml message received from
 the jms end point to the deadletterhandler when exceptions occur?  Based
 on what I've read in the CamelInAction Book (chapter 5), Wiki page
 (DeadLetterChannel  Error Handling section)  on this site; it would seem
 all I needed to do was set useOriginalMessage to true, but that didn't
 work...any help would be appreciated.
 


-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/DeadLetterChannel-useOriginalMessage-Behaviour-tp4728373p4729251.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: setHeader using xpath returns Object?

2011-08-23 Thread Claus Ibsen
On Tue, Aug 23, 2011 at 12:06 PM, heinrichheine
martin.heinem...@vitaphone.de wrote:
 Your totally right,

 but if i do it, i get:
 The method xpath(String) in the type BuilderSupport is not applicable for
 the arguments (String, ClassString, Namespaces)


The xpath should have methods to set the namespace, result type etc.

So something along the lines of:
.setHeader(xxx, xpath(xxx).resultType(String.class).namespace(ns))



 compile error.

 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/setHeader-using-xpath-returns-Object-tp4726154p4726222.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.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: Filtering of mbeans in mbean server of camel

2011-08-23 Thread Claus Ibsen
Hi

You can most likely use a custom ManagementNamingStrategy (for example
extending the default)
and then return null for the mbean types you dont like to be enlisted.

You would need to add a bean to the camel-context.xml file to have
you custom naming strategy being used by Camel

There is also the option onlyRegisterProcessorWithCustomId
http://camel.apache.org/camel-jmx.html

When you enable onlyRegisterProcessorWithCustomId then only processors
from within routes which have a custom id set will be registered



On Tue, Aug 23, 2011 at 2:02 PM, Sachin sachin2...@gmail.com wrote:
 I have configured camel jmx to combine with my application's jmx console by
 doing the below configuration in camel-context.xml

 jmxAgent id=JMXAgent disabled =false statisticsLevel=Off
 createConnector = false mbeanServerDefaultDomain=MyApplication
 usePlatformMBeanServer=false/

 I am successful in doing this.

 This is how it is getting displayed in my application's jmx console(see
 below).

 My requirement is to filter on required type and show only those mbeans on
 console. Example i want to see only mbeans of routes.
 Is this can be done?

 Appreciate your help

 # org.apache.camel

    * context=BLRGT24/camel,type=components,name=ActiveMQ
    * context=BLRGT24/camel,type=components,name=direct
    * context=BLRGT24/camel,type=components,name=file
    * context=BLRGT24/camel,type=components,name=http
    * context=BLRGT24/camel,type=components,name=mina
    * context=BLRGT24/camel,type=consumers,name=DirectConsumer(0x33528d)
    * context=BLRGT24/camel,type=consumers,name=DirectConsumer(0xbb50e0)
    * context=BLRGT24/camel,type=consumers,name=JmsConsumer(0x16231b4)
    * context=BLRGT24/camel,type=context,name=camel
    * context=BLRGT24/camel,type=endpoints,name=ActiveMQ://queue:BFInQueue
    *
 context=BLRGT24/camel,type=endpoints,name=ActiveMQ://queue:BFReqQueue
    *
 context=BLRGT24/camel,type=endpoints,name=ActiveMQ://queue:BFResQueue
    * context=BLRGT24/camel,type=endpoints,name=direct://requestQueue
    * context=BLRGT24/camel,type=endpoints,name=direct://responseQueue
    * context=BLRGT24/camel,type=endpoints,name=file://E:/Alternate/
    *
 context=BLRGT24/camel,type=endpoints,name=http://localhost:8080/bfweb;
    *
 context=BLRGT24/camel,type=endpoints,name=mina://tcp://localhost:\?timeout=5000
    * context=BLRGT24/camel,type=endpoints,name=spring-event://default
    *
 context=BLRGT24/camel,type=errorhandlers,name=DefaultErrorHandlerBuilder(ref:CamelDefaultErrorHandlerBuilder)
    * context=BLRGT24/camel,type=processors,name=bean1
    * context=BLRGT24/camel,type=processors,name=bean2
    * context=BLRGT24/camel,type=processors,name=bean3
    * context=BLRGT24/camel,type=processors,name=bean4
    * context=BLRGT24/camel,type=processors,name=bean5
    * context=BLRGT24/camel,type=processors,name=to1
    * context=BLRGT24/camel,type=processors,name=to2
    * context=BLRGT24/camel,type=routes,name=consumer1
    * context=BLRGT24/camel,type=routes,name=producer
    * context=BLRGT24/camel,type=routes,name=producer1
    *
 context=BLRGT24/camel,type=services,name=DefaultExecutorServiceStrategy(0x137019c)
    *
 context=BLRGT24/camel,type=services,name=DefaultInflightRepository(0x1bc369c)
    *
 context=BLRGT24/camel,type=services,name=DefaultShutdownStrategy(0x10f7374)
    * context=BLRGT24/camel,type=services,name=ProducerCache(0x102dd19)
    * context=BLRGT24/camel,type=services,name=ProducerCache(0x37a3ed)
    *
 context=BLRGT24/camel,type=services,name=SharedProducerServicePool(0x1af1c4d)
    *
 context=BLRGT24/camel,type=threadpools,name=DefaultErrorHandler(0x17b1b46)
    * context=BLRGT24/camel,type=threadpools,name=MinaComponent(0x169a4ce)
    * context=BLRGT24/camel,type=tracer,name=Tracer(0xfc6ed7)

 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Filtering-of-mbeans-in-mbean-server-of-camel-tp4726520p4726520.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.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: Occational NPE in CamelNamespaceHandler

2011-08-23 Thread Claus Ibsen
Hi

Thanks for the heads up. We have no official support for JDK7 with Camel.
This is something we will work on in one of the next releases. But
JDK7 has just been released.

Likewise the issue could also steam from Spring-DM and thus harder to
resolve. But thanks for reporting your observations.



On Tue, Aug 23, 2011 at 3:16 PM, Paul Nyheim paul.nyh...@gmail.com wrote:
 Hi.
 Occationally I get a NPE that seems related to CamelNamespaceHandler
 when running under Java 7. Switching back to Java 6 I don't seem to
 get this problem.

 The problem seems very similar to the one from this thread
 http://camel.465427.n5.nabble.com/Occasional-CamelNamespaceHandler-exception-when-running-with-Spring-DM-1-2-tt476984.html
 , however as the thread is quite old, I would like to know if anyone
 else has experienced this, and how to avoid it.

 My setup is a Grails 1.3.7 Application, using Camel 2.8.0, jdk1.7.0

 I have a camelContext configured in the spring resources.xml like this:

  camel:camelContext id=camel
    camel:routeBuilder ref=eventReceiverRouteBuilder /
  /camel:camelContext

 I also get the same error if I try to configure it in resources.groovy
 like this:

  xmlns camel: 'http://camel.apache.org/schema/spring'

    camel{
        camelContext(id:camel){
            routeBuilder(ref:eventReceiverRouteBuilder)
        }
    }

 Relevant parts of stacktrace: (complete stacktrace posted here:
 http://pastebin.com/b88JZx6z )

 2011-08-23 14:53:20,918 [main] WARN  spring.GrailsRuntimeConfigurator
 - [RuntimeConfiguration] Unable to perform post initialization config:
 /WEB-INF/spring/resources.xml
 org.springframework.beans.factory.BeanDefinitionStoreException:
 Unexpected exception parsing XML document from URL
 [file:./grails-app/conf/spring/resources.xml]; nested exception is
 java.lang.NullPointerException
        at 
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
        at 
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
        at 
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at 
 org.springframework.beans.factory.xml.XmlBeanFactory.init(XmlBeanFactory.java:73)
 ..
 Caused by: java.lang.NullPointerException
        at 
 com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.checkOverrideProperties(ClassBeanInfoImpl.java:190)
        at 
 com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.init(ClassBeanInfoImpl.java:171)
        at 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
        at 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)
 ..
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:347)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:431)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:394)
        at 
 org.apache.camel.spring.handler.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:185)
        at 
 org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:172)
        at 
 org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:300)
        at 
 org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:85)

 Regards,
 Paul Nyheim




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