Re: Strange side effects when testing with expectedHeaderValuesReceivedInAnyOrder

2015-04-23 Thread Claus Ibsen
Hi

I have updated the javadoc of the mock endpoint to better explain this.

On Thu, Apr 23, 2015 at 1:59 PM, Preben.Asmussen p...@dr.dk wrote:
 ahh - so  expectedMessageCount and expectedHeaderValuesReceivedInAnyOrder
 exclude each other. Thats a bit unexpected. I would have guessed that all
 expectations set up in a test would have been evaluated.

 Best,
 Preben



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Strange-side-effects-when-testing-with-expectedHeaderValuesReceivedInAnyOrder-tp5766203p5766211.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: camel jdbc component detect end of streamlist

2015-04-23 Thread dermoritz
Thanks for fast reply Claus,

no no parallel processing is enabled. the complete route is this:

from(cronTriggerEndpoint)
.setBody(simple(selectQuery(tableName)))
   
.to(dataBase).id(dbEndpoint+isOnceAtStart).split().body()
.streaming()
.aggregate(constant(true),
rowAggregator).completionSize(CHUNK_SIZE)
.completionInterval(COMPLETION_TIMEOUT)
.process(lookUpDataProcessor)
.to(cepLookupTargetEndpoint)

On this route i attached a route policy that checks on every
onExchangeDone if NOT exchange.getIn().getBody(Iterator.class).hasNext().
The problem is that this is triggered 2 times for one data base query and
the thread view in eclipse' debugger indicates 2 different iterators.
My first solution was to react on the first !hasNext but now i know there
could be a bigger difference in time between the 2 !hasNext - so in need the
last one.

If u are sure that there should be only one iterator i will double check my
tests and setup, but if you have other ideas (for handling the multithreaded
stream) i would be glad to hear them.



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-jdbc-component-detect-end-of-streamlist-tp5766218p5766227.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to track file modifications

2015-04-23 Thread Akram
I needed to track the changes to a file. I thought it would be look like
this: 

