Re: Camel 2.15.1 XSLT returning only the closing tags

2017-03-27 Thread Tomohisa Igarashi

Hi,

On 03/28/2017 06:43 AM, Boba wrote:

I am trying to do a really simple xml to xml transformation using the xslt
uri, I have dumbed it down so the input and transformed messages are
basically the same to try and work this out...
I used stylus studio to create the xml to xml mapping (I'm not knowledgeable
in xslt)

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








Request
End


















It works well running camel standalone on my windows vm but when I deploy to
Tomcat7 on oracle java 8 (now and 7 previously) on ubuntu 14.04 32bit VM
server, the bulk of the response is just close tags i.e.



 
 End
 
 



This could be the correct output if the valued of Message/element_[134] are 
actually empty though, is your input really have those values?

Thanks,
Tomo


I use the Camel spring XML DSL and am referencing the xsl files from the
local



There are a few posts that suggest a number of options including using the
xalan transformer factory


or saxon


I added the relevant dependencies in my POM

   org.apache.camel
   camel-saxon
   ${camel-version}
 

 
   xalan
   xalan
   2.7.1
 

I have also tried, as suggested by one post, converting the body to
java.io.InputStream just before the XSLT


So I have been at this solidly over the week-end and today... I can't see
what is wrong

Any help ...please




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-15-1-XSLT-returning-only-the-closing-tags-tp5796448.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Is there any way to limit the values for Accept: header for camel-atom and camel-rss?

2017-03-27 Thread Tomohisa Igarashi

Hi,

It seems to be right, both of camel-rss and camel-atom doesn't allow to 
configure request headers other than basic auth. You may want to file a JIRA 
for it.

Or I haven't tried yet though, it seems possible to use camel-http4 as a 
polling consumer which accepts custom HttpClientConfigurer. The default accept 
header could be set on HttpClientBuilder with it.

Thanks,
Tomo

On 03/28/2017 04:23 AM, jspyeatt wrote:

I'm trying to tap into an atom feed that is requiring the Accept request
header to either be application/xml or application/atom+xml.

Is there a way to limit the atom feed definition in the uri to specify only
those two values? Currently the default for the atom feed appears to be

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Which is way to loose for my requests.

Looking at the code for AtomUtils it doesn't appear that parseDocument()
allows that.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Is-there-any-way-to-limit-the-values-for-Accept-header-for-camel-atom-and-camel-rss-tp5796439.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel instanciated as null

2017-03-27 Thread mtod09
I cleaned this up a bit it loads without any errors but does not run anyone
have any ideas why this would fail?

 
http://www.osgi.org/xmlns/blueprint/v1.0.0;
   xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0;
  
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0;>
   




















 
 


http://camel.apache.org/schema/blueprint;>   





/km:FMIMessage/km:Header/km:Route/text()


Route1



org.apache.camel.ValidationException


${exception.message}













--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-instanciated-as-null-tp5796043p5796465.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel 2.15.1 XSLT returning only the closing tags

2017-03-27 Thread Boba
I am trying to do a really simple xml to xml transformation using the xslt
uri, I have dumbed it down so the input and transformed messages are
basically the same to try and work this out...
I used stylus studio to create the xml to xml mapping (I'm not knowledgeable
in xslt) 

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








Request
End


















It works well running camel standalone on my windows vm but when I deploy to
Tomcat7 on oracle java 8 (now and 7 previously) on ubuntu 14.04 32bit VM
server, the bulk of the response is just close tags i.e.



 
 End
 
 


I use the Camel spring XML DSL and am referencing the xsl files from the
local 



There are a few posts that suggest a number of options including using the
xalan transformer factory

 

or saxon
 

I added the relevant dependencies in my POM

   org.apache.camel
   camel-saxon
   ${camel-version}
 

 
   xalan
   xalan
   2.7.1
 

I have also tried, as suggested by one post, converting the body to
java.io.InputStream just before the XSLT


So I have been at this solidly over the week-end and today... I can't see
what is wrong

Any help ...please




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-15-1-XSLT-returning-only-the-closing-tags-tp5796448.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to Catch an Exception in Netty

2017-03-27 Thread hammod
doTry didn't help either, as the error "Could not create JMS transaction" I
think is happening before starting the route, so it is not being caught in
doCatch or ErrorHandlers



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796447.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to Catch an Exception in Netty

2017-03-27 Thread hammod
I found this thread also, so maybe it is a bug in Camel.
http://camel.465427.n5.nabble.com/exception-handling-of-transacted-servlet-route-td5779274.html



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796446.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to Catch an Exception in Netty

2017-03-27 Thread hammod
doTry didn't help either, as the error "Could not create JMS transaction" I
think is happening before starting the route, so it is not being caught in
doCatch or ErrorHandlers 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796445.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to Catch an Exception in Netty

2017-03-27 Thread souciance
What happens if you add a doTry() and doCatch(Exception.class) around the
part which throws the exception? Does this catch the exception?

On Mon, Mar 27, 2017 at 9:38 PM, hammod [via Camel] <
ml-node+s465427n5796442...@n5.nabble.com> wrote:

