Re: How can I include common behavior in several routes?

2018-05-10 Thread Owain McGuire
Steve, My rudimentary reading of your question would suggest to me that what you are talking about is an common InOut route. So define a direct:commonRoute and then use it in the applicable routes. Or if it is more sophisticated, look at using a RouteBuilder class. HTH. O. > aware", how mi

Re: Empty/null response from netty4-http template producer

2018-03-27 Thread Owain McGuire
Alex, Just had a quick look. The post in the Rest DSL route goes to direct:echo-route but your echo-route does not have a "from direct:echo-route". My understanding is that the REST DSL generates a route that will have already consumed the POST and then once it has sent the exchange to the d

Re: State of the current Camel wiki documentation

2018-01-18 Thread Owain McGuire
Paul, One of the hardest aspects of using Camel is the ability to read the documentation. We generally use “pair-reading” to interpret unfamiliar areas - reviewing the examples, tests and source code are more productive. I generally agree that the documentation should be part of the code othe

Re: Design: State Machine implementation in Apache Camel

2018-01-10 Thread Owain McGuire
least, I would rely on Camel to perform the routing and processing, and if > you need a state machine, use something like StatefulJ and don't clutter > your camel orchestration with it. > > Owain, are you referring to the Guava EventBus, or Google Cloud Pub/Sub? > > On Wed, Jan

Re: Design: State Machine implementation in Apache Camel

2018-01-10 Thread Owain McGuire
Imran, Have you thought of a publish/subscribe model where each topic triggers multiple subscriptions. Perhaps have a look at Google pub/sub component. HTH. O. > On 10 Jan 2018, at 18:23, Imran Raza Khan wrote: > > Hi Steve, > > Thanks for detail reply. > > - I will evaluate StatefulJ if

Re: How to handle many-ftp endpoints

2017-08-09 Thread Owain McGuire
We have accomplished this with the Routebuilder. http://camel.apache.org/routebuilder.html Had all the ftp endpoints, cron/quartz details stored in a DB and generated the routes dynamically. > On 9 Aug 2017, at 09:45, Christian Stark wrote: > >

Re: Camel HTTPS - timing out

2017-06-29 Thread Owain McGuire
From the doc: http://camel.apache.org/http4.html Setting the Exchange.HTTP_URI overrides the URI on the endpoint. "The URI to call. The value of this option will override the existing URI that's set directly on the endpoint. It's not the same as the Camel

Re: Mocks receive no messages in Camel-SpringBoot test

2017-06-07 Thread Owain McGuire
Stephan, You appear not to be mocking the activemq:queue:output endpoint before you get the mock endpoint i the test. If you temporarily change the route uri to mock:activemq:queue:output then the test works. I am not sure how you would do it using injection. I use advicewith on the route to

Re: How to Extract json key, value from MQTT payload

2017-06-06 Thread Owain McGuire
Try unmarshal from json to pojo using http://camel.apache.org/json.html > On 6 Jun 2017, at 13:20, solomon wrote: > > Hi, > > I have created a camel route of mqtt -> jdbc which pushes the data in json > format into MQTT topic, now I want to extract the jso

Re: JettyClient failed cause by: HttpConnectionOverHTTP

2017-05-31 Thread Owain McGuire
Hi, My understanding is that you should not be using camel jetty as a producer since it is deprecated. http://camel.apache.org/jetty.html I would suggest using http4 component (http://camel.apache.org/http4 ) or try rest dsl f

Re: Spring Boot startup not working in JUnit