from(file://mydirectory?noop=truefileName=myfile.jsonidempotentKey={file:modified}-{file:size})

If the file(myfile.json) changes then I should get an Exchange. But this is
not working. It is treating the file as new and starts reading it from
beginning. Is there any way to achieve this.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-track-file-modifications-tp5766237.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Strange side effects when testing with expectedHeaderValuesReceivedInAnyOrder

2015-04-23 Thread Preben.Asmussen
Thanks Claus

Makes much more sense now, when you know the overrides.

For completeness sake I just move the header test like -

public void testSomething() throws Exception {
String xmlFile = FileUtils.readFileToString(new
File(src/test/data/good.xml));
MockEndpoint mockBar = getMockEndpoint(mock:bar);
mockBar.expectedMessageCount(2);

template.sendBodyAndHeader(file:target/input, xmlFile,
Exchange.FILE_NAME, test_name_header.xml);

assertMockEndpointsSatisfied();
ListExchange receivedExchanges = 
mockBar.getReceivedExchanges();
assertEquals(2, receivedExchanges.size());
Message message1 = receivedExchanges.get(0).getIn();

assertTrue(message1.getBody(String.class).contains(id563516592469/id));
assertEquals(563516592469, message1.getHeader(MessageID));

Message message2 = receivedExchanges.get(1).getIn();

assertTrue(message2.getBody(String.class).contains(id563516592470/id));
assertEquals(563516592470, message2.getHeader(MessageID));
}

or the other way around




--
View this message in context: 
http://camel.465427.n5.nabble.com/Strange-side-effects-when-testing-with-expectedHeaderValuesReceivedInAnyOrder-tp5766203p5766234.html
Sent from the Camel - Users mailing list archive at Nabble.com.


JPA Component router with read-only transaction

2015-04-23 Thread Rafael Ponte
Hi guys,

We're using Camel 2.14.0 with Spring 3.2.11 in our project!

Is it possible to use a JPA Component router just to read entities from
database? We don't need to change or delete the entities loaded through the
router, we already have a specific logic responsible to do that inside our
Spring bean.

My problem is when we set *endpoint.setJoinTransaction(false)* the follow
error happens when JpaConsumer tries to flush the entityManager
instance: *javax.persistence.TransactionRequiredException:
no transaction is in progress*

If we are inside a read-only transaction or even without transaction, this
shouldn't be necessary, right?

-- 
Rafael Ponte
TriadWorks | Formação Java
http://cursos.triadworks.com.br


Manipulating JSON from inputStream

2015-04-23 Thread erd
Hello,

I am  building a camel route and I am looking to manipulate an inputStream
formatted as JSON into a different hierarchy. 

The endgame is to turn the service's response

{foo:
 {bar:{type: motor,status:spinning}},
 {baz:{type: calculator,status:crunching}}
}
into a series of JSON strings with name and properties a la:
{foo:
{name:bar, properties:{type: motor,status:spinning}}
{name:baz, properties:{type: calculator,status:crunching}}
}

What's the best way to approach this?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Manipulating-JSON-from-inputStream-tp5766240.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel jdbc component detect end of streamlist

2015-04-23 Thread Claus Ibsen
Hi

Into multiple threads is that because you enabled parallel processing
on the splitter?

By default it ought to be single threaded even in streaming mode.

On Thu, Apr 23, 2015 at 3:43 PM, dermoritz tantea...@hotmail.com wrote:
 I am using camels jdbc component to load big tables into another system.
 Because i need to start other routes after loading table is finished i need
 to detect when all table entries are passed.

 Because the size of the table i am using this setup ()

 .to(jdbc:testdb?outputType=StreamList)
   .split.body().streaming()
   ...

 The output of streaming() is an iterator and i tried hasNext() on it. The
 problem with this approach is that the data is split into multiple threads.
 in my tests there are running 2 threads and therefor there are 2 iterators.
 So i need to detect when hasNext for the last thread/iterator is false.

 Is there a secure way to determine the number of thread/iterators? Is this
 always 2?





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/camel-jdbc-component-detect-end-of-streamlist-tp5766218.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


cxfrs proxy-base rsClient with multiple resource interfaces

2015-04-23 Thread njames
Hi,
I hope that I have done sufficient googling for this not to be an FAQ, but I
have a question about configuring a cxf:rsClient with a list of
serviceClasses. We tend to have a number of related REST resource
interfaces implemented within a single service (aka Tomcat servlet context).
I have had some success configuring and using a cxf:rsClient to access my
service using a proxy of the first REST resource interface. For example:

cxf:rsClient id=myRestService
address=${myServerHost}/resource
username=${authUsername} password=${authPassword}
loggingFeatureEnabled=true inheritHeaders=true
serviceClass=com.me.FirstResource
cxf:providers
ref bean=jaxbAccountProvider/
/cxf:providers
/cxf:rsClient

I want to extend this configuration to have multiple resource interfaces,
but the intuitive approach of listing them in the serviceClass attribute
doesn't work.
I get the impression from the Camel component page for cxfrs (although I
haven't validated it) that you can configure an rsServer using a
resourceClasses url query parameter, but that doesn't work for an rsClient
(producer vs consumer, yadda, yadda, yadda)
I don't want to have to repeat myself by defining 3 rsClients with each of
the resource interfaces and re-specify the address and credentials. I want
to be as DRY as possible. Also it means that the routes that use the same
service have to know which rsClient bean to use to get the desired
interface.
My latest attempt is using the modelBeans element in a single rsClient to
configure the interfaces for the service, but I think it's intended for
interfaces that do not have the JAX-RS annotations and so I would be
repeating the operations and parameters and everything in the XML
configuration. Does anyone know how to do something like:

cxf:rsClient id=myRestService
address=${myServerHost}/resource
username=${authUsername} password=${authPassword}
loggingFeatureEnabled=true inheritHeaders=true 
cxf:providers
ref bean=jaxbAccountProvider/
/cxf:providers
cxf:modelBeans
util:list
bean class=com.me.FirstResource/
bean class=com.me.SecondResource/
bean class=com.me.ThirdResource/
/util:list
/cxf:modelBeans
/cxf:rsClient

Currently Spring complains about using the class attribute for the
FirstResource, etc, but they are interfaces. (Please don't push me down the
Spring AOP route.)
Am I being unreasonable?

Thanks for any help,

Nick.




--
View this message in context: 
http://camel.465427.n5.nabble.com/cxfrs-proxy-base-rsClient-with-multiple-resource-interfaces-tp5766253.html
Sent from the Camel - Users mailing list archive at Nabble.com.


streaming big xml file witht tokenizer

2015-04-23 Thread majid
Hi all,

I need to parse and handle records of a big XML file, this file need to be
downloaded from some location which may take up to 10 min, so I am wondering
if I can start streaming and get my records as I am downloading the file to
optimise the overall processing time ?

For example, start the download and immediately after that I start my parser
route to get the records ?

Cheers
Majid



--
View this message in context: 
http://camel.465427.n5.nabble.com/streaming-big-xml-file-witht-tokenizer-tp5766254.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to convert flat file to xml using camel ?

2015-04-23 Thread nehachauhan1029
i have a requirement in my project to convert flat file to xml . How can i
achieve this using camel ?



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-convert-flat-file-to-xml-using-camel-tp5766241.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Manipulating JSON from inputStream

2015-04-23 Thread Mark Frazier
Use the Message Translator EIP

http://camel.apache.org/message-translator.html 
http://camel.apache.org/message-translator.html


Inside that,you can use GSON and do one of two:

1) use the GSON api to directly manipulate JsonObject instances after you 
unmarshall

2) unmarshall into an object model that you define, translate from one object 
model to another in java, then
marshal back into JSON


 On Apr 23, 2015, at 10:23 AM, erd evanday...@gmail.com wrote:
 
 Hello,
 
 I am  building a camel route and I am looking to manipulate an inputStream
 formatted as JSON into a different hierarchy. 
 
 The endgame is to turn the service's response
 
 {foo:
 {bar:{type: motor,status:spinning}},
 {baz:{type: calculator,status:crunching}}
 }
 into a series of JSON strings with name and properties a la:
 {foo:
 {name:bar, properties:{type: motor,status:spinning}}
 {name:baz, properties:{type: calculator,status:crunching}}
 }
 
 What's the best way to approach this?
 
 
 
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Manipulating-JSON-from-inputStream-tp5766240.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



URISyntaxException: Invalid uri syntax: Trailing marker found

2015-04-23 Thread hzariv
I am using camel netty4-http and getting the following exception because the
query string my server is receiving ends with ''. Since I cannot control
the URLs my server receives, I need to get around this issue. As far as I
know most sites simply ignore the trailing  at the end of query string.