> I found this thread, it is the same problem I think, also the OP in that
> thread said he is getting exception handling working when he is removing
> transaction notation
> http://camel.465427.n5.nabble.com/Problem-with-exception-
> handler-onException-on-Camel-2-12-X-routes-td5742605.html
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-
> tp5796040p5796442.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428...@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796443.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

2017-03-27 Thread hammod
I found this thread, it is the same problem I think, also the OP in that
thread said he is getting exception handling working when he is removing
transaction notation 
http://camel.465427.n5.nabble.com/Problem-with-exception-handler-onException-on-Camel-2-12-X-routes-td5742605.html



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796442.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to Catch an Exception in Netty

2017-03-27 Thread hammod

java.lang.Exception

true







--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796441.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to Catch an Exception in Netty

2017-03-27 Thread souciance
Can you share your OnException code as well`?

On Mon, Mar 27, 2017 at 9:16 PM, hammod [via Camel] <
ml-node+s465427n5796438...@n5.nabble.com> wrote:

> I just found that the OnExcpetion is working when I remove the
>  part form the routes, unfortunately I need this route to be
> transacted
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-
> tp5796040p5796438.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428...@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796440.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Is there any way to limit the values for Accept: header for camel-atom and camel-rss?

2017-03-27 Thread jspyeatt
I'm trying to tap into an atom feed that is requiring the Accept request
header to either be application/xml or application/atom+xml.

Is there a way to limit the atom feed definition in the uri to specify only
those two values? Currently the default for the atom feed appears to be 

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Which is way to loose for my requests.

Looking at the code for AtomUtils it doesn't appear that parseDocument()
allows that.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Is-there-any-way-to-limit-the-values-for-Accept-header-for-camel-atom-and-camel-rss-tp5796439.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to Catch an Exception in Netty

2017-03-27 Thread hammod
I just found that the OnExcpetion is working when I remove the 
part form the routes, unfortunately I need this route to be transacted 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796438.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: RabbitMQ fanout exchange + request-reply + aggergator

2017-03-27 Thread dancsi
Hi Souciance,

I did exactly what you propose in the second part of your reply. I split the
flow into 2 steps:
1) send out the request to multiple consumers via the fanout exchange with
inOnly pattern;
2) aggregate the reply messages in another route, that consumes the replies
from a fixed response queue, and send a response to the original caller.

It works but just as you wrote, it's a bit messy. Besides, this way the
processing of the original request/order gets acknowledged at the end of the
first step/route (even with autoAck=false) and not at the end of the real
processing, which would be the end of the second step/route.

Otherwise, you're right. I haven't seen such a request-(multi-)reply pattern
in RabbitMQ, though I think that as far as RabbitMQ is concerned, it could
work. It doesn't require anything from RabbitMQ that it cannot do/provide.
As I wrote, I almost made it in a single route with inOut pattern and Camel
RabbitMQ's temporary reply manager. The "only" missing piece is to "combine"
the aggregator to the reply manager so that it doesn't stop listening on the
first reply but waits for further replies as configured for the aggregator
(completionCount, completionTimeout, etc.).
Anyone who have done anything like this before? Or at least who could give
some hints how to tailor the reply manager for this purpose?

Cheers
Andras



--
View this message in context: 
http://camel.465427.n5.nabble.com/RabbitMQ-fanout-exchange-request-reply-aggergator-tp5796289p5796437.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to Catch an Exception in Netty

2017-03-27 Thread hammod
Any help ?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796302.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Activemq property JMSDestination value different between 5.12.1 and 5.13.0

2017-03-27 Thread chiippy
Hi Claus

thanks for the reply.

I am posting here as I have run the test case from the master branch which
is using activemq 5.14.4 broker and client. However,  the test case still
returns the correct value :

org.apache.camel.component.jms.activemq.ActiveMQConsumeWildcardQueuesTest
Connected to the target VM, address: '127.0.0.1:50433', transport: 'socket'  
JMSDestination : queue://sport.pl.manu
JMSDestination : queue://sport.pl.chelsea
JMSDestination : queue://sport.pl.arsenal
JMSDestination : queue://sport.1st.leeds
Disconnected from the target VM, address: '127.0.0.1:50433', transport:
'socket'

I am wondering if you guys have a fix to restore the correct value in the
latest version of camel 2.19.0 ?  (I am using 2.18.).

Thanks

Alex



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Activemq-property-JMSDestination-value-different-between-5-12-1-and-5-13-0-tp5796294p5796300.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Activemq property JMSDestination value different between 5.12.1 and 5.13.0

2017-03-27 Thread Claus Ibsen
Hi

You should likely ask on the ActiveMQ user forum as its a change in
ActiveMQ and not Camel.

On Mon, Mar 27, 2017 at 4:51 PM, chiippy  wrote:
> Hi
>
> my question is about the JSMDestination camel header value changes when
> connect my client to use between activemq 5.12.1 and 5.13.4.
>
> My application was implemented bases on the this existing camel-jms test
> case:  ActiveMQConsumeWildcardQueuesTest.java
> 
>
> From 5.12.1,  JMSDestination gives the value as "sport.pl.chelsea" in the
> choice()  However, for 5.13.4, I am getting "sport.>" and lost all the other
> values.
>
> Any ideas ?
>
> Thanks
>
> Alex
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Activemq-property-JMSDestination-value-different-between-5-12-1-and-5-13-0-tp5796294.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Camel Activemq property JMSDestination value different between 5.12.1 and 5.13.0

2017-03-27 Thread chiippy
Hi

my question is about the JSMDestination camel header value changes when
connect my client to use between activemq 5.12.1 and 5.13.4.  

My application was implemented bases on the this existing camel-jms test
case:  ActiveMQConsumeWildcardQueuesTest.java

  

>From 5.12.1,  JMSDestination gives the value as "sport.pl.chelsea" in the
choice()  However, for 5.13.4, I am getting "sport.>" and lost all the other
values. 

Any ideas ?

Thanks

Alex






--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Activemq-property-JMSDestination-value-different-between-5-12-1-and-5-13-0-tp5796294.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: RabbitMQ fanout exchange + request-reply + aggergator

2017-03-27 Thread souciance
Hello,

Your description points to some hybrid between publish/subscribe i.e. you
want to send to multiple consumers and you want responses from them to
aggregate the messages which is more synchronous. I am not sure this is
easily accomplished in one step as the two patterns don't mix in Rabbit as
far as I know. But perhaps someone with better RabbitMQ knowledge can give
more detailed info here. How will you handle timeouts both for the original
caller waiting for the responses and for the clients who will return the
result?

But I think you would probably have to break this in two steps. One part
would be to publish receive the message from the original caller and
publish to the exchange. The clients would have to reply to another routing
key which directs the responses to some fixed queue. You would have to poll
this queue for some xxx period and fetch the messages and aggregate and
then return the aggregated list to the original caller. It sounds a bit
messy.

Best
Souciance

On Mon, Mar 27, 2017 at 3:53 PM, dancsi [via Camel] <
ml-node+s465427n5796289...@n5.nabble.com> wrote:

> I'd like to implement the request-reply pattern over RabbitMQ the
> following way:
> 1. The request is sent to a RabbitMQ fanout exchange (i.e. it will be
> received by multiple consumers)
> 2. Each consumer prepares and sends its on response (e.g. if they can
> fulfill the given request/order and at what cost)
> 3. The sender route aggregates the responses (e.g. drops responses, where
> the cost is too high and sorts the remaining ones by cost)
> 4. Then return this list to the original caller
>
> If I use inOut to send out the request to the fanout exchange, Camel will
> create a temporary reply queue with a listener and as soon as the first
> response arrives, it stops listening to further ones and "returns", i.e. it
> isn't possible to aggregate the responses.
> How can I combine inOut with aggregator to realize the expected flow?
>
> (The only way, I could make it work so far is to use inOnly and set up
> another route to gather and aggregate the responses. But then I cannot
> acknowledge the messages at the end of the entire processing.)
>
> Cheers
> Andras
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/RabbitMQ-fanout-exchange-
> request-reply-aggergator-tp5796289.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428...@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/RabbitMQ-fanout-exchange-request-reply-aggergator-tp5796289p5796295.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RabbitMQ fanout exchange + request-reply + aggergator

2017-03-27 Thread dancsi
I'd like to implement the request-reply pattern over RabbitMQ the following
way:
1. The request is sent to a RabbitMQ fanout exchange (i.e. it will be
received by multiple consumers)
2. Each consumer prepares and sends its on response (e.g. if they can
fulfill the given request/order and at what cost)
3. The sender route aggregates the responses (e.g. drops responses, where
the cost is too high and sorts the remaining ones by cost)
4. Then return this list to the original caller

If I use inOut to send out the request to the fanout exchange, Camel will
create a temporary reply queue with a listener and as soon as the first
response arrives, it stops listening to further ones and "returns", i.e. it
isn't possible to aggregate the responses.
How can I combine inOut with aggregator to realize the expected flow?

(The only way, I could make it work so far is to use inOnly and set up
another route to gather and aggregate the responses. But then I cannot
acknowledge the messages at the end of the entire processing.)

Cheers
Andras




--
View this message in context: 
http://camel.465427.n5.nabble.com/RabbitMQ-fanout-exchange-request-reply-aggergator-tp5796289.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Best way to poll a database and process in chunks

2017-03-27 Thread Jacobsen, Jasen W.
I didn't see the original message from dvlato.

We are doing pretty much exactly what you describe. We are using
blueprint.xml to describe our routes.

We start with a timer



Then we have some intermediate code using a bean that determines status we
are going to look for - in our case records that have changed since a
certain time.

Then we set "body" to the SQL to be executed and use the JDBC component to
execute the query - this is where things get tricky




  ${body}
  

  true
  


  



We use outputType="StreamList" to keep from getting too many records at
one time. "resetAutoCommit=false" because of performance problems we were
seeing - it was really slow otherwise.
 - processes each record in the
result stream. The ${body} says we want to work with the
record in the JDBC result.


Then we have an aggregator as you mentioned. The aggregator simply adds
the records to an ArrayList - it batches them.

public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
  Object newBody = newExchange.getIn().getBody();
  ArrayList list = null;
  if (oldExchange == null) {
list = new ArrayList();
list.add(newBody);
newExchange.getIn().setBody(list);
return newExchange;
  } else {
list = oldExchange.getIn().getBody(ArrayList.class);
list.add(newBody);
return oldExchange;
  }
}


Finally we call the route that does whatever we want with the batch of
records.


We were doing the "split" without an aggregator, but then every record was
being processed individually and this created a lot of SQL traffic on the
insert side - i.e. It was really slow. Using the aggregator improved
performance tremendously.

I hope this helps.

- Jasen.

On 3/26/17, 3:27 AM, "Claus Ibsen"  wrote:

>Yeah
>
>The other sql components are likely a bit better at this, such as
>mybatis or the sql component. For the latter you can set
>useIterator=false to get the List. And you can set that
>maxMessagesPerPoll to 10 but that is after the poll, so try to set it
>on the jdbc driver, eg on template.maxRows=10 for SQL. MyBatis ought
>to have something as well to configure a max limit to the jdbc driver.
>
>The JPA component was originally not intended for arbitrary SQL and
>thus was a 1:1 jpa entity/table thingy, and it could use a bit of love
>to make the consumer to poll X together. You are welcome to log a JIRA
>
>
>On Fri, Mar 24, 2017 at 1:02 PM, dvlato  wrote:
>> Hello,
>> I have just started working with Camel and I have what I believe is a
>>pretty
>> common requirement:  poll the database to fetch all the records with a
>> certain status, and process them in chunks (let's 10 rows at a time). I
>> though I could leverage the existing components to do this easily but I
>>am
>> not finding the correct way:
>>
>> What I have tried so far is to usa the JPA component (as we already
>>have JPA
>> entities in place) to poll the database and use the @Consumed
>>annotation to
>> change the status of the record (some pointers about how to deal with
>> transactionality are also most welcome).  The problem with this
>>approach is:
>> 1) Here the rows are received one by one, and we can later merge them
>>with
>> an aggregator, which seems suboptimal.
>> 2)  Even if we ignored the performance problem with that approach, I'm
>>not
>> sure of how to configure the aggregator to have fixed size blocks but
>>taking
>> into account the whole size of the batch (I mean, if after chunking we
>>only
>> have 5 rows in a message, just return that instead of waiting for the
>>10th -
>> maybe it works like that by default - I don't really know).
>>
>> I've seen that there is a class called  "JpaPollingConsumer" which
>>returns
>> all the rows instead of one by one, but I don't know if there is anyway
>>to
>> use it with a "from()" clause, it seems that Camel calls
>>"createConsumer"
>> and not "createPollingConsumer", right? Is there a way to use
>> from("jpa://...") and have Camel use the polling consumer?  I have tried
>> using pollEnrich but in that case the @Consumed code is not executed. Is
>> there any other alternative?
>>
>>
>>  I apologise for such basic questions, I am sure I could probably
>>figure out
>> a "good enough" approach using my inexistent knowledge of Camel (we have
>> Camel in Action which has been great so far, but I don't see anything in
>> Chapter 6 regarding database polling) but, on the other hand, it's such
>>a
>> common task that someone might have best practices  already available.
>>I
>> have browsed the myBatis and SQL docs and I think that they might be
>>better
>> suited (if I am not using JPA incorrectly, which is quite likely the
>>case),
>> but I will have the same problem of not knowing if I am using Camel
>> correctly.



Re: Unable to send response to webservice

2017-03-27 Thread Claus Ibsen
What you use as response must fit what the SOAP webservice is defined
to use as response, eg in all that WSDL / SOAP spec stuff.

In your use case you use a bean as the endpoint so must match that
bean endpoint as well.

And study some of the CXF examples from Camel, or from 3rd party
blogs, or in some of the Camel books

On Mon, Mar 27, 2017 at 1:01 PM, anirban.gupta4
 wrote:
> Hi,
>
> My scenario is like:
>
> 1. Expose a CXF endpoint and accept the request message
> 2. Transform the request message
> 3. Put the message in a JMS queue
> 4. Send a response to the caller that the message is successfully posted in
> the queue
>
> My route is as follows
>
> from("cxf:bean:someEndpoint")
> .streamCaching()
> .process(new MappingProcessor())
> .log("Reached1")
> .setHeader("INTERFACE_NAME", constant("some-interface"))
> .to("jms:queue:queueName")
> .setBody(constant("Item has been inserted to Queue 
> Successfully"))
> .end();
>
> In the above route, the message is getting inserted into the queue
> successfully but the response "Item has been inserted to Queue Successfully"
> is not sent to the calling app, Please help.
>
> Regards,
> Anirban.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Unable-to-send-response-to-webservice-tp5796276.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Old Exchange always returns null

2017-03-27 Thread Claus Ibsen
If you want all files to be aggregated together then use a constant expression.

Read more about the eip pattern and how it works
http://camel.apache.org/aggregator2.html

Its concept is also detailed in the EIP book. And other books like
Camel in Action and Camel Cookbook have much more details as well.

On Mon, Mar 27, 2017 at 11:49 AM, Ambika Das
 wrote:
> If I use the following
>
> from("direct:items")
> .aggregate(header(*"id"*), myAggregationStrategy)
> .completionTimeout(500)
> .to("direct:send-to-A");
>
>
> I am getting invalid correlation id error.
>
>
> Regards,
>
> Prasad
>
>
> On Mon, Mar 27, 2017 at 2:42 PM, Claus Ibsen  wrote:
>
>> Your use the file name as aggregrate expression and therefore its
>> grouping per file name and so file a.txt and b.txt do not group
>> together.
>>
>> And you get aggregate with old exchange as null when a new group is started
>>
>> On Mon, Mar 27, 2017 at 10:49 AM, Ambika Das
>>  wrote:
>> > Hi,
>> >
>> > I am aggregating contents of a csv file. the csv file can contain rows
>> with
>> > same e mail id. For those lines I need to generate a combined JSON with
>> > contents aggregated.
>> >
>> > I am using PreCompletionAwareAggregationStrategy and my aggregate method
>> > looks like this.
>> >
>> > if (oldExchange == null) {
>> > return false;
>> > }
>> >
>> > // Code for matching e mail id goes here
>> >
>> > //merges application data with old exchange
>> >
>> > return oldExchange;
>> >
>> > My route builder looks like this
>> >
>> > from("direct:items")
>> > .aggregate(header(FILE_NAME_ONLY), myAggregationStrategy)
>> > .completionTimeout(500)
>> > .to("direct:send-to-A");
>> >
>> >
>> > From the posts I came to know that we need to set an index to the
>> > header, but not sure how it
>> >
>> > works.
>> >
>> >
>> > Every time my old exchange comes null so code after old exchange block
>> > never gets executed.
>> >
>> > Thanks,
>> >
>> > Prasad
>> >
>> > --
>> >
>> >   Our Legal Fees At Work ---
>> > This communication and its contents are confidential and may contain
>> > protected intellectual property or other information protected from
>> > disclosure. If you are not the intended recipient you may not read, copy,
>> > distribute or use this information. If you have received this
>> > communication or its contents in error, please notify Symphony Talent
>> > immediately by replying to this message and then delete this
>> communication
>> > and its contents from your system.
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
> --
>
>   Our Legal Fees At Work ---
> This communication and its contents are confidential and may contain
> protected intellectual property or other information protected from
> disclosure. If you are not the intended recipient you may not read, copy,
> distribute or use this information. If you have received this
> communication or its contents in error, please notify Symphony Talent
> immediately by replying to this message and then delete this communication
> and its contents from your system.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Unable to send response to webservice

2017-03-27 Thread anirban.gupta4
Hi,

My scenario is like:

1. Expose a CXF endpoint and accept the request message
2. Transform the request message
3. Put the message in a JMS queue
4. Send a response to the caller that the message is successfully posted in
the queue

My route is as follows

from("cxf:bean:someEndpoint")
.streamCaching()
.process(new MappingProcessor())
.log("Reached1") 
.setHeader("INTERFACE_NAME", constant("some-interface"))
.to("jms:queue:queueName")
.setBody(constant("Item has been inserted to Queue 
Successfully"))
.end();

In the above route, the message is getting inserted into the queue
successfully but the response "Item has been inserted to Queue Successfully"
is not sent to the calling app, Please help.

Regards,
Anirban.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-send-response-to-webservice-tp5796276.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Old Exchange always returns null

2017-03-27 Thread Ambika Das
If I use the following

from("direct:items")
.aggregate(header(*"id"*), myAggregationStrategy)
.completionTimeout(500)
.to("direct:send-to-A");


I am getting invalid correlation id error.


Regards,

Prasad


On Mon, Mar 27, 2017 at 2:42 PM, Claus Ibsen  wrote:

> Your use the file name as aggregrate expression and therefore its
> grouping per file name and so file a.txt and b.txt do not group
> together.
>
> And you get aggregate with old exchange as null when a new group is started
>
> On Mon, Mar 27, 2017 at 10:49 AM, Ambika Das
>  wrote:
> > Hi,
> >
> > I am aggregating contents of a csv file. the csv file can contain rows
> with
> > same e mail id. For those lines I need to generate a combined JSON with
> > contents aggregated.
> >
> > I am using PreCompletionAwareAggregationStrategy and my aggregate method
> > looks like this.
> >
> > if (oldExchange == null) {
> > return false;
> > }
> >
> > // Code for matching e mail id goes here
> >
> > //merges application data with old exchange
> >
> > return oldExchange;
> >
> > My route builder looks like this
> >
> > from("direct:items")
> > .aggregate(header(FILE_NAME_ONLY), myAggregationStrategy)
> > .completionTimeout(500)
> > .to("direct:send-to-A");
> >
> >
> > From the posts I came to know that we need to set an index to the
> > header, but not sure how it
> >
> > works.
> >
> >
> > Every time my old exchange comes null so code after old exchange block
> > never gets executed.
> >
> > Thanks,
> >
> > Prasad
> >
> > --
> >
> >   Our Legal Fees At Work ---
> > This communication and its contents are confidential and may contain
> > protected intellectual property or other information protected from
> > disclosure. If you are not the intended recipient you may not read, copy,
> > distribute or use this information. If you have received this
> > communication or its contents in error, please notify Symphony Talent
> > immediately by replying to this message and then delete this
> communication
> > and its contents from your system.
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

-- 

  Our Legal Fees At Work ---
This communication and its contents are confidential and may contain 
protected intellectual property or other information protected from 
disclosure. If you are not the intended recipient you may not read, copy, 
distribute or use this information. If you have received this 
communication or its contents in error, please notify Symphony Talent 
immediately by replying to this message and then delete this communication 
and its contents from your system.


Re: Old Exchange always returns null

2017-03-27 Thread Claus Ibsen
Your use the file name as aggregrate expression and therefore its
grouping per file name and so file a.txt and b.txt do not group
together.

And you get aggregate with old exchange as null when a new group is started

On Mon, Mar 27, 2017 at 10:49 AM, Ambika Das
 wrote:
> Hi,
>
> I am aggregating contents of a csv file. the csv file can contain rows with
> same e mail id. For those lines I need to generate a combined JSON with
> contents aggregated.
>
> I am using PreCompletionAwareAggregationStrategy and my aggregate method
> looks like this.
>
> if (oldExchange == null) {
> return false;
> }
>
> // Code for matching e mail id goes here
>
> //merges application data with old exchange
>
> return oldExchange;
>
> My route builder looks like this
>
> from("direct:items")
> .aggregate(header(FILE_NAME_ONLY), myAggregationStrategy)
> .completionTimeout(500)
> .to("direct:send-to-A");
>
>
> From the posts I came to know that we need to set an index to the
> header, but not sure how it
>
> works.
>
>
> Every time my old exchange comes null so code after old exchange block
> never gets executed.
>
> Thanks,
>
> Prasad
>
> --
>
>   Our Legal Fees At Work ---
> This communication and its contents are confidential and may contain
> protected intellectual property or other information protected from
> disclosure. If you are not the intended recipient you may not read, copy,
> distribute or use this information. If you have received this
> communication or its contents in error, please notify Symphony Talent
> immediately by replying to this message and then delete this communication
> and its contents from your system.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


RE: Exception not thrown on connect failed in Dynamic Routes

2017-03-27 Thread Shivu195
Hi upgrading is not an option right now as a bunch of routes depend on this. 
Please suggest an alternative

From: Andrea Cosentino-2 [via Camel] 
[mailto:ml-node+s465427n579627...@n5.nabble.com]
Sent: Monday, March 27, 2017 2:49 PM
To: Shankar, Shivaranjini 
Subject: Re: Exception not thrown on connect failed in Dynamic Routes

Camel 2.10.1 is too old. Try with a new release.

--
Andrea Cosentino
--
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd


On Monday, March 27, 2017 11:16 AM, Shivu195 <[hidden 
email]> wrote:



We are facing the following issue. Whenever the camel route is unable to

connect to an endpoint(from a list of endpoints dynamically generated using

"@DynamicRouter"), it stops sftp-ing the files to all endpoints after the

failed endpoint and also it does not throw an error when the said endpoint

fails.


Is there a way to resolve this issue in this version itself, because an

exception doesn't seem to be thrown. (I have added the onException clause to

the camel route to handle any exception thrown)

*

Camel Version used: 2.10.1

JDK: 6*


This was a similar question raised on stack overflow.

http://stackoverflow.com/questions/40966290/apache-camel-dynamic-route-continue-when-exception-occurs





--

View this message in context: 
http://camel.465427.n5.nabble.com/Exception-not-thrown-on-connect-failed-in-Dynamic-Routes-tp5796268.html

Sent from the Camel - Users mailing list archive at 
Nabble.com.


If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Exception-not-thrown-on-connect-failed-in-Dynamic-Routes-tp5796268p5796270.html
To unsubscribe from Exception not thrown on connect failed in Dynamic Routes, 
click 
here.
NAML

This message may contain information that is confidential or privileged. If you 
are not the intended recipient, please advise the sender immediately and delete 
this message. See 
http://www.blackrock.com/corporate/en-us/compliance/email-disclaimers for 
further information.  Please refer to 
http://www.blackrock.com/corporate/en-us/compliance/privacy-policy for more 
information about BlackRock’s Privacy Policy.
For a list of BlackRock's office addresses worldwide, see 
http://www.blackrock.com/corporate/en-us/about-us/contacts-locations.

© 2017 BlackRock, Inc. All rights reserved.




--
View this message in context: 

Re: camel-spring-boot + @UseAdviceWith

2017-03-27 Thread kim
Hi,

I am having similar issues as per
https://issues.apache.org/jira/browse/CAMEL-9332

I noticed the solution
(https://github.com/apache/camel/tree/master/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints
) and downloaded it.  The example worked fine until I replaced the seda 
endpoint with direct,  thus making it similar to the original problem
CAMEL-9332, then I get an error, no direct consumers.  

How would you mock direct endpoints? I am using boot 1.4 and spring 4.3.

thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-spring-boot-UseAdviceWith-tp5780949p5796273.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Exception not thrown on connect failed in Dynamic Routes

2017-03-27 Thread Tadayoshi Sato
Hi,

> Camel Version used: 2.10.1
> JDK: 6

It's actually quite old. Try the latest Camel 2.18.3 and JDK 8 and see the
issue is still persistent. Many bugs have been fixed since 2.10.1.

On Mon, Mar 27, 2017 at 6:01 PM, Shankar, Shivaranjini <
shivaranjini.shan...@blackrock.com> wrote:

> Hi team
>
> We are facing the following issue. Whenever the camel route is unable to
> connect to an endpoint(from a list of endpoints dynamically generated using
> "@DynamicRouter"), it stops sftp-ing the files to all endpoints after the
> failed endpoint and also it does not throw an error when the said endpoint
> fails.
> Is there a way to resolve this issue, because an exception doesn't seem to
> be thrown. (I have added the onException clause to the camel route to
> handle any exception thrown)
>
> Camel Version used: 2.10.1
>
> JDK: 6
>
>
>
> JiRA raised for this issue: https://issues.apache.org/
> jira/browse/CAMEL-11071
>
> Thiis was a similar question raised on stack overflow.
>
> http://stackoverflow.com/questions/40966290/apache-
> camel-dynamic-route-continue-when-exception-occurs
>
>
> Thanks and Regards
> Shivaranjini Shankar
> Analyst | BlackRock
> Phone: +91-124-678-0805 | Mobile: +91 92-05-184684
>
>
> This message may contain information that is confidential or privileged.
> If you are not the intended recipient, please advise the sender immediately
> and delete this message. See http://www.blackrock.com/
> corporate/en-us/compliance/email-disclaimers for further information.
> Please refer to http://www.blackrock.com/corporate/en-us/compliance/
> privacy-policy for more information about BlackRock’s Privacy Policy.
> For a list of BlackRock's office addresses worldwide, see
> http://www.blackrock.com/corporate/en-us/about-us/contacts-locations.
>
> © 2017 BlackRock, Inc. All rights reserved.
>


Re: Exception not thrown on connect failed in Dynamic Routes

2017-03-27 Thread Andrea Cosentino
Camel 2.10.1 is too old. Try with a new release.
 
--
Andrea Cosentino 
--
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ancosen1...@yahoo.com
Twitter: @oscerd2
Github: oscerd


On Monday, March 27, 2017 11:16 AM, Shivu195 
 wrote:



We are facing the following issue. Whenever the camel route is unable to

connect to an endpoint(from a list of endpoints dynamically generated using

"@DynamicRouter"), it stops sftp-ing the files to all endpoints after the

failed endpoint and also it does not throw an error when the said endpoint

fails.


Is there a way to resolve this issue in this version itself, because an

exception doesn't seem to be thrown. (I have added the onException clause to

the camel route to handle any exception thrown)

*

Camel Version used: 2.10.1

JDK: 6*


This was a similar question raised on stack overflow.

http://stackoverflow.com/questions/40966290/apache-camel-dynamic-route-continue-when-exception-occurs





--

View this message in context: 
http://camel.465427.n5.nabble.com/Exception-not-thrown-on-connect-failed-in-Dynamic-Routes-tp5796268.html

Sent from the Camel - Users mailing list archive at Nabble.com.


Exception not thrown on connect failed in Dynamic Routes

2017-03-27 Thread Shivu195
We are facing the following issue. Whenever the camel route is unable to
connect to an endpoint(from a list of endpoints dynamically generated using
"@DynamicRouter"), it stops sftp-ing the files to all endpoints after the
failed endpoint and also it does not throw an error when the said endpoint
fails.

Is there a way to resolve this issue in this version itself, because an
exception doesn't seem to be thrown. (I have added the onException clause to
the camel route to handle any exception thrown)
*
Camel Version used: 2.10.1
JDK: 6*

This was a similar question raised on stack overflow.
http://stackoverflow.com/questions/40966290/apache-camel-dynamic-route-continue-when-exception-occurs




--
View this message in context: 
http://camel.465427.n5.nabble.com/Exception-not-thrown-on-connect-failed-in-Dynamic-Routes-tp5796268.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: file input with tail -f behaviour

2017-03-27 Thread Claus Ibsen
What do you mean by start from beginning?

It ought to read line by line when the file is appended. And if a new
file is created it starts from top again.
If you shutdown Camel, it does not remember where it was last time,
and start all over again

On Fri, Mar 24, 2017 at 11:28 AM, Oliver Wulff  wrote:
> Hi there
>
>
> I've tried to use the stream input component to listen on changes within a 
> file to process the lines one by one.
>
>
>  uri="stream:file?fileName=sample.csvscanStream=truescanStreamDelay=1000retry=true"
>  />
>
>
> But I noticed it always starts from the beginning. Is there an option in 
> Camel to have "tail -f" behaviour to trigger my route?
>
>
> Thanks
>
> Oli
>



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


RE: Exception not thrown on connect failed in Dynamic Routes

2017-03-27 Thread Shankar, Shivaranjini
Hi team

We are facing the following issue. Whenever the camel route is unable to 
connect to an endpoint(from a list of endpoints dynamically generated using 
"@DynamicRouter"), it stops sftp-ing the files to all endpoints after the 
failed endpoint and also it does not throw an error when the said endpoint 
fails.
Is there a way to resolve this issue, because an exception doesn't seem to be 
thrown. (I have added the onException clause to the camel route to handle any 
exception thrown)

Camel Version used: 2.10.1

JDK: 6



JiRA raised for this issue: https://issues.apache.org/jira/browse/CAMEL-11071

Thiis was a similar question raised on stack overflow.

http://stackoverflow.com/questions/40966290/apache-camel-dynamic-route-continue-when-exception-occurs


Thanks and Regards
Shivaranjini Shankar
Analyst | BlackRock
Phone: +91-124-678-0805 | Mobile: +91 92-05-184684


This message may contain information that is confidential or privileged. If you 
are not the intended recipient, please advise the sender immediately and delete 
this message. See 
http://www.blackrock.com/corporate/en-us/compliance/email-disclaimers for 
further information.  Please refer to 
http://www.blackrock.com/corporate/en-us/compliance/privacy-policy for more 
information about BlackRock’s Privacy Policy.
For a list of BlackRock's office addresses worldwide, see 
http://www.blackrock.com/corporate/en-us/about-us/contacts-locations.

© 2017 BlackRock, Inc. All rights reserved.


Re: Process several messages from several JMSEndpoints with single ThreadPool

2017-03-27 Thread makkenza
Yes.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796265.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Old Exchange always returns null

2017-03-27 Thread Ambika Das
Hi,

I am aggregating contents of a csv file. the csv file can contain rows with
same e mail id. For those lines I need to generate a combined JSON with
contents aggregated.

I am using PreCompletionAwareAggregationStrategy and my aggregate method
looks like this.

if (oldExchange == null) {
return false;
}

// Code for matching e mail id goes here

//merges application data with old exchange

return oldExchange;

My route builder looks like this

from("direct:items")
.aggregate(header(FILE_NAME_ONLY), myAggregationStrategy)
.completionTimeout(500)
.to("direct:send-to-A");


>From the posts I came to know that we need to set an index to the
header, but not sure how it

works.


Every time my old exchange comes null so code after old exchange block
never gets executed.

Thanks,

Prasad

-- 

  Our Legal Fees At Work ---
This communication and its contents are confidential and may contain 
protected intellectual property or other information protected from 
disclosure. If you are not the intended recipient you may not read, copy, 
distribute or use this information. If you have received this 
communication or its contents in error, please notify Symphony Talent 
immediately by replying to this message and then delete this communication 
and its contents from your system.


Re: Process several messages from several JMSEndpoints with single ThreadPool

2017-03-27 Thread souciance
Are you using ActiveMQ as your provider?

On Mon, Mar 27, 2017 at 9:57 AM, makkenza [via Camel] <
ml-node+s465427n5796247...@n5.nabble.com> wrote:

> The GUI might get updates to the product from the customers, therefore, we
> want to keep the queues as long as the GUI is running. Users have Alerts
> setup on their GUI, so when customers send updates, those Alerts might
> trigger...
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Process-several-messages-
> from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796247.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429...@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796248.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process several messages from several JMSEndpoints with single ThreadPool

2017-03-27 Thread makkenza
The GUI might get updates to the product from the customers, therefore, we
want to keep the queues as long as the GUI is running. Users have Alerts
setup on their GUI, so when customers send updates, those Alerts might
trigger...



--
View this message in context: 
http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796247.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Process several messages from several JMSEndpoints with single ThreadPool

2017-03-27 Thread souciance
The reason I ask is that, shouldn't the queues be temporarily created and
once the processing is over, they are then destroyed?

On Mon, Mar 27, 2017 at 9:16 AM, makkenza [via Camel] <
ml-node+s465427n5796223...@n5.nabble.com> wrote:

> They usually start with 50 then during the day, as users need to work on
> more products, they add more. Mid-day they end up with OOM error when they
> hit 180 - 200 products.
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Process-several-messages-
> from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796223.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429...@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796224.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process several messages from several JMSEndpoints with single ThreadPool

2017-03-27 Thread makkenza
They usually start with 50 then during the day, as users need to work on more
products, they add more. Mid-day they end up with OOM error when they hit
180 - 200 products.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796223.html
Sent from the Camel - Users mailing list archive at Nabble.com.