Re: Reporting with Camel

2013-08-05 Thread Christoph Emmersberger
Hi - I found these considerations but it seems that there has not been to much 
effort in this area:

Mailing List: 
http://mail-archives.apache.org/mod_mbox/camel-dev/200910.mbox/%3C806480219.1256720872768.JavaMail.jira@brutus%3E
JIRA: https://issues.apache.org/jira/browse/CAMEL-781

- Christoph


On Aug 5, 2013, at 2:22 AM, gliesian wrote:

 Have reporting features from any report engine (e.g., Jasper or BIRT) been
 integrated with camel yet?
 
 
 
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Reporting-with-Camel-tp5736766.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Dynamic xsl with custom uri resolver

2013-08-05 Thread Claus Ibsen
Hi

See this FAQ
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

On Fri, Aug 2, 2013 at 2:15 PM, ericsodt dean.eric...@ll.mit.edu wrote:
 mox,

 There is no CSS nor HTML involved.

 The call to '.to(xslt:transformSubject.xsl?uriResolver=#emailResolver) '
 does an xslt transformation.  I'm trying to figure out how to make
 'transformSubject.xsl' dynamic while still being able to use my custom
 URIResolver.

 Thanks!





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Dynamic-xsl-with-custom-uri-resolver-tp5736668p5736703.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: StreamCaching with slip not working

2013-08-05 Thread Claus Ibsen
This is a bug in Camel and has been fixed recently. So will be fixed
in upcoming releases.

On Mon, Jul 22, 2013 at 8:44 PM, ramrubio ramru...@yahoo.com wrote:
 Stepping through code noticed that InputStreamRequestEntity is used during
 post request.

 A call to InputStreamRequestEntity.getContentLength leads to a call to
 bufferContent because contentLength is set to CONTENT_LENGTH_AUTO.  The type
 of inputStream that is set in InputStreamRequestEntity is of type
 InputStreamCache.

 Because position is set to the end of the inputstream (see below) the call
 to bufferContent results in buffer set to empty and the size is updated to
 0.  This causes POST request to always have an empty body.

 thisInputStreamRequestEntity  (id=169)
 buffer  null
 content InputStreamCache  (id=146)
 buf  (id=154)
 count   10
 mark0
 pos 10
 contentLength   -2
 contentType application/json (id=172)

 Is this expected?

 /Ramon





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



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


Re: Camel route stop consuming

2013-08-05 Thread Willem jiang
Hi,

Can you check the status of envioMailProcessor?
It could be some thing wrong when sending the mail to user.