23769 [Camel (camel-1) thread #0 - NettyEventExecutorGroup] WARN  - Closing
channel as an exception was thrown from Netty
java.net.URISyntaxException: Invalid uri syntax: Trailing  marker found.
Check the uri and remove the trailing  marker.:
version=765responseencoding=JSONappid=xxxsiteid=0callname=ItemID=131334609454IncludeSelector=Details
at org.apache.camel.util.URISupport.parseQuery(URISupport.java:153)
~[camel-core-2.15.1.jar:2.15.1]
at org.apache.camel.util.URISupport.parseQuery(URISupport.java:133)
~[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.component.netty4.http.DefaultNettyHttpBinding.populateCamelHeaders(DefaultNettyHttpBinding.java:182)
~[camel-netty4-http-2.15.1.jar:2.15.1]
at
org.apache.camel.component.netty4.http.RestNettyHttpBinding.populateCamelHeaders(RestNettyHttpBinding.java:50)
~[camel-netty4-http-2.15.1.jar:2.15.1]
at
org.apache.camel.component.netty4.http.DefaultNettyHttpBinding.toCamelMessage(DefaultNettyHttpBinding.java:89)
~[camel-netty4-http-2.15.1.jar:2.15.1]
at
org.apache.camel.component.netty4.http.NettyHttpEndpoint.createExchange(NettyHttpEndpoint.java:103)
~[camel-netty4-http-2.15.1.jar:2.15.1]
at
org.apache.camel.component.netty4.handlers.ServerChannelHandler.channelRead0(ServerChannelHandler.java:87)
~[camel-netty4-2.15.1.jar:2.15.1]
at
org.apache.camel.component.netty4.http.handlers.HttpServerChannelHandler.channelRead0(HttpServerChannelHandler.java:202)
~[camel-netty4-http-2.15.1.jar:2.15.1]
at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
~[netty-transport-4.0.26.Final.jar:4.0.26.Final]
at
org.apache.camel.component.netty4.http.handlers.HttpServerMultiplexChannelHandler.channelRead0(HttpServerMultiplexChannelHandler.java:119)
~[camel-netty4-http-2.15.1.jar:2.15.1]
at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
~[netty-transport-4.0.26.Final.jar:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
[netty-transport-4.0.26.Final.jar:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)
[netty-transport-4.0.26.Final.jar:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:329)
[netty-transport-4.0.26.Final.jar:4.0.26.Final]
at
io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
[netty-common-4.0.26.Final.jar:4.0.26.Final]
at
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
[netty-common-4.0.26.Final.jar:4.0.26.Final]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0-45]



--
View this message in context: 
http://camel.465427.n5.nabble.com/URISyntaxException-Invalid-uri-syntax-Trailing-marker-found-tp5766256.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: HTTP operation failed invoking statusCode: 500

2015-04-23 Thread ercan.canlier
Actually, i am trying with cxf endpoint but the real backend is not
accessible and got connetion refused exception since it is not accessible
via telnet as well. All the properties are same whereas ports are
different. Is there any special property that i should set? I followed Fuse
documentation as there is a topic proxy by payload but didnt work...

23 Nisan 2015 Perşembe tarihinde, Willem.Jiang [via Camel] 
ml-node+s465427n5766183...@n5.nabble.com yazdı:

 PAYLOAD message body just have the SOAP headers and SOAP body messages.
 If you want to send out the PAYLOAD message to a real web service
 endpoint, you need to use camel cxf endpoint to do it as it will put the
 message body into a soap envelope.

 --
 Willem Jiang

 Red Hat, Inc.
 Web: http://www.redhat.com
 Blog: http://willemjiang.blogspot.com (English)
 http://jnn.iteye.com (Chinese)
 Twitter: willemjiang
 Weibo: 姜宁willem



 On April 21, 2015 at 6:42:06 PM, ercan.canlier ([hidden email]
 http:///user/SendEmail.jtp?type=nodenode=5766183i=0) wrote:

  Hi Jiang,
  First of all, thanks for your interest.
  Could you please give me some hints about it?
  How can i show only soap body also at response?
  Or how should i redirect the request with PAYLOAD mode?
  Thanks.
  Ercan
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/HTTP-operation-failed-invoking-statusCode-500-tp5766085p5766092.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/HTTP-operation-failed-invoking-statusCode-500-tp5766085p5766183.html
  To unsubscribe from HTTP operation failed invoking statusCode: 500, click
 here
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5766085code=ZXJjYW4uY2FubGllckBnbWFpbC5jb218NTc2NjA4NXwxNjM0MzU3MDUy
 .
 NAML
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml



-- 
Ercan CANLIER




--
View this message in context: 
http://camel.465427.n5.nabble.com/HTTP-operation-failed-invoking-statusCode-500-tp5766085p5766184.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Syslog data format incorrect parsing of structured data

2015-04-23 Thread Willem Jiang
I just create a JIRA[1] and the patch is on the way.

[1]https://issues.apache.org/jira/browse/CAMEL-8687

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On April 22, 2015 at 5:57:38 AM, Sameer Babu K K (sameer...@yahoo.com.invalid) 
wrote:
 According to RFC 5424 syslog structured data can be like the below examples:
  
  
 All examples in this section show only the structured data part of
 the message. Examples should be considered to be on one line. They
 are wrapped on multiple lines in this document for readability
 purposes. A description is given after each example.
  
 Example 1 - Valid
  
 [exampleSDID@32473 iut=3 eventSource=Application
 eventID=1011]
  
 This example is a structured data element with a non-IANA controlled
 SD-ID of type exampleSDID@32473, which has three parameters.
  
 Example 2 - Valid
  
 [exampleSDID@32473 iut=3 eventSource=Application
 eventID=1011][examplePriority@32473 class=high]
  
  
  
  
 But the syslog data format 
 (org.apache.camel.component.syslog.SyslogConverter)  
 just considers the value till next space as the structured message.
  
  
 StringBuilder msgId = new StringBuilder();
 while ((charFound = (char) (byteBuffer.get()  0xff)) != ' ') {
 msgId.append(charFound);
 }
 rfc5424SyslogMessage.setMsgId(msgId.toString());
  
 StringBuilder structuredData = new StringBuilder();
 while ((charFound = (char) (byteBuffer.get()  0xff)) != ' ') {
 structuredData.append(charFound);
 }
 rfc5424SyslogMessage.setStructuredData(structuredData.toString());
  
 This seems to be a bug to me. Is there a fix or latest version available for 
 this parsing?  
  
 Best Regards,Sameer
  
  



HTTP OPTIONS

2015-04-23 Thread Ted
Hi,

I have a simple REST DSL route that has both a GET and a PUT for a
particular resource:

rest(/orders)
.get(/{orderId}).outType(Order.class)
.to(direct:getOrder)
.put(/{orderId}).type(Order.class)
.to(direct:updateOrder);


This application is run on a different port to the consuming application so
I have enabled CORS via a servlet filter (I also tried the enable CORS
option on the configuration of REST DSL).  The consuming application is
sending a pre-flight HTTP OPTIONS request.  I can see in the class
ServletRestServletResolveConsumerStrategy that the method
matchRestMethod(method, restrict) has special provision for the OPTIONS
method.  The problem for me seems to be that if the consuming application
sends a method similar to:

/orders/1 OPTIONS 

Then the ServletRestServletResolveConsumerStrategy class is not able to find
a unique match because both the GET and the PUT methods are matched and the
consumer sees a 404.

Is there something I'm missing?

Ted



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


Re: [DISCUSS] Looks like someone feels threatened... (TIBCO vs Open Source ESBs)

2015-04-23 Thread Raul Kripalani
Exactly. And what many fail to see is that closed source is – in many cases
– leveraging OSS under the hood. Sometimes the vendor will be nice and make
it evident (e.g. IBM WebSphere being quite transparent in their docs about
using Apache Aries, they also contribute, etc.).

But in other cases, the end user won't come to know because the licensing
model of the 3rd party libraries is non-viral and doesn't require the
vendor to either keep the original naming, nor acknowledge the usage.

I don't have any numbers to support this, but what I've gathered throughout
many years in the industry is that most proprietary software will be
powered (to varying degrees) by OSS without upfront disclosure. At the end
of the day, as a proprietary vendor, I guess you do need a good reason to
reinvent the wheel, and quite possibly that reason doesn't exist.

In fact, one extreme case that comes to mind was the old BEA WebLogic Event
Server which, if you looked at the lib/ directory of the WAR, just turned
out to be mostly Esper [1] with a fancy GUI and some usability-related
changes. And they sold this for hundreds of thousands of EUR / CPU. (Not
intending to start a flame war nor implying generalisation. Just mentioning
an extreme case I know.)

Actually, you know what? When I get some time I'm going to download TIBCO's
product and inspect their usage of 3rd party libs... From what I remember
back, they did use stuff like Xerces, Xalan, etc. which is pretty
commonplace anyway, but I'd be curious to find out if they use further OSS.

[1] http://www.espertech.com/esper/index.php

Regards,

*Raúl Kripalani*
Apache Camel PMC Member  Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Thu, Apr 23, 2015 at 6:25 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi Raul

 Did you get a chance to continue working on this?

 I think for #3 its due to the openes of the source code that people
 dive in and help fix those vulnerabilities as well. And as you say we
 are very open and they get proper registerede with a CVE and listed in
 the public. And we do put out releases with the fixes fairly soon
 after its fixed.

 And there is not so many after all that is caused by Apache Camel itself.

 Yes if you use CXF, Spring, Jetty etc those libraries may have issues
 as well, but they are also reported in the open and fixed fast. And
 have communities as well, some very big like the spring community.

 And those are found and fixed. For the Open Source ESB you would have
 to take a look at
 - CXF
 - ActiveMQ
 - Spring
 - Jetty
 etc to get the combined picture

 http://cxf.apache.org/security-advisories.html

 You can find the Apache products
 http://www.cvedetails.com/product-list/vendor_id-45/Apache.html

 On Fri, Apr 17, 2015 at 12:13 PM, Raul Kripalani r...@evosent.com wrote:
  Just found this marketing landing page published on social networks. It's
  made by TIBCO and attempts to highlight the downsides of Open Source
 ESBs.
  You don't need to be a rocket scientist to gather what exact ESB they are
  targeting (not us): just look at the images.
 
  http://www.tibco.com/integration/open-source-ESB-alternative
 
  Even though it's a clear exercise of FUD vs. OSS – as it provides no
  quantitive measurements to their claims (whatever happened to the
  scientific method...) – I was planning to write a rebuttal post in my
 blog,
  but I haven't updated it in a long time and it needs a bit of love first.
 
  So I thought I'd just publish my thoughts – as I wanted to get it out
 ASAP
  – and start a qualified discussion here...
 
  In particular I would like to dissect / take down their 4 myths about
 OSS
  ESBs:
 
  * *Myth # 1 - Open Source ESB Software Is Free**
 
  (Their statement: OSS ESBs are not Free.)
 
  Well, no software has zero Total Cost of Ownership. As long as the world
 is
  *not* entirely controlled by androids, you will need humans to operate
 the
  software, including TIBCO's. What we need to look at are the costs of
  hiring those people and their learning curves.
 
  For Camel, any developer with Java, XML and a few other commodity
 skills
  will do. And they can get started in days. Many people in this forum got
  started in hours.
 
  For TIBCO, you need a specialised consultant because their stack is
  proprietary. Or you need to train them, and TIBCO training is not cheap.
 I
  have been a TIBCO consultant and I know this for a fact. Moreover,
  specialised (already trained) TIBCO consultants are not cheap either
 (like
  with most proprietary software – think SAP, Salesforce, etc.).
 
  Furthermore, brand new customers need consultancy to get started – and
 that
  is not cheap either.
 
  * *Myth #2 - Open Source ESB Communities Innovate Faster**
 
  (Their statement: Proprietary ESB vendors innovate faster)
 
  This is plainly wrong. Just take a look at the release notes of TIBCO
 

Re-use from-endpoint and kickoff route in Java dsl

2015-04-23 Thread rwijngaa
Hi,

We have some routes that read from file/ftp endpoints and send to file/ftp
endpoints
(your basic 'filemover'). The endpoints are specified in beans so we can
re-use this
in other routes.

I re-use these from endpoints (but now with a delete=true option
and some sort of FileAge filter) in another route that will cleanup the
.done / archived 
files every xx days.

How do i 'kickoff' / start this cleanup route from the Java dsl (in a
Processor)
Or is there a better way to do this (route policies maybe ?)

Example bean xml


In our dsl (.proc = our processorBean definition)


Thanks in advance
Rino




--
View this message in context: 
http://camel.465427.n5.nabble.com/Re-use-from-endpoint-and-kickoff-route-in-Java-dsl-tp5766193.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: HTTP OPTIONS

2015-04-23 Thread Henryk Konsek
Hi,

I've fixed some OPTIONS/CORS related issues in Netty HTTP component. After
these [1] two [2] changes (scheduled for 2.16 and 2.15.2) you can finally
call Netty HTTP based REST DSL routes from AngularJS without running into
the OPTIONS problems.

If you wait for Camel 2.15.2 and use Netty HTTP as a REST provider, you can
enjoy your favorite JS framework calling your REST API without any issues.

Cheers.

[1] https://issues.apache.org/jira/browse/CAMEL-8685
[2] https://issues.apache.org/jira/browse/CAMEL-8645

czw., 23.04.2015 o 10:57 użytkownik Claus Ibsen claus.ib...@gmail.com
napisał:

 Hi

 What http component do you use? servlet / jetty / or something else?
 And what version of Camel.

 There is a few tickets about rest-dsl and CORS issues still to get
 fixed / improved.

 On Thu, Apr 23, 2015 at 10:18 AM, Ted na...@pritchard.uk.net wrote:
  Hi,
 
  I have a simple REST DSL route that has both a GET and a PUT for a
  particular resource:
 
  rest(/orders)
  .get(/{orderId}).outType(Order.class)
  .to(direct:getOrder)
  .put(/{orderId}).type(Order.class)
  .to(direct:updateOrder);
 
 
  This application is run on a different port to the consuming application
 so
  I have enabled CORS via a servlet filter (I also tried the enable CORS
  option on the configuration of REST DSL).  The consuming application is
  sending a pre-flight HTTP OPTIONS request.  I can see in the class
  ServletRestServletResolveConsumerStrategy that the method
  matchRestMethod(method, restrict) has special provision for the OPTIONS
  method.  The problem for me seems to be that if the consuming application
  sends a method similar to:
 
  /orders/1 OPTIONS
 
  Then the ServletRestServletResolveConsumerStrategy class is not able to
 find
  a unique match because both the GET and the PUT methods are matched and
 the
  consumer sees a 404.
 
  Is there something I'm missing?
 
  Ted
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/HTTP-OPTIONS-tp5766194.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
 hawtio: http://hawt.io/
 fabric8 http://hawt.io/fabric8: http://fabric8.io/



Re: HTTP OPTIONS

2015-04-23 Thread Claus Ibsen
Hi

What http component do you use? servlet / jetty / or something else?
And what version of Camel.

There is a few tickets about rest-dsl and CORS issues still to get
fixed / improved.

On Thu, Apr 23, 2015 at 10:18 AM, Ted na...@pritchard.uk.net wrote:
 Hi,

 I have a simple REST DSL route that has both a GET and a PUT for a
 particular resource:

 rest(/orders)
 .get(/{orderId}).outType(Order.class)
 .to(direct:getOrder)
 .put(/{orderId}).type(Order.class)
 .to(direct:updateOrder);


 This application is run on a different port to the consuming application so
 I have enabled CORS via a servlet filter (I also tried the enable CORS
 option on the configuration of REST DSL).  The consuming application is
 sending a pre-flight HTTP OPTIONS request.  I can see in the class
 ServletRestServletResolveConsumerStrategy that the method
 matchRestMethod(method, restrict) has special provision for the OPTIONS
 method.  The problem for me seems to be that if the consuming application
 sends a method similar to:

 /orders/1 OPTIONS

 Then the ServletRestServletResolveConsumerStrategy class is not able to find
 a unique match because both the GET and the PUT methods are matched and the
 consumer sees a 404.

 Is there something I'm missing?

 Ted



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/HTTP-OPTIONS-tp5766194.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Strange cxf behavior with https

2015-04-23 Thread Bilgin Ibryam
Hi all,

I have a Camel cxf proxy route in the following form that is working fine
with http:

from cxf
transform
to cxf

But when I switch to https (both on the produce and consumer) my route is
not returning the result to the client. I can see in the logs that the
service is working fine, the cxf producer is getting a response,
serializing the result, but it never reaches the client (SOAP UI or the
browser).

To fix that I had to add synchronous=true to the cxf consumer. That fixes
the issues but I cannot explain why I have to do it when I switch from http
to https

What I'm missing?

-- 
Bilgin Ibryam

Red Hat, Inc.
Apache Camel  Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam https://twitter.com/bibryam

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475


Re: HTTP OPTIONS

2015-04-23 Thread Ted
I should have mentioned that I am using the Servlet component and Camel
2.15.1.

As a quick hack I added the following code to the end of the method
ServletRestServletResolveConsumerStrategy.resolve(HttpServletRequest
request, MapString, HttpConsumer consumers) 


if (answer == null  method.equals(OPTIONS)  candidates.size()
 0) {
// If method was OPTIONS then just return first consumer
answer = candidates.get(0);
}

Added just before the final return answer;



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


Re: RecipientList thread pool problem

2015-04-23 Thread Claus Ibsen
Hi

Have you configured netty to use request timeout?
http://camel.apache.org/netty.html

You should favor using that for timeout, and not as much the timeout
on the recipient list. Or make sure those values are so netty timeout
first.



On Mon, Apr 20, 2015 at 3:19 PM, Alexander Ilyin
alexande...@madadsmedia.com wrote:
 Hi,

 I have a problem with RecipientList pattern. I'm using it in a parallel
 processing mode which means it is backed up by a thread pool. The
 configuration is as follows:

 threadPool id=pool threadName=My RecipientList poolSize=10
 maxPoolSize=200 /

 recipientList id=bidderResponseGatherer
 strategyRef=gatherBidderResponses parallelProcessing=true
 stopOnException=false timeout=1000 ignoreInvalidEndpoints=true
 executorServiceRef=pool 
 headerRecipientsList/header
 /recipientList

 The problem is that pool threads aren't released properly sometimes. After
 a few hours following the start of an application I can see using jstack
 tool that some threads are stuck in a WAITING state:

 Camel (mainContext) thread #187456 - NettyOrderedWorker daemon prio=10
 tid=0x7fb14c058000 nid=0x5564 waiting on condition [0x7fb2472d]
java.lang.Thread.State: WAITING (parking)
 at sun.misc.Unsafe.park(Native Method)
 - parking to wait for  0x7fb4dc319940 (a
 java.util.concurrent.CountDownLatch$Sync)
 at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
 at
 java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
 at
 java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
 at
 java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
 at
 java.util.concurrent.CountDownLatch.await(CountDownLatch.java:236)
 at
 org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:327)
 at
 org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:213)
 at
 org.apache.camel.processor.RecipientList.sendToRecipientList(RecipientList.java:153)
 at
 org.apache.camel.processor.RecipientList.process(RecipientList.java:112)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
 at
 org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
 at
 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
 at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
 at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 at
 org.apache.camel.component.netty.handlers.ServerChannelHandler.processAsynchronously(ServerChannelHandler.java:136)
 at
 org.apache.camel.component.netty.handlers.ServerChannelHandler.messageReceived(ServerChannelHandler.java:108)
 at
 org.apache.camel.component.netty.http.handlers.HttpServerChannelHandler.messageReceived(HttpServerChannelHandler.java:199)
 at
 org.apache.camel.component.netty.http.handlers.HttpServerMultiplexChannelHandler.messageReceived(HttpServerMultiplexChannelHandler.java:103)
 at
 org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
 at
 org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
 at
 org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
 at
 org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
 at
 org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
 at
 org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:314)
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)


 Number of such threads grows gradually until the application isn't able to
 respond to the requests. I've found very similar ticket in your Jira (
 https://issues.apache.org/jira/browse/CAMEL-6717) but it is stated there
 that the problem is in the 3rd party library mqtt-client. However, I'm not
 using this library, I'm only using Netty to make http requests but still
 see a very similar behaviour.

 I've updated Apache Camel to the latest version 2.15.1 (from 