2017-05-30 Thread owain
This is how my tests are set up @RunWith(CamelSpringBootRunner.class) @MockEndpoints @UseAdviceWith @SpringBootTest(classes = mydomain.springbootcamel.SpringBootCamelExamples.class) public class RouteBTests { @Autowired private CamelContext camelContext; @Autowired private ProducerTempla

Re: Restoring body from header holding MyPojo works differently in test (with mock) than production

2017-05-30 Thread owain
Thanks Claus. So the general rule appears to be that do not rely on the class of headers as the components may manipulate them. So it looks as though MockEndpoint leaves them alone whereas the enrich route changes the type from pojo to string. Quoting from the book: "Properties—Similar to me

Restoring body from header holding MyPojo works differently in test (with mock) than production

2017-05-25 Thread owain
Camel 2.19.0 I have a route that saves the Pojo in the exchange body to a header, does an enrich to another route and then restores the original body from the header. from("direct:validate") .routeId("i4ip-ValidateOrder") .setBody().method(MyPojo.class, "validate(${headers})

Re: 2.19.0 Rest Producer DSL http4 support for PUT workaround

2017-05-17 Thread owain
Done. https://issues.apache.org/jira/browse/CAMEL-11293 -- View this message in context: http://camel.465427.n5.nabble.com/2-19-0-Rest-Producer-DSL-http4-support-for-PUT-workaround-tp5799706p5799725.html Sent from the Camel - Users mailing list archive at Nabble.com.

2.19.0 Rest Producer DSL http4 support for PUT workaround

2017-05-17 Thread owain
I have swapped out a route previously using http4 directly for the more succinct newly released producer DSL. What was working as: from("direct:getCounter") .routeId("i4ip-Get-Counter") .setHeader("CamelHttpMethod", constant("PUT")) .to("http4://{{counter.service.host}}:{{co

2.18.3 - Rest DSL MockEndpoint - second unit test weaveByToUri fails with "no output which matches: direct:RouteB in the Route(getRoute)

2017-04-27 Thread owain
I have discovered an issue when I run multiple tests on a route using weaveByToUri on the same endpoint. I have it replicated in my sample app. https://github.com/owain68/camel-spring-boot-examples It looks as though the .replace() replaces the endpoint for the whole test class, not just the indi

Re: how to build ftp server use camel ftp component?

2017-02-26 Thread owain
I think you might want to think of it this way. Run an ftp server (e.g. https://security.appspot.com/vsftpd.html which is normally available part of the Linux distro) and have your Camel route use the file component (http://camel.apache.org/file2.html) to move the files into the directory structur

Re: Camel 2.18.2 Spring Boot Unit Tests - Does mockOut.expectedMessageCount work?

2017-02-21 Thread owain
Here is a repo with the example. https://github.com/owain68/camel-spring-boot-examples -- View this message in context: http://camel.465427.n5.nabble.com/Camel-2-18-2-Spring-Boot-Unit-Tests-Does-mockOut-expectedMessageCount-work-tp5794070p5794204.html Sent from the Camel - Users mailing list

Re: Camel 2.18.2 Spring Boot Unit Tests - Does mockOut.expectedMessageCount work?

2017-02-21 Thread owain
Well that bit was much easier. @RunWith(CamelSpringBootRunner.class) @MockEndpoints @UseAdviceWith @SpringBootTest(classes = SpringBootCamelVanilla.class) public class RouteBTests {.} -- View this message in context: http://camel.465427.n5.nabble.com/Camel-2-18-2-Spring-Boot-Unit-Tests-Do

Re: Camel 2.18.2 Spring Boot Unit Tests - Does mockOut.expectedMessageCount work?

2017-02-21 Thread owain
Well it looks as though everything has changed! Just for Spring Boot? MockEndpoint mockOut = getMockEndpoint("mock:out"); is now MockEndpoint mockOut = camelContext.getEndpoint("mock:out", MockEndpoint.class); The documentation is somewhat thin on the ground to say the least. This is all I

Camel 2.18.2 Spring Boot Unit Tests - Does mockOut.expectedMessageCount work?

2017-02-17 Thread owain
I am experimenting with moving an application over from Blueprint to Spring Boot. I have set up two routes. Route A and tests work fine. Route B I am unable to receive an exchange on mock:out to satisfy mockOut.expectedMessageCount(1); and I get java.lang.AssertionError: mock://out Rece

CamelBluePrintTestSupport 2.17.0 getRouteDefinition null pointer exception

2016-11-23 Thread owain
I am getting a similar issue to this old issue on 2.14.0 http://camel.465427.n5.nabble.com/getRouteDefinition-throws-NullPointerException-in-CamelSpringTestSupport-before-context-is-started-td5759499.html My unit tests pass ok on IntelliJ IDEA but fail intermittently on mvn when I run the tests

Re: Best way to build a wait/retry loop with Camel?

2016-11-03 Thread owain
Just be careful of using the Active MQ delay since unless you clean this header up, it propagates to every subsequent queue. Quite difficult to debug! -- View this message in context: http://camel.465427.n5.nabble.com/Best-way-to-build-a-wait-retry-loop-with-Camel-tp5789712p5789722.html Sent f

Re: Enrich headers of message

2016-11-03 Thread owain
I think all you are wanting to do is save the file record (body) to your own header called, say, filebody, then you can restore filebody header to the exchange body at the end for the out. In the meantime you can do the enrich with the setBody to some data from header.filebody In summary, your ow

Re: Avro component example

2016-10-15 Thread owain
Have you a simple example you could share? Sent from my iPhone > On 15 Oct 2016, at 03:11, Vitalii Tymchyshyn [via Camel] > wrote: > > We are using avro quite succesfully. > > Чт, 13 жовт. 2016 07:25 користувач owain <[hidden email]> > пише: > > > Hi,

Avro component example

2016-10-13 Thread owain
Hi, Has anyone had any success converting a body (pojo) to an avro message via the avro component. I have generated the avro serialiser for the avro message bit I am struggling with the documentation and questions online. I am planning to send the avro message to some other routes via kakfa and

Re: Camel 2.17.0 Jetty9 Test failing

2016-10-11 Thread owain
Redhat support case 01719112 opened. No drop down for Fuse 6.3 yet in their support portal. I have will have a play with upstream to see if I can replicate. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-0-Jetty9-Test-failing-tp5788598p5788622.html Sent from th

Re: Camel 2.17.0 Jetty9 Test failing

2016-10-11 Thread owain
Tom, You are quite correct. It is a Red Hat build and I will raise a support request with them. O. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-0-Jetty9-Test-failing-tp5788598p5788621.html Sent from the Camel - Users mailing list archive at Nabble.com.

Camel 2.17.0 Jetty9 Test failing

2016-10-11 Thread owain
Hi, Has anyone had any luck testing the Rest DSL Jetty. I have moved to 2.17.0.redhat-630187 since that's the version that ships with the newly released Fuse 6.3. I see from the release notes that by default it uses Jetty9. As far as I am aware my test is using Jetty9 but I keep getting the fol

Re: org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml

2016-09-21 Thread owain
> > and it should give you a list of sample archetypes to use to start a > project. Also, since you are using Fuse there's a selection of projects > under the "quickstarts" directory in there. > > Brad > > > > > On Tue, Sep 20,

Re: org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml

2016-09-20 Thread owain
Brad, I am using 2.15.6 since this is the closest to Fuse-6.2.1. I have just tried the test with CBTS 2.17.0. Is there a higher version? I add mock:increment (now refactored to mock:out) and replace the "from" with direct:in in. context.getRouteDefinition("i4ip-order-publish-route").advice

Re: org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml

2016-09-19 Thread owain
Brad, Thank you for your response. Yes the default property in cm:default-properties is over-ridden in the .cfg loaded in loadConfigAdminConfigurationFile(). I was then logging {{foo}} in the route. All of this appears to be working correctly. I took your advice and ripped out everything to do

org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml

2016-09-16 Thread Owain McGuire
Hi, I have a simple wire-tap root and I am unit testing it using CamelBlueprintTestSupport. I can run the test and it passes but in the log I get: 2016-09-15 11:10:40,542 [int Extender: 2] ERROR BlueprintContainerImpl \- Unable to start blueprint container for bundle i4ip-order/1.0.0.SNA

Re: Fuse Blueprint properties override

2016-09-16 Thread owain
Ranx, Thanks for the tip. I have a parent project (POM) and modules, one each for services. So currently I have a pid for each service but some of the cfg settings are common across projects (e.g. kafka server address which is a pointer to a docker linked container). What would be cool would b

Re: Fuse Blueprint properties override

2016-09-15 Thread owain
Thanks for the two responses. The blog post is very comprehensive. I have updated blueprint-cm-1.1.0 and have added the update strategy to reload. Yes the persistent-id does not have cfg on the end, just the filename. (also the persistent id cannot have a - in it ends up being a Java method nam

Fuse Blueprint properties override

2016-09-14 Thread owain
Hi, In Fuse it looks as though if you have a property set in xml in cm:property-placeholder then you cannot override it in persistent.id.cfg file in /etc. I could see the properties in there but they appeared not to be used by the route, it just used the ones set in the xml. Is this true, if so

Re: Sample Projects in Camel

2016-07-22 Thread owain
This is relatively new and you might like to contribute to it rather than start from scratch. https://github.com/jammazwan/jammazwan.x_index It is certainly worth having a good look through. O. -- View this message in context: http://camel.465427.n5.nabble.com/Sample-Projects-in-Camel-tp5785

Re: How can I configure Camel/ActiveMQ to receive from an external RabbitMQ producer?

2016-07-21 Thread owain
Of course you can access the RabbitMQ server that someone else has set up and consume messages from that. When in development mode you may want to install a local Rabbit MQ server on your machine for unit testing (technically integration tests though) There is probably a neat installer or a docker

Re: How can I configure Camel/ActiveMQ to receive from an external RabbitMQ producer?

2016-07-20 Thread owain
The suggestion is to satisfy yourself that you are able to access the RabbitMQ from a command line or web gui from outside Camel to check that you do have it running, have the correct port, username and password. Then once you are satisfied it is available then use the same parameters on the endpoi

Re: Throttle Camel Requests based on query param

2016-06-19 Thread owain
All you need to do is to test for the presence of the query parameter or the Header being set. Have a look at http://camel.apache.org/predicate.html So all you do is amend the route or parameters to the component after that. O. -- View this message in context: http://camel.465427.n5.nabble

Re: Repost: Unable to configure component spring-redis RedisTemplate with Blueprint XML

2016-06-14 Thread owain
I have got it working. By trial and error. I am not sure why I couldn't find a working solution for Blueprint out there. Usually indicates to me that I was asking the wrong question. Seems that the # in the URI is the crucial element so that a reference to the bean is being passed to the compon

Re: Repost: Unable to configure component spring-redis RedisTemplate with Blueprint XML

2016-06-14 Thread owain
Here is the full stack trace without truncation. https://gist.github.com/owain68/4d1941c8ed7d4a05d8a57103a7bb2a16 -- View this message in context: http://camel.465427.n5.nabble.com/Repost-Unable-to-configure-component-spring-redis-RedisTemplate-with-Blueprint-XML-tp5784053p5784054.html Sent

Repost: Unable to configure component spring-redis RedisTemplate with Blueprint XML

2016-06-14 Thread owain
Apologies for the ugly original post. I have set up a simple route to isolate the string serialization problem that I am experiencing, like others, the problem where the default jdk serializer prepends "junk" at the start of the key and value, making it difficult/impossible to perform integration

Re: [camel 2.17] limited performance (not more than 20 req/s)

2016-06-14 Thread owain
Is there a typo toD in here? -- View this message in context: http://camel.465427.n5.nabble.com/camel-2-17-limited-performance-not-more-than-20-req-s-tp5783980p5784041.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel How to dequeue all messages accumulated every X minutes

2016-06-14 Thread owain
Have a look at using the While mode on the loop pattern. http://camel.apache.org/loop.html ${body.length} <= 5 A${body} -- View this message in context: http://camel.465427.n5.nabble.com/Camel-How-to-dequeue-all-messages-accumulated-every-X-minutes-tp5

Re: Unable to configure RedisTemplate with Blueprint XML

2016-06-14 Thread owain
Sorry XML was "nabbled". http://www.osgi.org/xmlns/blueprint/v1.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.a

Unable to configure RedisTemplate with Blueprint XML

2016-06-14 Thread Owain McGuire
ntents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/lib /javafx- mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaV

Re: It IS possible to import routeContext in OSGi Blueprint

2016-06-01 Thread owain
Thanks guys for the reply. This has really helped me tidy my unit tests up. I hadn't realised that I could load xml from the test resources directory from getBlueprintDescriptor(). Interestingly loadConfigAdminConfigurationFile() needs the full path from the module route. i.e. return ne

Re: Warning out on naming Blueprint property-placeholder persistent-id="stuff-test"

2016-06-01 Thread Owain McGuire
.org/jira/browse/KARAF-3007 > > On Tue, 31 May 2016 21:00:34 +0300, Owain McGuire <owain@integration.technology> wrote: > > > ![](https://link.nylas.com/open/ez36v71u7uh7qiundny4ougdd/local- dab1ed0a-250c) > > Finally found this: https://access.redhat.com/solutio

It IS possible to import routeContext in OSGi Blueprint

2016-05-31 Thread Owain McGuire
![](https://link.nylas.com/open/ez36v71u7uh7qiundny4ougdd/local-2413efdb-c652) Just come across this article https://access.redhat.com/solutions/259293 and it something not easily found in the community. http://camel.465427.n5.nabble.com/camel-blueprint-unit-tests-td5738925.html and http://camel.

Warning out on naming Blueprint property-placeholder persistent-id="stuff-test"

2016-05-31 Thread Owain McGuire
![](https://link.nylas.com/open/ez36v71u7uh7qiundny4ougdd/local-dab1ed0a-250c) Finally found this: https://access.redhat.com/solutions/1535463 If you have a dash "-" in the persistent-id then if you override the properties file in $FUSE_HOME/etc with the name .cfg then it won't pick t