Re: recipientList not working properly

2013-04-25 Thread Nibs
Thanks Claus and Christian for ur suggestions.
Actually i am working on some old projects so currently i need a fix on
camel 2.4
yeah but for sure we will upgrade taht.

actually the error caused is

 Caused by: org.apache.camel.InvalidPayloadException: No body available of
type: java.io.InputStream on: Message: [Body is null]. Caused by: No type
converter available to convert from type: null to the required type:
java.io.InputStream with value null. Exchange[Message: [Body is null]].
Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type
converter available to convert from type: null to the required type:
java.io.InputStream with value null]
at
org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:103)
at
org.apache.camel.util.ExchangeHelper.getMandatoryInBody(ExchangeHelper.java:115)
at
org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:204)
... 152 more
Caused by: org.apache.camel.NoTypeConversionAvailableException: No type
converter available to convert from type: null to the required type:
java.io.InputStream with value null
at
org.apache.camel.impl.converter.DefaultTypeConverter.mandatoryConvertTo(DefaultTypeConverter.java:132)
at
org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:101)
... 154 more 


I read this http://camel.apache.org/type-converter.html
but i am not getting how to implement in my spring dsl

Thanks in Advance



--
View this message in context: 
http://camel.465427.n5.nabble.com/recipientList-not-working-properly-tp5731447p5731508.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: 'fire and forge' from InOut exchange

2013-04-25 Thread Claus Ibsen
Hi

You can use the wire tap to audit the response in parallel.
http://camel.apache.org/wire-tap


On Wed, Apr 24, 2013 at 11:48 PM, morpheus  wrote:
> I have similar need - I need to audit the response, so I want to do it in
> parallel to sending the response:
> from("activemq:queue").setExchangePattern(ExchangePattern.InOut).
> to("bean:foo").
> to("bean:audit").
> end();
>
> For some reason I get the response only after audit complete. Ideally audit
> service should be called directly (i.e not via jms, seda etc)
>
> I think the key here is the enclosing ExchangePattern.InOut route.
>
> Anyone have an idea how it could be done?
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/fire-and-forge-from-InOut-exchange-tp5731352p5731494.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: DeadLetterChanel does not handle exception.

2013-04-25 Thread Claus Ibsen
If you set handled(true) on your onException then that ought to fix
the issue you have.

On Wed, Apr 24, 2013 at 7:44 PM, Claus Ibsen  wrote:
> Hi
>
> Yeah I can see this is a bug. I have logged a ticket. Thanks for
> reporting this problem to the community.
> https://issues.apache.org/jira/browse/CAMEL-6311
>
> On Tue, Apr 23, 2013 at 8:05 AM, aram  wrote:
>> I tried it on a camel 2.11.0 , but there is the same problem :
>>
>> java.lang.AssertionError: mock://log:send Received message count. Expected:
>> <4> but was: <28>
>>
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073p5731319.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Problems with sftp in Camel 2.11.0

2013-04-25 Thread Bengt Rodehav
I have now uploaded patches for fixing FileUtil and for testing the error
in FileUtilTest.

Like I wrote before, I think this is a really serious error since it
affects (at least) ftp, ftps and sftp. I would really appreciate if a
2.11.1 bugfix release could happen real soon. I don't think that
ftp/ftps/sftp can be safely used at all in 2.11.0.

/Bengt




2013/4/24 Christian Müller 