Re: Comparison of Apache Camel and IBM Integration Bus v9.0

2015-04-23 Thread jamie3
Sure thing. Once there is enough content we can make arrangements to put it
on the camel site.

It will take a few months of posts. So far I'm up to about 7000+ words. So I
need to spend some time organizing things and figuring out how to make it
readable, and not boring.

I'll be heading to Hursley IBM campus in June so will get a nice deep
discussion with the IBM development team and it will fill a lot of my
questions.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171p5766217.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Strange side effects when testing with expectedHeaderValuesReceivedInAnyOrder

2015-04-23 Thread Claus Ibsen
On Thu, Apr 23, 2015 at 1:24 PM, Preben.Asmussen p...@dr.dk wrote:
 Hi

 I'm experiencing some side effects when using
 expectedHeaderValuesReceivedInAnyOrder in a testcase.

 The following test will result in a ArrayOutOfBoundsException :

 public void testResultingInArrayOutOfBoundsException() throws Exception {
 String xmlFile = FileUtils.readFileToString(new
 File(src/test/data/good.xml));
 MockEndpoint mockBar = getMockEndpoint(mock:bar);
 mockBar.expectedMessageCount(2);
 mockBar.expectedHeaderValuesReceivedInAnyOrder(MessageID,
 563516592469);


On top of my head then these 2 lines may exclude each other. You only
provide 1 header pair, so it may think only 1 message is expected.



 template.sendBodyAndHeader(file:target/input, xmlFile,
 Exchange.FILE_NAME, test_name_header.xml);

 assertMockEndpointsSatisfied();
 ListExchange receivedExchanges = 
 mockBar.getReceivedExchanges();
 String body = 
 receivedExchanges.get(0).getIn().getBody(String.class);
 assertTrue(body.contains(id563516592469/id));
 body = receivedExchanges.get(1).getIn().getBody(String.class);
 assertTrue(body.contains(id563516592470/id));
 }
 I know the expectedHeaderValues method ought to get 1 additional parameter,
 but I would have guessed that if only the one  param is satisfied then the
 test expectation would be satisfied.

 An other test runs green even if it should fail on the expectedMessageCount
 -
 public void testRunningGreenThatShouldFail() throws Exception {
 String xmlFile = FileUtils.readFileToString(new
 File(src/test/data/good.xml));
 MockEndpoint mockBar = getMockEndpoint(mock:bar);
 mockBar.expectedMessageCount(200);
 mockBar.expectedHeaderValuesReceivedInAnyOrder(MessageID,
 563516592469, 563516592470);

 template.sendBodyAndHeader(file:target/input, xmlFile,
 Exchange.FILE_NAME, test_name_header.xml);

 assertMockEndpointsSatisfied();
 }


 Route config -

   protected RouteBuilder createRouteBuilder() throws Exception {
 return new RouteBuilder() {
 public void configure() {
 from(file:target/input).
 
 split().xpath(/odPublicationMessages/odPublicationMessage).
 
 setHeader(MessageID).xpath(/odPublicationMessage/odPublication/id,
 String.class).
 log(${body}).
 to(mock:bar)
 .end();
 }
 };
 }

 The tests is done with Camel v. 2.15.1 and I have attached a small project.

 Best,
 Preben



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Strange-side-effects-when-testing-with-expectedHeaderValuesReceivedInAnyOrder-tp5766203.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Strange side effects when testing with expectedHeaderValuesReceivedInAnyOrder

2015-04-23 Thread Preben.Asmussen
Hi

I'm experiencing some side effects when using
expectedHeaderValuesReceivedInAnyOrder in a testcase.

The following test will result in a ArrayOutOfBoundsException :

public void testResultingInArrayOutOfBoundsException() throws Exception {
String xmlFile = FileUtils.readFileToString(new
File(src/test/data/good.xml));
MockEndpoint mockBar = getMockEndpoint(mock:bar);
mockBar.expectedMessageCount(2);
mockBar.expectedHeaderValuesReceivedInAnyOrder(MessageID,
563516592469);

template.sendBodyAndHeader(file:target/input, xmlFile,
Exchange.FILE_NAME, test_name_header.xml);

assertMockEndpointsSatisfied();
ListExchange receivedExchanges = 
mockBar.getReceivedExchanges();
String body = 
receivedExchanges.get(0).getIn().getBody(String.class);
assertTrue(body.contains(id563516592469/id));
body = receivedExchanges.get(1).getIn().getBody(String.class);
assertTrue(body.contains(id563516592470/id));
}
I know the expectedHeaderValues method ought to get 1 additional parameter,
but I would have guessed that if only the one  param is satisfied then the
test expectation would be satisfied. 

An other test runs green even if it should fail on the expectedMessageCount
-
public void testRunningGreenThatShouldFail() throws Exception {
String xmlFile = FileUtils.readFileToString(new
File(src/test/data/good.xml));
MockEndpoint mockBar = getMockEndpoint(mock:bar);
mockBar.expectedMessageCount(200);
mockBar.expectedHeaderValuesReceivedInAnyOrder(MessageID,
563516592469, 563516592470);

template.sendBodyAndHeader(file:target/input, xmlFile,
Exchange.FILE_NAME, test_name_header.xml);

assertMockEndpointsSatisfied();
}


Route config -
 
  protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
from(file:target/input).

split().xpath(/odPublicationMessages/odPublicationMessage).

setHeader(MessageID).xpath(/odPublicationMessage/odPublication/id,
String.class).
log(${body}).
to(mock:bar)
.end();
}
};
}

The tests is done with Camel v. 2.15.1 and I have attached a small project.

Best,
Preben



--
View this message in context: 
http://camel.465427.n5.nabble.com/Strange-side-effects-when-testing-with-expectedHeaderValuesReceivedInAnyOrder-tp5766203.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-23 Thread Claus Ibsen
On Wed, Apr 22, 2015 at 10:17 AM, Franz Paul Forsthofer
emc2...@googlemail.com wrote:
 Hello Claus and Henryk,

 my original proposal to copy the stream cache file is not the optimal
 solution. A better solution would be to have only one stream cache
 file and to delete this file only when all exchanges which need this
 file are done. This does mean we have to register listeners to the
 event onDone of all UnitOfWorks of the relevant exchanges in the
 stream cache file object and only when all listeners have got the
 onDone event, then the file can be deleted.  However this will require
 quite some changes

 Probably we could also use this solution for the agregator and splitter case..


Yeah though that entails the stream cache needs to keep this state and
be tailored to not only 1 exchange but to potentially N+ exchanges.

But a good idea nevertheless. Especially for big streams.

Logging a JIRA ticket is welcome.




 Regards Franz

 On Wed, Apr 22, 2015 at 9:47 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 Yeah we should likely have a StreamCacheHelper or introduce a
 copy(boolean clone) method that takes a boolean (with a better name)
 that indicate it does a indpendenent copy. Then we can keep the inner
 details how this copy does in those stream cache implementations.

 The wire tap already does a copy of the stream cache today. But it
 likely need that clone copy. We could also make that the default.
 Though I think multicast eip does a copy as well but it may reuse the
 same underlying file, and only delete it when last exchange is done
 and closes it.



 On Wed, Apr 22, 2015 at 8:13 AM, Henryk Konsek hekon...@gmail.com wrote:
 Hi,

 You can also use Wiretap's onPrepareRef option and use custom processor to
 copy the content of the cached body.

 Franz, would you be so kind and create a pull request with your fix?
 Somebody will review it and merge. Thanks in advance!

 Cheers!

 wt., 21.04.2015 o 16:25 użytkownik Franz Paul Forsthofer 
 emc2...@googlemail.com napisał:

 Hi Geert,

 it is a bug. You can try as a workaround to set the threshold
 (streamCachingStrategy.setSpoolThreshold(huge_number);) to a huge
 number; then the body will be kept in memory.

 Alternatively, you can modify the code of the Camel class
 org.apache.camel.processor.WireTapProcessor. You have to modifiy the
 method configureCopyExchange in the following way:


private Exchange configureCopyExchange(Exchange exchange) throws
 IOException {


 // must use a copy as we dont want it to cause side effects of
 the original exchange
 Exchange copy = ExchangeHelper.createCorrelatedCopy(exchange,
 false);

 if (copy.getIn().getBody() instanceof FileInputStreamCache) {
 //the file stream must be copied, otherwise you get errors
 because the stream file is removed when the parent route is finished
 FileInputStreamCache streamCache = (FileInputStreamCache)
 exchange.getIn().getBody();
 CachedOutputStream cos = new CachedOutputStream(copy);
 try {
   IOHelper.copy(streamCache, cos);
 } finally {
   IOHelper.close(streamCache, cos);
   streamCache.reset();
 }
 copy.getIn().setBody(cos.newStreamCache());
 }
 // set MEP to InOnly as this wire tap is a fire and forget
 copy.setPattern(ExchangePattern.InOnly);
 return copy;
 }

 The idea behind this is to make a copy of the stream cache file, so
 that you get an additional stream cache file for the second route (in
 your case for the route direct:x). This second stream cache file
 will be deleted when the second route is finished.

 I also hope that this issue will be fixed. I am no committer so I
 cannot say when this issue will be solved; I have made contributions
 which solved a similar problem in the aggregator and splitter.

 I think you can open a Jira ticket with the above solution suggestion.

 Regards Franz

 On Tue, Apr 21, 2015 at 11:13 AM, Geert Vanheusden
 geer...@aviovision.com wrote:
  Hi Franz,
 
  is this something that will be fixed in an upcoming release? Is it a bug
 or
  does it work as designed?
  Can we use a workaround to avoid this behaviour, for example by not
  deleting the temp files?
 
 
  Kind regards,
 
  Geert
 
  On Tue, Apr 21, 2015 at 10:37 AM, Franz Paul Forsthofer 
  emc2...@googlemail.com wrote:
 
  Hello Geert,
 
  there is no solution yet for your problem. Currently the stream cache
  file is removed at the end of the route which created the file. In
  your case the stream cache file is deleted when the direct:start
  route is finished. The wire tap runs in a separate thread and
  therefore it can happen that it tries to read the cached file when it
  is already deleted, especially when you have a delay in the wiretap
  route (direct:x).
 
 
  Regards Franz
 
  On Fri, Apr 17, 2015 at 6:05 PM, Geert Vanheusden
  geer...@aviovision.com wrote:
   Hi,
  
   I 

Re: Strange side effects when testing with expectedHeaderValuesReceivedInAnyOrder

2015-04-23 Thread Preben.Asmussen
ahh - so  expectedMessageCount and expectedHeaderValuesReceivedInAnyOrder
exclude each other. Thats a bit unexpected. I would have guessed that all
expectations set up in a test would have been evaluated. 

Best,
Preben



--
View this message in context: 
http://camel.465427.n5.nabble.com/Strange-side-effects-when-testing-with-expectedHeaderValuesReceivedInAnyOrder-tp5766203p5766211.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to track file modifications

2015-04-23 Thread Claus Ibsen
Hi

You can use the stream component, which can monitor a file for changes
(like a tail command).
http://camel.apache.org/stream

Other than that its not out of the box from Camel and you would need
to build your own component / java code to do so.


On Thu, Apr 23, 2015 at 6:15 PM, Akram akram.s...@gmail.com wrote:
 I needed to track the changes to a file. I thought it would be look like
 this:

 from(file://mydirectory?noop=truefileName=myfile.jsonidempotentKey={file:modified}-{file:size})

 If the file(myfile.json) changes then I should get an Exchange. But this is
 not working. It is treating the file as new and starts reading it from
 beginning. Is there any way to achieve this.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-to-track-file-modifications-tp5766237.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: URISyntaxException: Invalid uri syntax: Trailing marker found

2015-04-23 Thread Claus Ibsen
Hi

Yeah I guess we can allow http related components to ignore trailing  markers.
You are welcome to log a JIRA ticket about this improvement.



On Fri, Apr 24, 2015 at 12:24 AM, hzariv hza...@ebay.com wrote:
 I am using camel netty4-http and getting the following exception because the
 query string my server is receiving ends with ''. Since I cannot control
 the URLs my server receives, I need to get around this issue. As far as I
 know most sites simply ignore the trailing  at the end of query string.


 23769 [Camel (camel-1) thread #0 - NettyEventExecutorGroup] WARN  - Closing
 channel as an exception was thrown from Netty
 java.net.URISyntaxException: Invalid uri syntax: Trailing  marker found.
 Check the uri and remove the trailing  marker.:
 version=765responseencoding=JSONappid=xxxsiteid=0callname=ItemID=131334609454IncludeSelector=Details
 at org.apache.camel.util.URISupport.parseQuery(URISupport.java:153)
 ~[camel-core-2.15.1.jar:2.15.1]
 at org.apache.camel.util.URISupport.parseQuery(URISupport.java:133)
 ~[camel-core-2.15.1.jar:2.15.1]
 at
 org.apache.camel.component.netty4.http.DefaultNettyHttpBinding.populateCamelHeaders(DefaultNettyHttpBinding.java:182)
 ~[camel-netty4-http-2.15.1.jar:2.15.1]
 at
 org.apache.camel.component.netty4.http.RestNettyHttpBinding.populateCamelHeaders(RestNettyHttpBinding.java:50)
 ~[camel-netty4-http-2.15.1.jar:2.15.1]
 at
 org.apache.camel.component.netty4.http.DefaultNettyHttpBinding.toCamelMessage(DefaultNettyHttpBinding.java:89)
 ~[camel-netty4-http-2.15.1.jar:2.15.1]
 at
 org.apache.camel.component.netty4.http.NettyHttpEndpoint.createExchange(NettyHttpEndpoint.java:103)
 ~[camel-netty4-http-2.15.1.jar:2.15.1]
 at
 org.apache.camel.component.netty4.handlers.ServerChannelHandler.channelRead0(ServerChannelHandler.java:87)
 ~[camel-netty4-2.15.1.jar:2.15.1]
 at
 org.apache.camel.component.netty4.http.handlers.HttpServerChannelHandler.channelRead0(HttpServerChannelHandler.java:202)
 ~[camel-netty4-http-2.15.1.jar:2.15.1]
 at
 io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
 ~[netty-transport-4.0.26.Final.jar:4.0.26.Final]
 at
 org.apache.camel.component.netty4.http.handlers.HttpServerMultiplexChannelHandler.channelRead0(HttpServerMultiplexChannelHandler.java:119)
 ~[camel-netty4-http-2.15.1.jar:2.15.1]
 at
 io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
 ~[netty-transport-4.0.26.Final.jar:4.0.26.Final]
 at
 io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
 [netty-transport-4.0.26.Final.jar:4.0.26.Final]
 at
 io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)
 [netty-transport-4.0.26.Final.jar:4.0.26.Final]
 at
 io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:329)
 [netty-transport-4.0.26.Final.jar:4.0.26.Final]
 at
 io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
 [netty-common-4.0.26.Final.jar:4.0.26.Final]
 at
 io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
 [netty-common-4.0.26.Final.jar:4.0.26.Final]
 at java.lang.Thread.run(Thread.java:744) [na:1.7.0-45]



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/URISyntaxException-Invalid-uri-syntax-Trailing-marker-found-tp5766256.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: streaming big xml file witht tokenizer

2015-04-23 Thread Claus Ibsen
Hi

Yeah see some of the splitting big files blog posts from
http://camel.apache.org/articles

And also about big xml files here
http://camel.apache.org/splitter

On Fri, Apr 24, 2015 at 12:12 AM, majid mohamed.elgabbo...@peerius.com wrote:
 Hi all,

 I need to parse and handle records of a big XML file, this file need to be
 downloaded from some location which may take up to 10 min, so I am wondering
 if I can start streaming and get my records as I am downloading the file to
 optimise the overall processing time ?

 For example, start the download and immediately after that I start my parser
 route to get the records ?

 Cheers
 Majid



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/streaming-big-xml-file-witht-tokenizer-tp5766254.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/