--  
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 Saturday, August 3, 2013 at 4:53 AM, jaime.salvador wrote:

 Thanks for you reply, this is my routes
  
 String dd[] = { direct:mail01, direct:mail02 ... direct:mail50 };  
  
 from(activemq:mail?concurrentConsumers=15)
 .delay( 500 )
 .loadBalance( )
 .roundRobin( )
 .to(dd);
  
 from( direct:mail01 )
 .beanRef( envioMailProcessor01, processLoadbalancer )
 .
 .
 .
  
  
 The envioMailProcesorXX sends a mail to the user.
  
 Using seda, only replace activemq:mail with seda:mail
  
 Thanks
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-route-stop-consuming-tp5736611p5736714.html
 Sent from the Camel - Users mailing list archive at Nabble.com 
 (http://Nabble.com).





Promoting the exchange message cause exception as property or header when moving it to dead letter queue

2013-08-05 Thread Darwish
Hi ,

I wonder  if it possible for camel to add custom property or header on the
message that  exhausted all  redelivery retries and moved to  dead letter
queue  

This property may contain serialized version of the exception that lead
moving that message to dead letter queue 

This property will be very helpful– for me at least  - when processing those
dead letter queue messages and usually creating NAK messages 

My current alternative option for creating such NAK message is to handle
those exceptions in each route 

Please advice 



-
Othman Darwish
ProgressSoft Corp.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Promoting-the-exchange-message-cause-exception-as-property-or-header-when-moving-it-to-dead-letter-qe-tp5736778.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel route stop consuming

2013-08-05 Thread Claus Ibsen
Hi

You are taking in too many messages than you can process. Its not a
good idea to have 2000+ messages in memory sitting on seda queues
waiting to be processed.

And why do you use the delay (500) ?


On Thu, Aug 1, 2013 at 4:01 AM, jaime.salvador jaime.salva...@gmail.com wrote:
 Hi,

 I have a big number of messages routed to a ActiveMQ queue. the route works
 fine at begining, but after some hours of work, Camel stop comsuming the
 messages from queue.

 I try to get out activemq and use SEDA and the same problema apears.

 I have the next message when I try to stop Camel:

 2013-07-28 11:32:53,140 INFO [org.apache.camel.impl.DefaultShutdownStrategy]
 -
 Waiting as there are still 2262 inflight and pending exchanges to complete,
 timeout in 287 seconds.

 Any idea?

 Thanks a lot



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-route-stop-consuming-tp5736611.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Promoting the exchange message cause exception as property or header when moving it to dead letter queue

2013-08-05 Thread Claus Ibsen
The dead letter endpoint can just be another route, and then use the
direct component to send to that route. And in the route you can
enrich the message with the details you want, before sending to the
actual dead letter channel.

On Mon, Aug 5, 2013 at 9:47 AM, Darwish othman.darw...@progressoft.com wrote:
 Hi ,

 I wonder  if it possible for camel to add custom property or header on the
 message that  exhausted all  redelivery retries and moved to  dead letter
 queue

 This property may contain serialized version of the exception that lead
 moving that message to dead letter queue

 This property will be very helpful– for me at least  - when processing those
 dead letter queue messages and usually creating NAK messages

 My current alternative option for creating such NAK message is to handle
 those exceptions in each route

 Please advice



 -
 Othman Darwish
 ProgressSoft Corp.

 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Promoting-the-exchange-message-cause-exception-as-property-or-header-when-moving-it-to-dead-letter-qe-tp5736778.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Inserting oracle XMLType with camel

2013-08-05 Thread Christian Müller
Thanks for sharing the solution and good to know you could figure it out by
yourself.

Best,
Christian
Am 05.08.2013 07:29 schrieb OHolzma oliver.holzm...@gmail.com:

 Thanks for your response.

 It was just a classpath issue. I just added oracles orai18n.jar, xdb.jar,
 xmlparserv2.jar to my classpath. Then the data is inserted as XML and not
 as
 a LARGE value.



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Inserting-oracle-XMLType-with-camel-tp5736729p5736772.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Risk of JMS flooding with long-lasted redelivery policy ?

2013-08-05 Thread Claus Ibsen
Use async delayed in the error handler / onException. And also
asyncConsumer=true on the jms consumer.

On Fri, Aug 2, 2013 at 3:51 PM, Bernard Ligny bernard.li...@gmail.com wrote:
 Can someone please confirm what my colleague has observed on our project (NB:
 We use Camel 2.8.5).

 Let us take for instance:
 - a JMS consumer (with a particular value of maxConcurrentConsumers)
 - a (non transacted) error handler with the following redelivery policy:
* a large number of retries (ex: 20)
* a significant amount of times between 2 attempts (ex: 5 sec)
* useExponentialBackOff=true + backOffMultiplier

 So, in the worst situation, the complete retry process (for a single
 exchange) will take a very a long time:
 20 attempts x (at least 5) sec =  more than 100 sec

 During the time (100 sec) Camel is busy with the processing of this single
 exchange, we may of course receive many items in the JMS queue.

 What we have observed, is that the JMS consumer is staying busy and does NOT
 release its jms session until a successful attempt. In my example, a jms
 consumer will hold the connection for 100 sec, even while sleeping between 2
 attempts ! Needless to say that, in case of burst on the producer side,
 there could be rapidly no more enough free consumers...

 I do not understand why (in a non transacted route) Camel does not
 immediately release its jms session.
 Is it a wanted behaviour (and also a good practice) to keep holding the JMS
 connection till the end of the processing of the exchange ?
 If we decide for instance to wait 60 sec between 2 attempts, I would like
 for instance to pause/free my jms consumer so that he can serve other
 potential messages present in my queue.








 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Risk-of-JMS-flooding-with-long-lasted-redelivery-policy-tp5736707.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Promoting the exchange message cause exception as property or header when moving it to dead letter queue

2013-08-05 Thread Darwish
if i got you ... i need to define deadLetterChannel as error handler and that
dead letter channel send the exchange to direct end point , inside that
direct route  enrich my exchange as i want  ?









-
Othman Darwish
ProgressSoft Corp.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Promoting-the-exchange-message-cause-exception-as-property-or-header-when-moving-it-to-dead-letter-qe-tp5736778p5736783.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Promoting the exchange message cause exception as property or header when moving it to dead letter queue

2013-08-05 Thread Claus Ibsen
Yeah you can do that

On Mon, Aug 5, 2013 at 10:51 AM, Darwish othman.darw...@progressoft.com wrote:
 if i got you ... i need to define deadLetterChannel as error handler and that
 dead letter channel send the exchange to direct end point , inside that
 direct route  enrich my exchange as i want  ?









 -
 Othman Darwish
 ProgressSoft Corp.

 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Promoting-the-exchange-message-cause-exception-as-property-or-header-when-moving-it-to-dead-letter-qe-tp5736778p5736783.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Risk of JMS flooding with long-lasted redelivery policy ?

2013-08-05 Thread Bernard Ligny
Thanks Clause.
Unfortunately, as i said, we use Camel v2.8.5 on our project, and
asyncConsumer was introduced in Camel 2.9 :-(

Do yo see a(nother) possible solution or workaround that could be applied in
Camel 2.8.5 ?

Bernard.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Risk-of-JMS-flooding-with-long-lasting-redelivery-policy-tp5736707p5736786.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Promoting the exchange message cause exception as property or header when moving it to dead letter queue

2013-08-05 Thread Darwish
Many Thanks 



-
Othman Darwish
ProgressSoft Corp.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Promoting-the-exchange-message-cause-exception-as-property-or-header-when-moving-it-to-dead-letter-qe-tp5736778p5736787.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: combining the existing content with a file having dynamic uri then moving the file

2013-08-05 Thread skumar
Hi Claus,
  I am using consumer template to for the same work in the thread as
I want a pattern based reading of file and then move the file after renaming
it with current date some thing like :
file:{{inbound_home}}/bony?include=.*_BNYM_.*txtamp;move={{data_home}}/${file:onlyname.noext}_${date:now:MMdd}.TXTamp;moveFailed={{data_home}}/errorfileamp;doneFileName=LOADAVAILBNYM

My Route is like this:

from uri=timer://foo?fixedRate=trueamp;period=50 /
to uri=bean:locatesSql?method=getFileFormatDetails /
split
simple${in.header.accounts}/simple
   setHeader
headerName=clientFileDirsimple${in.body.inFileDir}/simple/setHeader 
choice when  
to id=result
uri=bean:locatesConsumer?method=consumeBnymFile /
unmarshal ref=bnymAvailabilityBeanIo
/
process ref=bnymAvailabilityProcessor
/
to
uri=bean:locatesSql?method=processLocatesFile /
to
uri=bean:jobLogger?method=logJobCompleted /
/when /choice/split

Here inside the camel Header(in.header.accounts) I am keeping list of
account details its type is:
com.oceanview.eai.model.Account

After this on a separate class file named Consumer template I have:

   @Autowired
private ConsumerTemplate consumer;
@Autowired
private ProducerTemplate producer;
public void consumeBnymFile(Exchange arg) throws Exception {
String fileUri =
file:{{inbound_home}}/var/tmp/locates/test/bony?fileName=TEST_BNYM.txt;
consumer.start(); 

while(true) {
Exchange  ex = consumer.receive(fileUri, 2000); 
if(ex != null) { 
log.info(Fetching file:  +
ex.getIn().getHeader(CamelFileName)); 
   // producer.send(fileUri, ex);
arg.getIn().setHeader(CamelFileName,
ex.getIn().getHeader(CamelFileName));
arg.getIn().setBody(ex.getIn().getBody());
} 
 
}
I have two problems:
1)In first iteration it runs fine but in second and subsequest I am
receiving this error:
Message: com.oceanview.eai.model.Account@338bd37a. Caused by:
 No type converter available to convert from type:
com.oceanview.eai.model.Account to the required type: 
 java.io.InputStream with value com.oceanview.eai.model.Account@338bd37a. 
 Exchange[Message: com.oceanview.eai.model.Account@338bd37a]. Caused by:
[org.apache.camel.NoTypeConversionAvailableException - 
 No type converter available to convert from type:
com.oceanview.eai.model.Account to the required type: 
 java.io.InputStream with value com.oceanview.eai.model.Account@338bd37a]

2.I am not being able to use include=.*_BNYM_.*tx or move or move failed in
String fileUri =
file:{{inbound_home}}/bony?include=.*_BNYM_.*txtamp;move={{data_home}}/${file:onlyname.noext}_${date:now:MMdd}.TXTamp;moveFailed={{data_home}}/errorfileamp;


Please help...

Thanks,
Sanjeev









 



--
View this message in context: 
http://camel.465427.n5.nabble.com/combining-the-existing-content-with-a-file-having-dynamic-uri-then-moving-the-file-tp5736365p5736797.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Unit of Work Scope and direct/SEDA/vm components

2013-08-05 Thread Scott Parkerson
Hi, fellow Camel riders.

I was wondering where Camel's notion of UnitOfWork begins and ends with
respect to processing a route or set of routes.

For example, I have a route that starts with a SFTP poller that consumes
files off of a server. The contents of these files are then handed to
another route via the direct component, which is responsible for filtering
and routing the data to other processors that are on multiple camel
contexts. As such, I have been using the vm component to pass that data to
the appropriate processing route.

What's strange is that it seems like the files are not marked as processed
(i.e. the original SFTP component does not move the files to the processed
directory until the message is completely handled by the second route. This
is a problem because the second route actually splits and aggregates data
in the file, and, as such, the data may not be released from the aggregator
until later. Furthermore, the SFTP connection in the body may not be valid
anymore, and even if it is, it seems like splitting the data also splits
the notion that that data came from a SFTP consumer, which makes lots of
stack traces.

What I want to know is: how can I make sure that the file on the SFTP
server is marked processed before it goes off to the handling route? Do I
need to send the data to a file or an JMS/ActiveMQ queue first?

Thanks,
Scott Parkerson


2 JaxbDataFormat in the same route doesnt work

2013-08-05 Thread mikael_th
Hello,

I am trying to unmarshall an XML string to a JAXB object, convert this to
another JAXB object and then marshall this before I send it on a queue.

The problem is that in the example below the unmarshall call is using the
vgtInternalJaxb DataFormat and not the jaxb DataFormat which is sent to it.

Is it not possible to have 2 JaxbDataFormats in the same route ?

Thanks for any input

// Mikael

*Example code:*

@Component
public class GetStatusResponseLocalRoute extends SpringRouteBuilder {

@Override
public void configure() throws Exception {
DataFormat vgtInternalJaxb = new
JaxbDataFormat(com.company.site.vehicle.statusnot._1_0);
DataFormat jaxb = new
JaxbDataFormat(com.othercompany.vehicle.status._1_0);


from(servlet:///vehicle_status_local)
.setHeader(Accept, simple(text/xml))
.setHeader(Authorization, simple(username:passw))
.setHeader(Exchange.HTTP_URI,
simple(http://localhost:8080/web/v1.0/vehicle/status/current/;))
.to(https://www.company.com/site/test/;)
.convertBodyTo(String.class)
.log(GetStatusResponseLocalRoute response: ${body})
.unmarshal(jaxb)
.beanRef(vehicleStatusResponseHandler, handleResponse)
.convertBodyTo(VehicleStatusNotification.class)
.marshal(vgtInternalJaxb)
.convertBodyTo(String.class)
.log( GetStatusResponseLocalRoute ${body})
.to(wmq:MY.QUEUE);
}
}




--
View this message in context: 
http://camel.465427.n5.nabble.com/2-JaxbDataFormat-in-the-same-route-doesnt-work-tp5736799.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unit of Work Scope and direct/SEDA/vm components

2013-08-05 Thread Bilgin Ibryam
Hi,
The file component uses onCompletion for moving files after the exchange
has completed. As long as the completions are passed with the exchange the
files wont move. The VM component passes the completions to the next camel
context so the files are not moved... You have to use a queue or something
like wiretap to stop completions.

HTH
Bilgin

Sent from mobile
On 5 Aug 2013 18:07, Scott Parkerson sc...@parkerson.net wrote:

 Hi, fellow Camel riders.

 I was wondering where Camel's notion of UnitOfWork begins and ends with
 respect to processing a route or set of routes.

 For example, I have a route that starts with a SFTP poller that consumes
 files off of a server. The contents of these files are then handed to
 another route via the direct component, which is responsible for filtering
 and routing the data to other processors that are on multiple camel
 contexts. As such, I have been using the vm component to pass that data to
 the appropriate processing route.

 What's strange is that it seems like the files are not marked as processed
 (i.e. the original SFTP component does not move the files to the processed
 directory until the message is completely handled by the second route. This
 is a problem because the second route actually splits and aggregates data
 in the file, and, as such, the data may not be released from the aggregator
 until later. Furthermore, the SFTP connection in the body may not be valid
 anymore, and even if it is, it seems like splitting the data also splits
 the notion that that data came from a SFTP consumer, which makes lots of
 stack traces.

 What I want to know is: how can I make sure that the file on the SFTP
 server is marked processed before it goes off to the handling route? Do I
 need to send the data to a file or an JMS/ActiveMQ queue first?

 Thanks,
 Scott Parkerson



Re: Camel route stop consuming

2013-08-05 Thread jaime.salvador
Hi,

Nice to see a reply by you (I have a paper copy of Camel in Action, great
book!)

The delay(500) is for spam prevention, having to much mails sends in a
second the server is considerd a spam and is blocked.

My route work as a massive mail sender that load balance the work to 50
mails account, and to prevent spam I put the delay.

I notice that the route stop workin with activemq and with seda, the only
diference is that with SEDA, if I restart the server, all messages are
lost!!!

thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-route-stop-consuming-tp5736611p5736801.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel Performance

2013-08-05 Thread salemi
Hi,

I was wondering how can improve the performance of  the route below!
route id=operationalRoute autoStartup=false
from uri=jms:topic:opertopic/
transacted/
unmarshal ref=ccisJSON/  
choice
when
simple${body.messagetype} contains 
'OPER'/simple
to uri=direct:gigaspacesInterface/
/when
when
simple${body.messagetype} contains 'CONTROL'/simple
to uri=direct:sourceStatusRoute/
/when
when
simple${body.messagetype} contains 
'ADMIN'/simple
to uri=direct:adminRoute/
 /when
 otherwise
 log loggingLevel=INFO message= ${body}/
  /otherwise
/choice
/route

I see the following times consumed using dynaTrace.
1. If I marked a route transacted I have lost of the performance of about
10ms per message!
2. The unmarshal tag takes about 2.5ms. If you have the Objectmapper already
created the unmarshalling supposed to be in micro-second.
3. Creating Expression  (choice) and evaluating of it takes in average 11ms.

Any suggestion how to improve the performance of the 3 items mentioned
above?



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Performance-tp5736810.html
Sent from the Camel - Users mailing list archive at Nabble.com.