> Hey Guys,
>
> thanks for reporting.
> Could you provide a unit test which shows this issue (may directly for the
> FileUtil class). Ans like always, patches are welcome and help us to fix
> this issue soon.
>
> http://camel.apache.org/contributing.html
>
> Best,
> Christian
>
>
> On Wed, Apr 24, 2013 at 11:28 AM, Bengt Rodehav  wrote:
>
> > I created a JIRA for this:
> >
> > https://issues.apache.org/jira/browse/CAMEL-6309
> >
> > /Bengt
> >
> >
> > 2013/4/24 Bengt Rodehav 
> >
> > > Also, note that the "stepwise" option does not affect the bug I have
> > > enountered. What happens for me is that Camel traverses the path to get
> > > down to the subdirectory in order to verity that the subdirectory
> exists
> > > (or create it). Then when Camel tries to return to the original
> directory
> > > the error happens since it thinks that the original directory is "//"
> and
> > > not "/" as it should be.
> > >
> > > /Bengt
> > >
> > >
> > > 2013/4/24 Bengt Rodehav 
> > >
> > >> Hello Diether,
> > >>
> > >> The error you mention looks very similar to mine. However, you use ftp
> > >> (and thus FtpOperations) while I use sftp (and SftpOperations). I
> > haven't
> > >> checked if they handle subdirectories in a similar way. I'm afraid
> that
> > the
> > >> bug might affect many components since it is in camel-core (FileUtil
> > >> class). Have you tried Camel 2.11.0 to verify if it works for you?
> > >>
> > >> I think whati will cause my problem is if you upload to a subdirectory
> > >> via sftp and the home directory (where you end up after login) is "/"
> > (or
> > >> "\" on windows).
> > >>
> > >> /Bengt
> > >>
> > >>
> > >>
> > >>
> > >> 2013/4/24 Diether 
> > >>
> > >>>
> > >>> This problem has been mentioned before:
> > >>>
> > >>>
> >
> http://camel.465427.n5.nabble.com/Producing-files-to-ftp-now-working-in-2-10-3-td5726060.html
> > >>>
> > >>> But it seems like still no fix has been implemented then.
> > >>> For us it was working in 2.10.2 though, but not in 2.10.3
> > >>>
> > >>> Regards,
> > >>> Diether
> > >>>
> > >>> 
> > >>> Van: Bengt Rodehav [via Camel] [
> > ml-node+s465427n5731408...@n5.nabble.com
> > >>> ]
> > >>> Verzonden: woensdag 24 april 2013 10:28
> > >>> To: Wuyts Diether
> > >>> Onderwerp: Re: Problems with sftp in Camel 2.11.0
> > >>>
> > >>> I investigated this further and found a serious bug in the
> > >>> FileUtil.compactPath() method. If the path only contains a "/" (or
> "\"
> > on
> > >>> Windows) the compactPath() method will:
> > >>>
> > >>> - Determine that the path both starts and ends with a slash.
> > >>> - First output a slash because the path starts with a slash
> > >>> - Then output whatever comes after the leading slash (in this case
> > >>> nothing)
> > >>> - Last output a slash because the path ends with a slash, thus ending
> > up
> > >>> with two slashes which is incorrect
> > >>>
> > >>> The logic always assume that there is some other content in between
> the
> > >>> starting and ending slash. This will of course fail if the path only
> > >>> consists of a single slash (or backslash).
> > >>>
> > >>> From what I can see this error was introduced in revision 1389069 on
> > >>> September 23, 2012. This means that it probably doesn't work on  any
> > >>> version from (and including) Camel 2.10.2. The version we have in
> > >>> production is Camel 2.7.1 which is why I haven't seen this problem
> > >>> before.
> > >>> I was now hoping to upgrade to the latest Camel (2.11.0) which is
> when
> > I
> > >>> ran into this problem.
> > >>>
> > >>> This seems like a major blocker to me. I suspect that most people
> > >>> uploading
> > >>> files with sftp will encounter this problem since you normally have
> "/"
> > >>> as
> > >>> your home directory. Furthermore, the FileUtil class resides in
> > >>> camel-core
> > >>> which means that a lot of other components than sftp might be
> affected.
> > >>>
> > >>> Can anyone verify this? Is it possible to have a quick patch release
> > (if
> > >>> I'm right?)
> > >>>
> > >>> /Bengt
> > >>>
> > >>>
> > >>> 2013/4/24 Bengt Rodehav <[hidden email]>
> > >>>
> > >>> > The following trace logging looks suspicious to me:
> > >>> >
> > >>> > 2013-04-24 09:34:40,776 | TRACE | terfaces/nfm/out | SftpOperations
> > >>> > | onent.file.remote.SftpOperations  377 | Current dir:
> /
> > >>> > 2013-04-24 09:34:40,782 | TRACE | terfaces/nfm/out | SftpOperations
> > >>> > | onent.file.remote.SftpOperations  385 |
> > >>> > changeCurrentDirectory(/)
> > >>> > 2013-04-24 09:34:40,782 | TRACE | terfaces/nfm/out | SftpO

Re: Detect is a route is started

2013-04-25 Thread Claus Ibsen
Hi

There is a getRouteStatus method
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/CamelContext.html#getRouteStatus(java.lang.String)

On Thu, Apr 25, 2013 at 10:48 AM, Jean Francois LE BESCONT
 wrote:
> Hey Folks !
>
> Just a little post to say that it sound tricky to detect if a route is
> started or not, the only way I have found is to do :
>
> Route route = camelContext.getRoute(...);
> boolean isRouteStarted =
> ((org.apache.camel.support.ServiceSupport)route).isStarted();
>
> Bye
>
> Jeff



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: JAXB marshal generates byte[] array instead of String

2013-04-25 Thread Claus Ibsen
Hi

I logged a ticket
https://issues.apache.org/jira/browse/CAMEL-6316

On Mon, Apr 22, 2013 at 8:55 AM, Claus Ibsen  wrote:
> Hi
>
> Fell free to log a ticket for such an improvement. And as usual
> patches is welcome.
>
>
> On Sat, Apr 20, 2013 at 5:00 PM, j_h_scheufen
>  wrote:
>> I just discovered the same thing. Using  with a jaxb data format
>> produces a byte[] which was not really expected, because the typical use
>> case  is to have a java.lang.String as input.
>>
>> I understand that downstream endpoints which expect a java.lang.String can
>> benefit from Camel's automatic conversion, but if the invoker of the route
>> expected to get the XML back as a String, you always have to remember to add
>> . You'd wish the jaxb data format had a property to
>> control the output ...
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/JAXB-marshal-generates-byte-array-instead-of-String-tp5715174p5731170.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Detect is a route is started

2013-04-25 Thread Jean Francois LE BESCONT
I am using it because camel looks to have a strange behavior.

I would like to execute code at the end of (spring/camel) context loading
and if the code execution is OK then start an other route.
( First I download referential data and load it )
( Secondly start route which process file and enrich it with data load
previously).

 For that  I do :

// This route is not started at the begining
from("file://C:/Temp/camel/?noop=true") .routeId("ROUTE_1")
.id("ROUTE_1") .autoStartup(false)
.log("file => ${file:name}") .end();
// This route is executed once and call a processor which load data and
start route 1 from("timer://runOnce?repeatCount=1&delay=1000")
.autoStartup(true)
.process(new MyProcessor()) .end();

And MyProcessor :

public class MyProcessor implements Processor {

static Logger LOG = LoggerFactory.getLogger(MyProcessor.class);


public void process(Exchange exchange) throws Exception {

  LOG.info("start MyProcessor");
  CamelContext camelContext = exchange.getContext();

  Route route = camelContext.getRoute("ROUTE_1");

  boolean isStarted =
((org.apache.camel.support.ServiceSupport)route).isStarted();
  if(isStarted) {
camelContext.suspendRoute("ROUTE_1", 1,TimeUnit.HOURS);
 }

  LOG.info("resume route 1 ");
  camelContext.resumeRoute("ROUTE_1");

  LOG.info("end MyProcessor");

}
}

 IF I do a test if route is started then the resume (start) really start :

[1) thread #0 - timer://runOnce] MyProcessorINFO  start
MyProcessor
[1) thread #0 - timer://runOnce] MyProcessorINFO
 resume route 1
[1) thread #0 - timer://runOnce] SpringCamelContext INFO
 Route: ROUTE_1 started and consuming from:
Endpoint[file://C:/Temp/camel/?noop=true]
[1) thread #0 - timer://runOnce] MyProcessorINFO  end
MyProcessor
[ead #2 - file://C:/Temp/camel/] ROUTE_1INFO  file
=> AED_20130208122307_6 - Copy.recycle
[ead #2 - file://C:/Temp/camel/] ROUTE_1INFO  file
=> AED_20130208122307_6.recycle
[ead #2 - file://C:/Temp/camel/] ROUTE_1INFO  file
=> AS_20130508122307_73dee092-7.csv

But If I suspend in all case :

public class MyProcessor implements Processor {
[...]
  Route route = camelContext.getRoute("ROUTE_1");
  camelContext.suspendRoute("ROUTE_1", 1,TimeUnit.HOURS);
  LOG.info("resume route 1 ");
  camelContext.resumeRoute("ROUTE_1");
[...]

Then the route is not really started :

[1) thread #0 - timer://runOnce] MyProcessorINFO
 resume route 1
[1) thread #0 - timer://runOnce] SpringCamelContext INFO
 Route: ROUTE_1 resumed and consuming from:
Endpoint[file://C:/Temp/camel/?noop=true]
[1) thread #0 - timer://runOnce] MyProcessorINFO  end
MyProcessor




I am using camel 2.11 / JRE 1.7

Bye

Jeff


2013/4/25 Jean Francois LE BESCONT 

>
> Hey Folks !
>
> Just a little post to say that it sound tricky to detect if a route is
> started or not, the only way I have found is to do :
>
> Route route = camelContext.getRoute(...);
> boolean isRouteStarted =
> ((org.apache.camel.support.ServiceSupport)route).isStarted();
>
> Bye
>
> Jeff
>
>


Re: Detect is a route is started

2013-04-25 Thread Jean Francois LE BESCONT
Thanks Claus for the link  !





2013/4/25 Claus Ibsen 

> Hi
>
> There is a getRouteStatus method
>
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/CamelContext.html#getRouteStatus(java.lang.String)
>
> On Thu, Apr 25, 2013 at 10:48 AM, Jean Francois LE BESCONT
>  wrote:
> > Hey Folks !
> >
> > Just a little post to say that it sound tricky to detect if a route is
> > started or not, the only way I have found is to do :
> >
> > Route route = camelContext.getRoute(...);
> > boolean isRouteStarted =
> > ((org.apache.camel.support.ServiceSupport)route).isStarted();
> >
> > Bye
> >
> > Jeff
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>


Re: DeadLetterChanel does not handle exception.

2013-04-25 Thread aram
Thank you! It really helped to solve the problem.



--
View this message in context: 
http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073p5731528.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: mina can't receive object

2013-04-25 Thread takidean
it means An existing connection was forcibly closed by the remote host

but i'm wondering if mina can receive object from sockets , because this is
the problem, when i send a String with dataoutputstrem its ok , when i use
to send objects with ObjectOutputStream  i get this  error



--
View this message in context: 
http://camel.465427.n5.nabble.com/mina-can-t-receive-object-tp5731478p5731529.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: mina can't receive object

2013-04-25 Thread Claus Ibsen
Hi

textline=true means you use text based codecs, and not object types.
So turn that option off or remove it.

See details at
http://camel.apache.org/mina

And dive into its unit tests for further examples
https://svn.apache.org/repos/asf/camel/trunk/components/camel-mina/src/test/

On Thu, Apr 25, 2013 at 11:42 AM, takidean  wrote:
> it means An existing connection was forcibly closed by the remote host
>
> but i'm wondering if mina can receive object from sockets , because this is
> the problem, when i send a String with dataoutputstrem its ok , when i use
> to send objects with ObjectOutputStream  i get this  error
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/mina-can-t-receive-object-tp5731478p5731529.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: recipientList not working properly

2013-04-25 Thread Nibs
its a very strange behaviour of camel don't know what went wrong
for validation 


works fine

but when i tring to do like this body become null


   
validator:file:C:/Users/eIntegrationXml/xsd/abc.xsd
 
   
   
  
xsdFilepro
   


but again when i tring to save my file using recipientList without
validation it works fine
 
   
file:C:/Users/eIntegrationXml/${header.batchID}/${header.orgnumber}/

   

outbox


Please help if anybody have any info about this strange behaviour of camel

Thanks in advance
   
   



--
View this message in context: 
http://camel.465427.n5.nabble.com/recipientList-not-working-properly-tp5731447p5731532.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to set a custom ExceptionHandler to a consumer

2013-04-25 Thread Claus Ibsen
Hi

I found the issue is a bug, as the netty component need to configure
the consumer when its created. So I have logged a ticket
https://issues.apache.org/jira/browse/CAMEL-6312

On Thu, Apr 18, 2013 at 5:53 PM, fbarbat  wrote:
> Hi Valerian,
>
> I was talking about org.apache.camel.spi.ExceptionHandler. As far as I know,
> OnException does not catch exceptions thrown inside the consumer such as
> java.nio.channels.ClosedChannelException.
>
> Any ideas?
>
> Thanks.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-set-a-custom-ExceptionHandler-to-a-consumer-tp5731097p5731099.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


How to replace a part of XML?

2013-04-25 Thread horyna
Hi,

i have a XML in exchange.body (
getExchanges().get(0).getIn().getBody(String.class) )

Has Camel some powerfull ability to change some elements in body?

Somethink like: .transform(body().replaceValueOfElement("","new
value"))



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-replace-a-part-of-XML-tp5731535.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: random splitter error

2013-04-25 Thread gmdavidson62
FYIwe fixed this, changing the split strategy from an XPATH to a
tokenized split.  When we "load tested" our routes with both strategies, we
were able to recreate the errors consistently with the XPATH split.  When we
changed to the tokenized split we never got an error, all
splits/aggregations were successful.

We didn't dig into the camel sourceso just a guess, but seems to be a
threading issue.  We may have been able to fix this in other
waysupgrading JDK, Camel or adding a thread pool???

Error:
No body available of type: java.lang.String but has value: [Policy: null] of
type: org.apache.xerces.dom.DeferredElementNSImpl on: Message:


This is what we did, changed the split to use:

instead of:
/BOB-GetPoliciesByClientResponse/Policies/Policy







--
View this message in context: 
http://camel.465427.n5.nabble.com/random-splitter-error-tp5731160p5731537.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to replace a part of XML?

2013-04-25 Thread Bob Jolliffe
This is the type of task xslt is really well suited for.  Use an identity
template with a specific override, something like:

 http://www.w3.org/1999/XSL/Transform";>

  

  

  

  
  

  




On 25 April 2013 13:03, horyna  wrote:

> Hi,
>
> i have a XML in exchange.body (
> getExchanges().get(0).getIn().getBody(String.class) )
>
> Has Camel some powerfull ability to change some elements in body?
>
> Somethink like:
> .transform(body().replaceValueOfElement("","new
> value"))
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-replace-a-part-of-XML-tp5731535.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Embedded ActiveMQ in Camel very very start up slow...up to 10 minutes to startup

2013-04-25 Thread gcameo
We use Camel extensively in our app. The broker configuration looks like this



























The broker is used for inter-vm communication and occasionally for third
party feed processing. Is there anything we can do to improve this as the
startup is now causing performance issues.

I must say though, that this is very random and sometimes the broker comes
up spontaneously.

Thanks in advance



--
View this message in context: 
http://camel.465427.n5.nabble.com/Embedded-ActiveMQ-in-Camel-very-very-start-up-slow-up-to-10-minutes-to-startup-tp5731541.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: 'fire and forge' from InOut exchange

2013-04-25 Thread brnzn1
Hi,

I have tried something like:
from("activemq:queue").
   setExchangePattern(ExchangePattern.InOut).
   beanRef([recipients list of beans ], "route").
   wireTap("direct:foo").
   end();

 from("direct:foo").to("bean:myBean")

It looks like I still got the response (on activemq queue) only when myBean
completed. To test it I paused the current thread in myBean. I wanted to
prove that even when myBean hold its thread the response is still sent. Is
my assumption wrong? If yes, how can I prove that myBean will not affect the
overall time of the flow?

Thanks 



--
View this message in context: 
http://camel.465427.n5.nabble.com/fire-and-forge-from-InOut-exchange-tp5731352p5731538.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Expected behavior of two consecutive convertBodyTo?

2013-04-25 Thread Al Ferguson
Hi,

I get an Address in a format (MyAddress, jaxb annotated) and I want to
convert this address in another format (ExternalAddress, jaxb annotated)
before invoking an Web service.



Curiously the second conversion (MyAddress to ExternalAddress, for which I
wrote a Converter) does not work. In fact my converter is not invoked. It
seems Camel tries rather a conversion of the original XML to
ExternalAddress.

When I invoke myself the converter via the ConvertAddress process, it works.

Is there something I do not understand in the behavior of convertBodyTo?

Thanks,
A. Fe



--
View this message in context: 
http://camel.465427.n5.nabble.com/Expected-behavior-of-two-consecutive-convertBodyTo-tp5731543.html
Sent from the Camel - Users mailing list archive at Nabble.com.


OT: Aggregation of billable data?

2013-04-25 Thread James Green
This isn't to do with Camel per se but I'm hopeful I'm asking this question
of the the right audience!

Basically we're going to be routing event messages into some storage
component where some of those messages may be billable to customers.

We have an existing service that charges customers based on a high level
aggregate summary of activity. We are missing a component that takes these
new event messages, performs business analysis on them, then sends them
onwards into our existing billing service.

BPM sounds almost like the thing we want, but it's rather broad given our
somewhat narrow scope.

Can any Camel users advise on what they use to aggregate events for billing
purposes?

Thanks,

James


Re: Ambiguity in DefaultCamelContext with TypeConverter

2013-04-25 Thread lleclerc
I have picked the code from OsgiCamelContextHelper to set the osgi parts, but
this helper do not apply for TypeConverter.

Here is the code for OsgiDefaultCamelContext :


It override the createTypeConverter() and addService is done while using a
getter from DefaultCamelContext (see my first post).

It is not a bug, I could go by creating a CamelContext which is GuiceOsgi. 
It's just that it would be cleaner to have a safe way to set the existing
parts instead of redefining the camelContext, but it will do the job.

Please let me know if it worth a change in DefaultCamelContext.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bug-in-DefaultCamelContext-with-TypeConverter-tp5731480p5731546.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: modifying endpoint

2013-04-25 Thread Vas
Hi Claus,
i was modified my route as below.





  Bye World

http://localhost:8080/app/jsp/second.jsp?bridgeEndpoint=true"/>


however I still get the same behavior.



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


Handle different route types in a single method

2013-04-25 Thread Mangiameli, Josiah
Hey All,


I am trying to write processor class that can process files retrieved from
different routes. Originally It was designed to handle email routes but I
also want to handle sftp, ftp or local file routes. However I am finding
that the ftp files are not delivered as a Message like an email is.

Is there a way that I could handle all different route delivery types in a
single process method like this?


*Here is how the routes are setup*

try{
context.addRoutes(new RouteBuilder() {
public void configure() throws Exception{
from(route).process(new FileProcessor());
}
});
}


*Here is how I am processing files and messages delivered*

public class FileProcessor implements Processor {

public void process(Exchange exchange) throws Exception {

   Map attachments =
exchange.getIn().getAttachments();



-- 
Josiah Mangiameli

Software Developer
Urjanet Energy Solutions

*(770) 262 9306*


Re: modifying endpoint

2013-04-25 Thread Claus Ibsen
For the HTTP error code then the its returned by the remote server
http://en.wikipedia.org/wiki/HTTP_404



On Thu, Apr 25, 2013 at 4:43 PM, Vas  wrote:
> Hi Claus,
> i was modified my route as below.
>
> 
> 
> 
> 
>   Bye World
> 
>  uri="http://localhost:8080/app/jsp/second.jsp?bridgeEndpoint=true"/>
> 
>
> however I still get the same behavior.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/modifying-endpoint-tp5731360p5731550.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: modifying endpoint

2013-04-25 Thread Vas
my actual endpoint is going to be change dynamically(adding "/test"
automatically). 

org.apache.camel.component.http.HttpOperationFailedException: HTTP operation
failed invoking http://localhost:8080/app/jsp/second.jsp/test/ with
statusCode: 404 

so that getting 404.
is there any solution to not to change the endpoint.

Thanks.




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


Re: Deadlocking in Camel on Linux, ok on Windows

2013-04-25 Thread Christian Müller
Hi David!

It's not a known issue. I had a short look into the code and the it happens
at the following line:
public Language resolveLanguage(String language) {
Language answer;
synchronized (languages) { // <- line 962
answer = languages.get(language);

// check if the language is singleton, if so return the shared
instance
if (answer instanceof IsSingleton) {
boolean singleton = ((IsSingleton) answer).isSingleton();
if (singleton) {
return answer;
}
}

// language not known or not singleton, then use resolver
answer = getLanguageResolver().resolveLanguage(language, this);
if (answer != null) {
languages.put(language, answer);
}
}
}

Can you raise a JIRA and attach a thread dump?

Best,
Christian


On Mon, Apr 22, 2013 at 2:28 PM, David Godfrey  wrote:

> I am using Camel within a web-application running on WebSphere
> Application Server v7.
>
>
> I am using a Camel Timer with a 1 second poll cycle. Originally I was
> using Camel 2.9.1, upgraded to 2.9.6 to see if that would make any
> difference.
>
> Observed behaviour is that when run on Windows, all works perfectly
> well. When running the same code on a Linux platform, I get a deadlock
> in DefaultCamelContextImpl, as follows:
>
> [22/04/13 13:56:32:586 EEST] 001e ThreadMonitor W   WSVR0605W:
> Thread "Default : 5" (001b) has been active for 661957
> milliseconds and may be hung.  There is/are 1 thread(s) in total in
> the server that may be hung.
> at
> org.apache.camel.impl.DefaultCamelContext.resolveLanguage(DefaultCamelContext.java:962)
>
> Before I post any more detail information, code examples, etc...is
> this a known problem? I searched as much as I could but couldn't find
> more information.
>
> I also tweaked the config of WebSphere on the linux platform, for
> example, allowing unlimited thread pool sizes to see if that made any
> difference but it does not appear to do so.
>
> many thanks!
>


RE: CXF Bean, MultiPart -> Couldn't find MIME boundary

2013-04-25 Thread Calvert, Zach (Zach)** CTR **
That was it.  Thank you Willem!

For those who run into this, the next route looks like:

http://0.0.0.0:8080/?matchOnUriPrefix=true&enableMultipartFilter=false"/>



-Original Message-
From: Willem jiang [mailto:willem.ji...@gmail.com] 
Sent: Thursday, April 18, 2013 8:10 PM
To: users@camel.apache.org
Subject: Re: CXF Bean, MultiPart -> Couldn't find MIME boundary

Camel Jetty component is using the org.eclipse.jetty.servlets.MultiPartFilter 
by default.
You can access the file from the message attachment just like this

Message in = exchange.getIn();
assertEquals("Get a wrong attachement size", 1, in.getAttachments().size()); // 
The file name is attachment id DataHandler data = in.getAttachment("image");

Then you should get the input stream from the data handler.  

--
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem





On Thursday, April 18, 2013 at 5:52 AM, Calvert, Zach (Zach)** CTR ** wrote:

> I'm having trouble submitting a multi-part form to a CXF endpoint. My route 
> looks like:
> 
>  uri="jetty:https://0.0.0.0:9005/submit/?matchOnUriPrefix=true"/>
>   uri="cxfbean:consumerList"/>  Where the list is a util 
> list of 1 endpoint consuming a POST method. The HTML form code is retrieved 
> from the same path using a GET, resulting in:
>  
> 
> 
>  
>name='image'> 
> 
>  
> Submitting a post triggers this in the logs:
> 2013-04-17 15:55:40,900 | WARN | qtp11314826-356 | 
> WebApplicationExceptionMapper | - - | WebApplicationException has been 
> caught : Couldn't find MIME boundary: 
> -173102388111750
>  
> I walked the code to org.apache.cxf.attachment.AttachmentDeserializer
> Where it obtains the "InputStream" content body using:
> ...
> boundary = boundaryString.getBytes("utf-8");
>  
> stream = new 
> PushbackInputStream(message.getContent(InputStream.class),
> pbAmount);
> ...
>  
> The resulting InputStream from the CXF Message, while non-null, always 
> returns -1 at the first read. In other words, this InputStream is empty 100% 
> of the time. I've verified using different browsers that the content is 
> submitted, and the MIME boundary is populated in the content. What is going 
> on with the input stream? Have I configured my CXF endpoint incorrectly in 
> some way, or am I missing a configuration detail in the form?
>  
> Any and all help is greatly appreciated!
>  
>  
> Thank you,
> Zach Calvert





Setting Default JSON Provider

2013-04-25 Thread Calvert, Zach (Zach)** CTR **
I have a route


http://0.0.0.0:8080/?matchOnUriPrefix=true&enableMultipartFilter=false"/>



and a bean configured:







How can I set this JSON Provider as my default provider for the cxfbean output 
of a function with the header like:
@GET
@Path("/sample")
@Produces({"application/json"})
public MyTest getSample() {

I get MyTest output, but it is not using the jsonProvider I want.  The format 
comes back as
{"myTest":{"id":"3e1fd608-130c-46c3-8e13-0bc93182f6d2"}}
when I want the root element removed and just get the
{"id":"3e1fd608-130c-46c3-8e13-0bc93182f6d2"}
as the response body.


Thanks,
Zach Calvert


Re: Register client when connecting to a topic?

2013-04-25 Thread Christian Müller
Subscribing to the advisory topics and than starting/stopping routs at
runtime using the Camel API should work.
I also do not have hands one experience with this.

Best,
Christian


On Thu, Apr 25, 2013 at 8:18 AM, Siano, Stephan wrote:

> Hi,
>
> ActiveMQ supports advisory topics you could subscribe to, so you might get
> the required information. I have never used them, so I cannot give you any
> hands on experience how to integrate this with Camel.
>
> Best regards
> Stephan
>
> -Original Message-
> From: PJ Walstroem [mailto:walst...@hotmail.com]
> Sent: Donnerstag, 25. April 2013 08:03
> To: users@camel.apache.org
> Subject: Register client when connecting to a topic?
>
> hello,
> when using an ActiveMQ topic with Camel (2.11.0), is there a way to make
> Camel dynamically aware of the clients subscribing to the topic? We are
> striving for loose coupling and our ideal scenario would be like this
>
> 1) Camel starts a topic, which is not durable
> 2) A hitherto unknown subscriber starts listening to the topic
> 3) Camel becomes aware of the subscriber
> 4) When the same subscriber stops listening, Camel becomes aware of the
> lost
> subscriber
>
> the reason we would like to have it like this, is that we would like to
> know
> - when sending messages on the topic - how many subscribers received the
> request, and consequently how many we received replies from.
>
> any thoughts would be highly appreciated!
>
> regards,
> Per Jorgen
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Register-client-when-connecting-to-a-topic-tp5731504.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


RE: Setting Default JSON Provider

2013-04-25 Thread Calvert, Zach (Zach)** CTR **
Bah, solved it.







...

...

-Original Message-
From: Calvert, Zach (Zach)** CTR ** [mailto:zcalv...@motive.com] 
Sent: Thursday, April 25, 2013 2:18 PM
To: users@camel.apache.org
Subject: Setting Default JSON Provider

I have a route


http://0.0.0.0:8080/?matchOnUriPrefix=true&enableMultipartFilter=false"/>
 

and a bean configured:




 

How can I set this JSON Provider as my default provider for the cxfbean output 
of a function with the header like:
@GET
@Path("/sample")
@Produces({"application/json"})
public MyTest getSample() {

I get MyTest output, but it is not using the jsonProvider I want.  The format 
comes back as {"myTest":{"id":"3e1fd608-130c-46c3-8e13-0bc93182f6d2"}}
when I want the root element removed and just get the 
{"id":"3e1fd608-130c-46c3-8e13-0bc93182f6d2"}
as the response body.


Thanks,
Zach Calvert


Re: random splitter error

2013-04-25 Thread Christian Müller
Can you share the load test with us? Than we could may fix it if it's an
issue in Camel.

Best,
Christian


On Thu, Apr 25, 2013 at 2:07 PM, gmdavidson62 wrote:

> FYIwe fixed this, changing the split strategy from an XPATH to a
> tokenized split.  When we "load tested" our routes with both strategies, we
> were able to recreate the errors consistently with the XPATH split.  When
> we
> changed to the tokenized split we never got an error, all
> splits/aggregations were successful.
>
> We didn't dig into the camel sourceso just a guess, but seems to be a
> threading issue.  We may have been able to fix this in other
> waysupgrading JDK, Camel or adding a thread pool???
>
> Error:
> No body available of type: java.lang.String but has value: [Policy: null]
> of
> type: org.apache.xerces.dom.DeferredElementNSImpl on: Message:
> 
>
> This is what we did, changed the split to use:
> 
> instead of:
> /BOB-GetPoliciesByClientResponse/Policies/Policy
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/random-splitter-error-tp5731160p5731537.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Expected behavior of two consecutive convertBodyTo?

2013-04-25 Thread Christian Müller
Can you share your type converter class with us?
Do you provide a TypeConverter file?

Best,
Christian


On Thu, Apr 25, 2013 at 3:07 PM, Al Ferguson  wrote:

> Hi,
>
> I get an Address in a format (MyAddress, jaxb annotated) and I want to
> convert this address in another format (ExternalAddress, jaxb annotated)
> before invoking an Web service.
>
>
>
> Curiously the second conversion (MyAddress to ExternalAddress, for which I
> wrote a Converter) does not work. In fact my converter is not invoked. It
> seems Camel tries rather a conversion of the original XML to
> ExternalAddress.
>
> When I invoke myself the converter via the ConvertAddress process, it
> works.
>
> Is there something I do not understand in the behavior of convertBodyTo?
>
> Thanks,
> A. Fe
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Expected-behavior-of-two-consecutive-convertBodyTo-tp5731543.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Headers are disapearing in RoutePolicy.onExchangeDone

2013-04-25 Thread garrydias
Hi, Claus.. sorry for delay.. I had to abandon this project for a while.

I added a step after routingSlip and the problem still remains.

Yes! The destination in #2 is the same as 1#.

Please, see the routes I already had tested:

works1.xml   
works2.xml   
does_not_work1.xml
  
does_not_work2.xml
  
does_not_work3.xml
  
does_not_work4.xml
  

Thanx



--
View this message in context: 
http://camel.465427.n5.nabble.com/Headers-are-disapearing-in-RoutePolicy-onExchangeDone-tp5728492p5731567.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Split and Xpath

2013-04-25 Thread RTernier
I'm having some issues running the xpath on my split. I know the Xpath for
the Choice isn't the best, but it works for now.

I'm getting errors saying:
Invalid xpath: //*[local-name()='QUCR_IN200101BC'],
//*[local-name()='GetDemographics']. Reason:
javax.xml.xpath.XPathExpressionException

Here's what I have:



The Xpath I have for the Split works perfectly fine in Altova XML Spy, yet
bombs here.  I was under the impression that on the Split, the Xpath would
return a NodeList which would be iterated through. The Xpath I have does do
this.

XML structure (I removed the nodes that don't matter). THe XML has a
Namespace, which I've added to my Spring XML.









Any Thoughts?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Split-and-Xpath-tp5731569.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Split and Xpath

2013-04-25 Thread RTernier
Realized Camel only supports XPath 1.0. The xpath i was using was 2.0.
Modified and it's working.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Split-and-Xpath-tp5731569p5731570.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Split and Xpath

2013-04-25 Thread RTernier
I realized that it only supports XPath 1.0, I changed it so the xPath is:

//v3:QUCR_IN200101BC | //v3:GetDemographics

However, when I do that I get this on the output:

[GetDemographics: null]
[v3:QUCR_IN200101BC: null]

It seems it grabbed the right nodes, but nothing under them. Thoughts?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Split-and-Xpath-tp5731569p5731571.html
Sent from the Camel - Users mailing list archive at Nabble.com.


EIP Support for Lucidcharts

2013-04-25 Thread alexb
Vote to support EIP integration in lucidchats.  Good design tools will help
the product like Camel to gain traction in a corporate environment.
Just hit the "Me Too!" button at the link below.

http://support.lucidchart.com/entries/21544329-Support-for-Enterprise-Integration-Patterns

Thanks for your help.



--
View this message in context: 
http://camel.465427.n5.nabble.com/EIP-Support-for-Lucidcharts-tp5731572.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS transaction behavior inside of route

2013-04-25 Thread leroykendall
Hi Claus,

Thank you for the link to the great page.
One issue that I've stuck is how to perform JMS redelivery in Camel using
Spring orchestrated transactions.
My spring context is:












































${in.body} contains
'exception'









When I executed this code I've got message "Exhausted after delivery
attempt: 1" instead of "exponential back off" redelivery.
Could you please help?

Thanks.
--Victor



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-transaction-behavior-inside-of-route-tp5730513p5731566.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: OT: Aggregation of billable data?

2013-04-25 Thread Willem jiang
I'm not sure if the billing service needs the data from the business analysis.
If it doesn't need those data, it could be more easy by using wire-tap[1]

[1]http://camel.apache.org/wire-tap.html  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, April 25, 2013 at 9:29 PM, James Green wrote:

> This isn't to do with Camel per se but I'm hopeful I'm asking this question
> of the the right audience!
>  
> Basically we're going to be routing event messages into some storage
> component where some of those messages may be billable to customers.
>  
> We have an existing service that charges customers based on a high level
> aggregate summary of activity. We are missing a component that takes these
> new event messages, performs business analysis on them, then sends them
> onwards into our existing billing service.
>  
> BPM sounds almost like the thing we want, but it's rather broad given our
> somewhat narrow scope.
>  
> Can any Camel users advise on what they use to aggregate events for billing
> purposes?
>  
> Thanks,
>  
> James  




Re: OT: Aggregation of billable data?

2013-04-25 Thread Hadrian Zbarcea

Hi James,

Very good and interesting use case. You could use BPM, indeed, but I 
think it's way to heavy weight for what you need to do. CEP would be 
another idea, but I digress.


Wire-tap won't help you, I believe Willem misunderstood your question.

So here's what I think: you have your system, it emits some events 
(messages) when things take place on behalf of a user. (I think in Camel 
3 we'll have even more goodies to handle your scenario... and I digress 
again). So I assume your events are send via some protocol that Camel 
understand, something from tcp/ip (camel-mina or camel-netty would 
help), to maybe http, or a web service call (rest maybe?) or even a 
database. So you'd need a Camel endpoint to send your events to and 
start a Camel route. Using the dsl it's trivial, you probably saw tons 
of examples. If your events are actually api calls, it is a bit less 
straightforward, you may need to write a component (which is easy) and 
there are other options. I won't get into details unless you confirm 
that this is the case.


Once you have your endpoint, you need to setup a route to do your 
aggregation. The route and processing is easy to define using the dsl. 
Based on what you described your route would probably contain some 
aggregation [1], I assume you have some correlation ids there 
identifying both the user/account and the activity you're charing for. 
You may use other things depending on your logic, such as a filter, 
content based router, who knows. If you are not familiar with the EIPs 
[2] it's worth taking a quick look. At the end of the route, once you're 
done with the processing you'll need to send your result to the billing 
service (also available at some url).


What's nice about your scenario is that it sounds non intrusive to your 
business logic, it's async, one way (in-only) so it would scale really 
well and should not create any headaches.


I hope this helps and I hope I did not misunderstand your request. 
Obviously more details you provide about your scenario, more concrete 
answers you're gonna get.


Cheers,
Hadrian


[1] http://camel.apache.org/aggregator2.html
[2] http://camel.apache.org/eip.html



On 04/25/2013 09:15 PM, Willem jiang wrote:

I'm not sure if the billing service needs the data from the business analysis.
If it doesn't need those data, it could be more easy by using wire-tap[1]

[1]http://camel.apache.org/wire-tap.html

--
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem





On Thursday, April 25, 2013 at 9:29 PM, James Green wrote:


This isn't to do with Camel per se but I'm hopeful I'm asking this question
of the the right audience!

Basically we're going to be routing event messages into some storage
component where some of those messages may be billable to customers.

We have an existing service that charges customers based on a high level
aggregate summary of activity. We are missing a component that takes these
new event messages, performs business analysis on them, then sends them
onwards into our existing billing service.

BPM sounds almost like the thing we want, but it's rather broad given our
somewhat narrow scope.

Can any Camel users advise on what they use to aggregate events for billing
purposes?

Thanks,

James





Re: Register client when connecting to a topic?

2013-04-25 Thread PJ Walstroem
Thank you for the answers! Advisory topics seems to be just what we were
looking for. I will dive into this and post my experiences here when I find
out more about it.

cheers,
pj



--
View this message in context: 
http://camel.465427.n5.nabble.com/Register-client-when-connecting-to-a-topic-tp5731504p5731578.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: EIP Support for Lucidcharts

2013-04-25 Thread James Strachan
Cool. Incidentally Fuse IDE has an "Export Diagram" option (right
click on the canvas), so you can export your camel route image to
JPG/BMP for inclusion into PowerPoint etc.

On 26 April 2013 01:36, alexb  wrote:
> Vote to support EIP integration in lucidchats.  Good design tools will help
> the product like Camel to gain traction in a corporate environment.
> Just hit the "Me Too!" button at the link below.
>
> http://support.lucidchart.com/entries/21544329-Support-for-Enterprise-Integration-Patterns
>
> Thanks for your help.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/EIP-Support-for-Lucidcharts-tp5731572.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
James
---
Red Hat

Email: jstra...@redhat.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/

Open Source Integration


Re: Expected behavior of two consecutive convertBodyTo?

2013-04-25 Thread Claus Ibsen
Hi

Sounds a bit like this FAQ
http://camel.apache.org/why-is-my-message-body-empty.html

Also what version of Camel do you use?

And how have you implemented your type converters?

On Thu, Apr 25, 2013 at 3:07 PM, Al Ferguson  wrote:
> Hi,
>
> I get an Address in a format (MyAddress, jaxb annotated) and I want to
> convert this address in another format (ExternalAddress, jaxb annotated)
> before invoking an Web service.
>
>
>
> Curiously the second conversion (MyAddress to ExternalAddress, for which I
> wrote a Converter) does not work. In fact my converter is not invoked. It
> seems Camel tries rather a conversion of the original XML to
> ExternalAddress.
>
> When I invoke myself the converter via the ConvertAddress process, it works.
>
> Is there something I do not understand in the behavior of convertBodyTo?
>
> Thanks,
> A. Fe
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Expected-behavior-of-two-consecutive-convertBodyTo-tp5731543.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: random splitter error

2013-04-25 Thread Claus Ibsen
You uses old versions of XML libraries like xerces 2.6.x and have
mixed version of jdom, spring JARs and whatnot. All that can lead to a
bit "unstable" deployment.

You may want to look at upgrading xerces and/or xalan etc.


On Thu, Apr 25, 2013 at 10:24 PM, Christian Müller
 wrote:
> Can you share the load test with us? Than we could may fix it if it's an
> issue in Camel.
>
> Best,
> Christian
>
>
> On Thu, Apr 25, 2013 at 2:07 PM, gmdavidson62 wrote:
>
>> FYIwe fixed this, changing the split strategy from an XPATH to a
>> tokenized split.  When we "load tested" our routes with both strategies, we
>> were able to recreate the errors consistently with the XPATH split.  When
>> we
>> changed to the tokenized split we never got an error, all
>> splits/aggregations were successful.
>>
>> We didn't dig into the camel sourceso just a guess, but seems to be a
>> threading issue.  We may have been able to fix this in other
>> waysupgrading JDK, Camel or adding a thread pool???
>>
>> Error:
>> No body available of type: java.lang.String but has value: [Policy: null]
>> of
>> type: org.apache.xerces.dom.DeferredElementNSImpl on: Message:
>> 
>>
>> This is what we did, changed the split to use:
>> 
>> instead of:
>> /BOB-GetPoliciesByClientResponse/Policies/Policy
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/random-splitter-error-tp5731160p5731537.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Null Body

2013-04-25 Thread TonyK
I have two routes, the parent route uses jms with the inout EIP to call the
below route, and uses the transferException parameter so that exceptions get
returned to the parent route. The problem is that in my child route I
unmarshal using jaxb before calling a bean, when an exceptions occurs in
that bean and the exception returns to the parent route the body is always
null. I've tried using the useOriginalMessage in the onException element,
but the body is still null when returned to the parent. If more information
is required, please let me know.

Thank you,
Tony


java.lang.Exception












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


Re: Split and Xpath

2013-04-25 Thread Claus Ibsen
You can add camel-saxon to the classpath which supports xpath 2.0
http://camel.apache.org/xpath.html

On Fri, Apr 26, 2013 at 2:14 AM, RTernier  wrote:
> Realized Camel only supports XPath 1.0. The xpath i was using was 2.0.
> Modified and it's working.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Split-and-Xpath-tp5731569p5731570.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: JMS transaction behavior inside of route

2013-04-25 Thread Claus Ibsen
Hi

Its the message broker that does the external redelivery. Camel
doesn't do it. Camel just log that there was an exception thrown
during routing, and its regarded as exhausted after the very first
delivery attempt (eg no redelivery).

So that triggers a rollback on the TX, which the TX manager handles,
and the message broker, will then know that the message failed, and it
can react according to its redelivery settings.




On Thu, Apr 25, 2013 at 11:01 PM, leroykendall  wrote:
> Hi Claus,
>
> Thank you for the link to the great page.
> One issue that I've stuck is how to perform JMS redelivery in Camel using
> Spring orchestrated transactions.
> My spring context is:
>
>  class="org.apache.camel.component.jms.JmsComponent">
> 
> 
> 
> 
> 
>
>  class="org.springframework.jms.connection.JmsTransactionManager">
> 
> 
>
>  class="org.apache.activemq.pool.PooledConnectionFactory">
> 
> 
>
>  class="org.apache.activemq.ActiveMQConnectionFactory">
> 
> 
> 
>
>  class="org.apache.activemq.RedeliveryPolicy">
> 
> 
> 
> 
> 
>
>class="org.apache.camel.spring.spi.SpringTransactionPolicy">
> 
> 
>
>  class="java.lang.IllegalArgumentException"/>
>
> 
>
> 
>
> 
> 
> 
> 
> 
> 
> ${in.body} contains
> 'exception'
> 
> 
> 
> 
> 
> 
>
> 
>
> When I executed this code I've got message "Exhausted after delivery
> attempt: 1" instead of "exponential back off" redelivery.
> Could you please help?
>
> Thanks.
> --Victor
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/JMS-transaction-behavior-inside-of-route-tp5730513p5731566.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Null Body

2013-04-25 Thread Claus Ibsen
Hi

Sounds like this FAQ
http://camel.apache.org/why-is-my-message-body-empty.html

On Thu, Apr 25, 2013 at 11:49 PM, TonyK  wrote:
> I have two routes, the parent route uses jms with the inout EIP to call the
> below route, and uses the transferException parameter so that exceptions get
> returned to the parent route. The problem is that in my child route I
> unmarshal using jaxb before calling a bean, when an exceptions occurs in
> that bean and the exception returns to the parent route the body is always
> null. I've tried using the useOriginalMessage in the onException element,
> but the body is still null when returned to the parent. If more information
> is required, please let me know.
>
> Thank you,
> Tony
>
> 
> java.lang.Exception
>  backOffMultiplier="2" 
> useExponentialBackOff="true" />
> 
>
> 
> 
> 
> 
> 
> 
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Null-Body-tp5731568.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen