RE: Multiple JMS producer with IBMMQ

2014-08-05 Thread Ali, Mohammad
Hi Christian,

Thanks for your reply.

Will concurrentConsumer option work for producer also? I will give a try to 
this.

Regards,
Shadab


-Original Message-
From: Christian Müller [mailto:christian.muel...@gmail.com] 
Sent: Tuesday, August 05, 2014 1:40 AM
To: users@camel.apache.org
Subject: Re: Multiple JMS producer with IBMMQ

Is the concurrentConsumer option not working for you?

Best,
Christian
Am 04.08.2014 18:02 schrieb Ali, Mohammad mohammad.a...@genpact.com:

 Hi,

 I am using camel-2.9.0. JMS producer component with IBMMQ performance 
 is very slow, I want to create multiple JMS producer to send message 
 to IBM queue something like multi-threading. Is there a way in camel 
 where I can create multiple threads of JMS producer, just like concurrent 
 consumers.


 Thanks,
 Shadab

 This e-mail (and any attachments), is confidential and may be privileged.
 It may be read, copied and used only
 by intended recipients. Unauthorized access to this e-mail (or
 attachments) and disclosure or copying of its contents or any action 
 taken in reliance on it is unlawful. Unintended recipients must notify 
 the sender immediately by e-mail/phone  delete it from their system 
 without making any copies or disclosing it to a third person.



This e-mail (and any attachments), is confidential and may be privileged. It 
may be read, copied and used only
by intended recipients. Unauthorized access to this e-mail (or attachments) and 
disclosure or copying of its 
contents or any action taken in reliance on it is unlawful. Unintended 
recipients must notify the sender immediately 
by e-mail/phone  delete it from their system without making any copies or 
disclosing it to a third person.



Re: Multiple JMS producer with IBMMQ

2014-08-05 Thread Christian Müller
Hi Shadab!

Sorry, I overlooked that you are talking about the producer.
What is the source you are reading from?
And may the thread() DSL element is helpful for you:

from(xxx)
   .threads(3, 10, threadName)
   .to(xxx);


Best,

Christian
-

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Aug 5, 2014 at 8:26 AM, Ali, Mohammad mohammad.a...@genpact.com
wrote:

 Hi Christian,

 Thanks for your reply.

 Will concurrentConsumer option work for producer also? I will give a try
 to this.

 Regards,
 Shadab


 -Original Message-
 From: Christian Müller [mailto:christian.muel...@gmail.com]
 Sent: Tuesday, August 05, 2014 1:40 AM
 To: users@camel.apache.org
 Subject: Re: Multiple JMS producer with IBMMQ

 Is the concurrentConsumer option not working for you?

 Best,
 Christian
 Am 04.08.2014 18:02 schrieb Ali, Mohammad mohammad.a...@genpact.com:

  Hi,
 
  I am using camel-2.9.0. JMS producer component with IBMMQ performance
  is very slow, I want to create multiple JMS producer to send message
  to IBM queue something like multi-threading. Is there a way in camel
  where I can create multiple threads of JMS producer, just like
 concurrent consumers.
 
 
  Thanks,
  Shadab
 
  This e-mail (and any attachments), is confidential and may be privileged.
  It may be read, copied and used only
  by intended recipients. Unauthorized access to this e-mail (or
  attachments) and disclosure or copying of its contents or any action
  taken in reliance on it is unlawful. Unintended recipients must notify
  the sender immediately by e-mail/phone  delete it from their system
  without making any copies or disclosing it to a third person.
 
 

 This e-mail (and any attachments), is confidential and may be privileged.
 It may be read, copied and used only
 by intended recipients. Unauthorized access to this e-mail (or
 attachments) and disclosure or copying of its
 contents or any action taken in reliance on it is unlawful. Unintended
 recipients must notify the sender immediately
 by e-mail/phone  delete it from their system without making any copies or
 disclosing it to a third person.




Re: Dispatch queue 'mqtt client' was not executing error from camel-mqtt producer

2014-08-05 Thread Tomohisa Igarashi
Hi,

I filed a JIRA for this issue:
https://issues.apache.org/jira/browse/CAMEL-7662

Thanks,
Tomo

--
IGARASHI Tomohisamailto:tm.igara...@gmail.com


On Thu, Jul 17, 2014 at 4:03 PM, Tomohisa Igarashi
tm.igara...@gmail.com wrote:
 Hi Charles,

 I don't think it's a warning, please see this surefire report:
 http://pastebin.com/zYGxWmNx

 You can see the test fails with this error. The message is not sent actually.

 Thanks,
 Tomo

 --
 IGARASHI Tomohisamailto:tm.igara...@gmail.com


 On Thu, Jul 17, 2014 at 3:47 PM, Charles Moulliard ch0...@gmail.com wrote:
 There is an issue with the unit test, reason why the test is commented.

 The message that you see is a warning reported when the camel route service
 shutting down and I don't think that it is related to the fact that test
 fails

 --

 2014-07-17 07:38:09,267 [main   ] WARN  DefaultCamelContext
- Error occurred while shutting down service:
 org.apache.camel.impl.RouteService@1a6032ce. This exception will be ignored.
 java.lang.AssertionError: Dispatch queue 'mqtt client' was not executing,
 (currently executing: 'not-dispatched')
 at
 org.fusesource.hawtdispatch.internal.SerialDispatchQueue.assertExecuting(SerialDispatchQueue.java:145)
 at
 org.fusesource.hawtdispatch.transport.TcpTransport.offer(TcpTransport.java:644)
 at
 org.fusesource.mqtt.client.CallbackConnection.send(CallbackConnection.java:653)
 at
 org.fusesource.mqtt.client.CallbackConnection.disconnect(CallbackConnection.java:548)
 at
 org.apache.camel.component.mqtt.MQTTEndpoint.doStop(MQTTEndpoint.java:145)
 at
 org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:102)
 at
 org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:141)
 at
 org.apache.camel.util.ServiceHelper.stopAndShutdownServices(ServiceHelper.java:234)
 at
 org.apache.camel.util.ServiceHelper.stopAndShutdownServices(ServiceHelper.java:192)
 at
 org.apache.camel.impl.RouteService.doShutdown(RouteService.java:272)
 at
 org.apache.camel.support.ChildServiceSupport.shutdown(ChildServiceSupport.java:109)
 ...


 On Thu, Jul 17, 2014 at 8:15 AM, Tomohisa Igarashi tm.igara...@gmail.com
 wrote:

 I see this error with just commented out the following line and run mvn
 clean package:
 https://github.com/apache/camel/blob/camel-2.12.2/
 components/camel-mqtt/pom.xml#L84


 (07/17/2014 03:00 PM), Charles Moulliard wrote:

 You can use camel mqtt component to produce (
 https://github.com/apache/camel/blob/camel-2.12.2/
 components/camel-mqtt/src/main/java/org/apache/camel/
 component/mqtt/MQTTProducer.java
 )
 Can you provide us more info about your use case, config, ... ?


 On Thu, Jul 17, 2014 at 7:05 AM, Tomohisa Igarashi tm.igara...@gmail.com
 
 wrote:

  Hi,

 I'm trying to use camel-mqtt producer on camel 2.12.2 but it fails
 with the error:
 --
 Caused by: java.lang.AssertionError: Dispatch queue 'mqtt client' was
 not executing, (currently executing: 'mqtt client')
 at
 org.fusesource.hawtdispatch.internal.SerialDispatchQueue.
 assertExecuting(SerialDispatchQueue.java:145)
 at
 org.fusesource.mqtt.client.CallbackConnection.publish(
 CallbackConnection.java:585)
 at
 org.fusesource.mqtt.client.CallbackConnection.publish(
 CallbackConnection.java:581)
 at
 org.apache.camel.component.mqtt.MQTTEndpoint.publish(
 MQTTEndpoint.java:160)
 at
 org.apache.camel.component.mqtt.MQTTProducer.process(
 MQTTProducer.java:58)
 ...(snip)...
 --

 I found MQTTProducerTest in the camel-mqtt tests is excluded in its
 pom.xml, so tried to run it but it fails with same error. Is
 MQTTProducer not supported on camel 2.12.2?

 Thanks,
 Tomo

 --
 IGARASHI Tomohisamailto:tm.igara...@gmail.com





 --
 Tomohisa Igarashi
 mailto:tm.igara...@gmail.com




 --
 Charles Moulliard
 Apache Committer / Architect @RedHat
 Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io


MQTT producer failure

2014-08-05 Thread Tomohisa Igarashi
Hi,

I'm still struggling with camel-mqtt producer to get it working. This
is a previous thread:
http://camel.465427.n5.nabble.com/Dispatch-queue-mqtt-client-was-not-executing-error-from-camel-mqtt-producer-tp5753937.html

I made an example which runs a standalone camel route to verify
camel-mqtt works as expected:
https://github.com/igarashitm/camel/tree/mqtt-consumer-producer-failure
https://github.com/igarashitm/camel/commit/24bdf5c7f8bac5763f2485591561773bba4e337f

But it hits an another issue on producer side. A message is never
published to the output topic through the MQTT producer and it repeats
redeliveries without any error/warn message unless the testcase is
shut down.

Am I doing something wrong in the testcase? If not, I'll file a JIRA
with this example.

Thanks,
Tomo
--
IGARASHI Tomohisamailto:tm.igara...@gmail.com


simple programatic camel and OSGi

2014-08-05 Thread apanday
Hi all,

I have a fairly good understanding of OSGi, not so much of Camel internals.
I'm trying to start a simple camel route involving rabbitmq in an OSGi
container (simple file - camel). 
(and incidentally I'm using the scala DSL, and camel version 2.13.2, inside
a simple felix container)

My problem is (what seems to be) the usual: 
Failed to resolve endpoint: rabbitmq://localhost/... due to: No component
found with scheme: rabbitmq

I would like to understand in simple programatic terms how these custom
endpoints get wired to the camel context, in an OSGi container. 
By simple i mean, please no answer in the lines of just use
karaf+spingdm+eclipse+maven+... I know i'm missing something trivial, yet i
don't want to obfuscate my problem under a pile of libraries. 
If someone could help before i dive too deep into the camel source code.
My understanding is that the camel-osgi bundle tracks starting bundles and
scans them for camel components, then registers the components to the
service registry (and maybe somewhere in camel).. yet it doesn't seem to
quite work this way.


This has been my approach so far:

step 0: simply define the route in my activator

= Failed to resolve endpoint

step 2: add a dependency on the rabbitmq ComponentResolver (i noticed in the
webconsole that it was registered)

= got the rabbit prints ok, but camel still Failed to resolve endpoint

step 3: explicitely resolve the rabbit in my context

= got the rabbit prints ok and resolve doesn't fail, but camel still
Failed to resolve endpoint

Many thanks,
Arjun



--
View this message in context: 
http://camel.465427.n5.nabble.com/simple-programatic-camel-and-OSGi-tp5754790.html
Sent from the Camel - Users mailing list archive at Nabble.com.


InterceptStrategy added to ToDefinition is not executed

2014-08-05 Thread spa
Hello all,

I have a question regarding InterceptStrategies. I'd like to add an
InterceptStrategy that only intercepts a specific processing step (kind of
an Around advice). After reading and trying a few things I have a solution
that works by adding the InterceptStrategy during the
addRoutesToCamelContext() call of the RouteBuilder class:

configureRoutes((ModelCamelContext) context);

for (RouteDefinition myRoute : getRouteCollection().getRoutes())
{   
myRoute.addInterceptStrategy(myStrategy);
}
populateRoutes();

The problem is of course that this approach leads to the interception of all
processing steps. I'm currently handling this inside my interceptor, but I'd
like a better solution, so I looked a bit further and saw that it is
possible to add an InterceptStrategy to a ToDefinition. Thus I created a
ToDefinition on my own, wrapping my target URI, adding my InterceptStrategy
and added it via addOutput(). Unfortunately, the interceptor is never
executed and I don't know why. Has anyone experienced a similar situation or
is there another way to achieve what I like to achieve?

Thanks in advance

Sven

PS.: I am using Camel 2.13.1



--
View this message in context: 
http://camel.465427.n5.nabble.com/InterceptStrategy-added-to-ToDefinition-is-not-executed-tp5754794.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: simple programatic camel and OSGi

2014-08-05 Thread Matt Sicker
If you're not using Blueprint, then this is how you need to do it:

1. Create the Component instance somewhere (like a BundleActivator).
2. Register it as a service with at least the attribute name = rabbitmq.
3. Now it's available from the default OSGi Camel registry!

This is actually a point in Camel where I've been thinking about working on
improved support. If you use Declarative Services, for example, then you
still need to add in some custom overriding code in a CamelContext
implementation in order to look up said services.


On 5 August 2014 04:47, apanday apan...@apache.org wrote:

 Hi all,

 I have a fairly good understanding of OSGi, not so much of Camel internals.
 I'm trying to start a simple camel route involving rabbitmq in an OSGi
 container (simple file - camel).
 (and incidentally I'm using the scala DSL, and camel version 2.13.2, inside
 a simple felix container)

 My problem is (what seems to be) the usual:
 Failed to resolve endpoint: rabbitmq://localhost/... due to: No component
 found with scheme: rabbitmq

 I would like to understand in simple programatic terms how these custom
 endpoints get wired to the camel context, in an OSGi container.
 By simple i mean, please no answer in the lines of just use
 karaf+spingdm+eclipse+maven+... I know i'm missing something trivial, yet
 i
 don't want to obfuscate my problem under a pile of libraries.
 If someone could help before i dive too deep into the camel source code.
 My understanding is that the camel-osgi bundle tracks starting bundles and
 scans them for camel components, then registers the components to the
 service registry (and maybe somewhere in camel).. yet it doesn't seem to
 quite work this way.


 This has been my approach so far:

 step 0: simply define the route in my activator

 = Failed to resolve endpoint

 step 2: add a dependency on the rabbitmq ComponentResolver (i noticed in
 the
 webconsole that it was registered)

 = got the rabbit prints ok, but camel still Failed to resolve endpoint

 step 3: explicitely resolve the rabbit in my context

 = got the rabbit prints ok and resolve doesn't fail, but camel still
 Failed to resolve endpoint

 Many thanks,
 Arjun



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/simple-programatic-camel-and-OSGi-tp5754790.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Matt Sicker boa...@gmail.com


Re: simple programatic camel and OSGi

2014-08-05 Thread Claus Ibsen
Use OsgiDefaultCamelContext from camel-core-osgi and use the
OsgiCamelContextHelper to hook it into the osgi world, as it does
setup a bunch of stuff.






On Tue, Aug 5, 2014 at 2:50 PM, Matt Sicker boa...@gmail.com wrote:
 If you're not using Blueprint, then this is how you need to do it:

 1. Create the Component instance somewhere (like a BundleActivator).
 2. Register it as a service with at least the attribute name = rabbitmq.
 3. Now it's available from the default OSGi Camel registry!

 This is actually a point in Camel where I've been thinking about working on
 improved support. If you use Declarative Services, for example, then you
 still need to add in some custom overriding code in a CamelContext
 implementation in order to look up said services.


 On 5 August 2014 04:47, apanday apan...@apache.org wrote:

 Hi all,

 I have a fairly good understanding of OSGi, not so much of Camel internals.
 I'm trying to start a simple camel route involving rabbitmq in an OSGi
 container (simple file - camel).
 (and incidentally I'm using the scala DSL, and camel version 2.13.2, inside
 a simple felix container)

 My problem is (what seems to be) the usual:
 Failed to resolve endpoint: rabbitmq://localhost/... due to: No component
 found with scheme: rabbitmq

 I would like to understand in simple programatic terms how these custom
 endpoints get wired to the camel context, in an OSGi container.
 By simple i mean, please no answer in the lines of just use
 karaf+spingdm+eclipse+maven+... I know i'm missing something trivial, yet
 i
 don't want to obfuscate my problem under a pile of libraries.
 If someone could help before i dive too deep into the camel source code.
 My understanding is that the camel-osgi bundle tracks starting bundles and
 scans them for camel components, then registers the components to the
 service registry (and maybe somewhere in camel).. yet it doesn't seem to
 quite work this way.


 This has been my approach so far:

 step 0: simply define the route in my activator

 = Failed to resolve endpoint

 step 2: add a dependency on the rabbitmq ComponentResolver (i noticed in
 the
 webconsole that it was registered)

 = got the rabbit prints ok, but camel still Failed to resolve endpoint

 step 3: explicitely resolve the rabbit in my context

 = got the rabbit prints ok and resolve doesn't fail, but camel still
 Failed to resolve endpoint

 Many thanks,
 Arjun



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/simple-programatic-camel-and-OSGi-tp5754790.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




 --
 Matt Sicker boa...@gmail.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: InterceptStrategy added to ToDefinition is not executed

2014-08-05 Thread Claus Ibsen
Hi

See this page
http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring.html

And then only wrap the processor when you want to do it

On Tue, Aug 5, 2014 at 2:47 PM, spa s...@intuitiveminds.de wrote:
 Hello all,

 I have a question regarding InterceptStrategies. I'd like to add an
 InterceptStrategy that only intercepts a specific processing step (kind of
 an Around advice). After reading and trying a few things I have a solution
 that works by adding the InterceptStrategy during the
 addRoutesToCamelContext() call of the RouteBuilder class:

 configureRoutes((ModelCamelContext) context);

 for (RouteDefinition myRoute : getRouteCollection().getRoutes())
 {
 myRoute.addInterceptStrategy(myStrategy);
 }
 populateRoutes();

 The problem is of course that this approach leads to the interception of all
 processing steps. I'm currently handling this inside my interceptor, but I'd
 like a better solution, so I looked a bit further and saw that it is
 possible to add an InterceptStrategy to a ToDefinition. Thus I created a
 ToDefinition on my own, wrapping my target URI, adding my InterceptStrategy
 and added it via addOutput(). Unfortunately, the interceptor is never
 executed and I don't know why. Has anyone experienced a similar situation or
 is there another way to achieve what I like to achieve?

 Thanks in advance

 Sven

 PS.: I am using Camel 2.13.1



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/InterceptStrategy-added-to-ToDefinition-is-not-executed-tp5754794.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: simple programatic camel and OSGi

2014-08-05 Thread apanday
Hi Matt,

Thanks a lot for your reply. It's still not very clear though:

1. Create the Component instance somewhere (like a BundleActivator).


2. Register it as a service with at least the attribute name =
 rabbitmq.


my service registry already contains the following service
[org.apache.camel.spi.ComponentResolver]
component = rabbitmq

i don't think i need to register is a second time.



 3. Now it's available from the default OSGi Camel registry!


wait, that was it!
i simply needed to replace my new DefaultCamelContext with a new
OsgiDefaultCamelContext(bundleContext)
nothing more to it..

the final code looks like this:


So the difference is simply that the DefaultCamelContext will load
components from the classpath whereas the OsgiDefaultCamelContext loads
from the service registry..

thanks!




--
View this message in context: 
http://camel.465427.n5.nabble.com/simple-programatic-camel-and-OSGi-tp5754790p5754798.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: simple programatic camel and OSGi

2014-08-05 Thread apanday
Thanks Claus! I just figured it out after reading Matt's response :)

On a side note, I really think things should be explained simply in these
terms in the tutorials. 
The tutorial @ http://camel.apache.org/tutorial-osgi-camel-part1.html is
quite scary just looking at the amount of dependencies and xml and.. stuff,
to do something fairly simple. 

I do appreciate the help :)



--
View this message in context: 
http://camel.465427.n5.nabble.com/simple-programatic-camel-and-OSGi-tp5754790p5754799.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: simple programatic camel and OSGi

2014-08-05 Thread Claus Ibsen
Hi

As the box on that page says that tutorial is outdated.

Anyway fancy OSGi is surely welcome to write a new tutorial.

We love contributions
http://camel.apache.org/contributing.html

And there is some OSGi / Karaf books also where some may touch a bit
how to do this as well as you are doing. Not sure if they cover that
aspect or just goes down the aries blueprint road with camel and talk
about the blueprint xml file as they only way of running camel in
osgi.




On Tue, Aug 5, 2014 at 3:34 PM, apanday apan...@apache.org wrote:
 Thanks Claus! I just figured it out after reading Matt's response :)

 On a side note, I really think things should be explained simply in these
 terms in the tutorials.
 The tutorial @ http://camel.apache.org/tutorial-osgi-camel-part1.html is
 quite scary just looking at the amount of dependencies and xml and.. stuff,
 to do something fairly simple.

 I do appreciate the help :)



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/simple-programatic-camel-and-OSGi-tp5754790p5754799.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: Adding HTTP Headers to All Jetty Routes

2014-08-05 Thread Gavagai
Thanks Claus - 

I think this has gotten me on the right track, but I'm not quite there yet
and am not sure why. Here are some snippets of code to help describe the
problem. We are using the Groovy DSL and executing using Main.

Here is the new binding definition:

class CORSHttpBinding extends DefaultHttpBinding {
@Override
public void writeResponse(exch, resp) {
resp.Header(test, test)
super.writeResponse(exch, resp)
}
}

This is added to the Registry via Main as follows:

Main main = new Main()
main.bind(CORSHttpBinding, new CORSHttpBinding())
.
.
.
main.run()

Finally, the Jetty route is specified as follows (additional routing after
this has been omitted):

   
from(jetty:http://0.0.0.0:$port/validate/ping?httpBindingRef=CORSHttpBinding;)

I've added some debugging code in various places, but writeResponse() is
never called.

Thanks for any help - I am fairly new to this, if that's not obvious, and am
still getting my Camel-legs.

Tim



--
View this message in context: 
http://camel.465427.n5.nabble.com/Adding-HTTP-Headers-to-All-Jetty-Routes-tp5754265p5754804.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Can we use processStrategy inside the route in the from URI to poll the files over sftp?

2014-08-05 Thread arvind
Hi I am running with camel 2.9.2 .Below is the from uri using to poll the
files from SFTP to local directory ,it gets connected than disconnecting and 
throwing an issue

 INFO  org.apache.camel.component.file.remote.SftpOperations  - JSCH -
Caught an exception, leaving main loop due to socket closed.

If I remove  processStrategy=#BPXFProcessStrategyamp from uri than able
to poll the files over SFTP using filter.
=

route id=abc
from
uri=sftp://@11.11.11.11:21//Users?filter=#BPXFFilteramp;processStrategy=#BPXFProcessStrategyamp;idempotent=trueamp;idempotentRepository=#BPXFStore_axisamp;localWorkDirectory=C:/tempamp;binary=trueamp;password=***;
/
to uri=file:E:\xyz /
/route

===

Please suggest .



--
View this message in context: 
http://camel.465427.n5.nabble.com/Can-we-use-processStrategy-inside-the-route-in-the-from-URI-to-poll-the-files-over-sftp-tp5754806.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: simple programatic camel and OSGi

2014-08-05 Thread apanday
got you :)

before i start contributing a new tutorial though, i'll try to learn how to
use camel myself.

i'll be coming back with more questions very soon!

thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/simple-programatic-camel-and-OSGi-tp5754790p5754810.html
Sent from the Camel - Users mailing list archive at Nabble.com.


errorHandler and onException

2014-08-05 Thread apanday
Hi,

I'm setting up a simple route that reads files and dumps them into a
rabbitmq exchange.
By default, the rabbitmq endpoint is configured as an immediate exchange
which means that if no active consumer is present, an error is thrown.
I don't have a consumer yet, so i simply expect everything to fail :)

My route is setup as follows (scala DSL):


I have two questions here:
- first, when i try this, the first file I copy is consumed.. and vanishes!
it is neither in the input dir nor in the error dir (nor in rabbit as far as
i can tell). I only get an error starting with the second input file

- second, when i do get an error, it is not caught by the errorHandler: the
second file remains in the input dir and is retried indefinitely

Then, I tried using onException:


Same issue with the first input vanishing, but this time at least, the error
is caught and the second file is moved to the dead letters. 

My understanding was that errorHandler was for uncaught exceptions, while
onException was for handling specific cases.. Am I doing something wrong?

thanks again..



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


Polling a directory for inner directories

2014-08-05 Thread jkir
Hi all,

I am currently looking at the File2 processor, and it seems to me that my
fairly simple use case isn't covered by this. I am a complete Camel newbie,
so I am hoping someone can prove me wrong or suggest an alternative!

I want to be able to watch a directory for changes, but I only want to
further process the subdirectories of that directory when they appear, NOT
the files. For example, if I was watching the D directory in:

D/
- D1/
-- f1.txt
-- f2.txt
- D2/
-- f3.txt
-- f4.txt

Then I would want to process two events for D1 and D2, ignoring any files
underneath. Currently, with the consumer:

file://C:/D?moveFailed=failedpreMove=processingmove=processed/${file:name}

This will fail to pick up the subdirectories inside D, only matching when
files are placed immediately below D but not directories. The documentation
implies that directories can be matched by using a FileFilter
(http://camel.apache.org/file2.html#File2-Filterusingorg.apache.camel.component.file.GenericFileFilter),
however in my testing even this exact example still does not appear to match
directories, only files.

Has anyone got any suggestions?

Thanks in advance,

James



--
View this message in context: 
http://camel.465427.n5.nabble.com/Polling-a-directory-for-inner-directories-tp5754812.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Polling a directory for inner directories

2014-08-05 Thread carlo cancellieri
Hi,
Some time ago I did something like tjis using apache commons io and file
observer.
You may implement a recursive observer throwing events on sub directoy
modify.
Take a look here:
http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/monitor/FileAlterationObserver.html
Cheers,
Carlo
Il 05/ago/2014 19:10 jkir james.kirr...@baesystems.com ha scritto:

 Hi all,

 I am currently looking at the File2 processor, and it seems to me that my
 fairly simple use case isn't covered by this. I am a complete Camel newbie,
 so I am hoping someone can prove me wrong or suggest an alternative!

 I want to be able to watch a directory for changes, but I only want to
 further process the subdirectories of that directory when they appear, NOT
 the files. For example, if I was watching the D directory in:

 D/
 - D1/
 -- f1.txt
 -- f2.txt
 - D2/
 -- f3.txt
 -- f4.txt

 Then I would want to process two events for D1 and D2, ignoring any files
 underneath. Currently, with the consumer:


 file://C:/D?moveFailed=failedpreMove=processingmove=processed/${file:name}

 This will fail to pick up the subdirectories inside D, only matching when
 files are placed immediately below D but not directories. The documentation
 implies that directories can be matched by using a FileFilter
 (
 http://camel.apache.org/file2.html#File2-Filterusingorg.apache.camel.component.file.GenericFileFilter
 ),
 however in my testing even this exact example still does not appear to
 match
 directories, only files.

 Has anyone got any suggestions?

 Thanks in advance,

 James



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Polling-a-directory-for-inner-directories-tp5754812.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Return aggregation of Splitter results, not splitter input

2014-08-05 Thread efenderbosch
I figured it out.

Simply changing

split().body()

to

split(body(), new TestAggregationStrategry())

Allowed me to customize the result of the split/aggregation. I now have the
aggregated results of TestTwo being sent to the response queue.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Return-aggregation-of-Splitter-results-not-splitter-input-tp5754814p5754817.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel with Jackson will not run in JDK8, FYI

2014-08-05 Thread heregear
Just so everyone knows, you can't use Camel with Jackson on JDK8 until they
fix JDK8 in u20:

https://bugs.openjdk.java.net/browse/JDK-8035399




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-with-Jackson-will-not-run-in-JDK8-FYI-tp5754815.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Return aggregation of Splitter results, not splitter input

2014-08-05 Thread efenderbosch
Route definition:

from(activemq:test_request_queue).
log(#1 ${in.body}).
bean(TestOne.class). // hard coded to return a String[3]
log(#2 ${in.body[0]} ${in.body[1]} ${in.body[2]}).
split().body().
log(#3 ${in.body} ${property.CamelSplitIndex} ${property.CamelSplitSize}
${property.CamelSplitComplete}).
bean(TestTwo.class). // returns a random integer
log(#4 ${in.body} ${property.CamelSplitIndex} ${property.CamelSplitSize}
${property.CamelSplitComplete}).
end().
log(#5 ${in.body[0]} ${in.body[1]} ${in.body[2]}).
to(activemq:test_response_queue);

Log output:

#1 1234
#2 760394b6-504a-4153-8feb-5438c2ceb423 8d66a917-7a70-4acf-bae4-4a91e7d1482c
c7cd36f2-f99d-4a6d-b882-c7c2b58d13fd
#3 760394b6-504a-4153-8feb-5438c2ceb423 0 3 false
#4 1320892645 0 3 false
#3 8d66a917-7a70-4acf-bae4-4a91e7d1482c 1 3 false
#4 -2060337139 1 3 false
#3 c7cd36f2-f99d-4a6d-b882-c7c2b58d13fd 2 3 true
#4 1760043357 2 3 true
#5 760394b6-504a-4153-8feb-5438c2ceb423 8d66a917-7a70-4acf-bae4-4a91e7d1482c
c7cd36f2-f99d-4a6d-b882-c7c2b58d13fd

What I'm looking for @ log #5 is 1320892645 -2060337139 1760043357, which
is the results of TestTwo. I'm getting the results of TestOne.

Is there a simple way to configure the splitter or a simple aggregation that
I can use to accomplish this? I've been playing with the examples all day
and can't quite get it right.

Thanks.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Return-aggregation-of-Splitter-results-not-splitter-input-tp5754814.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Polling a directory for inner directories

2014-08-05 Thread Claus Ibsen
Hi

There is a recursive option you can set to true. And there is also
min/max depth options too. See the file docs at
http://camel.apache.org/file2

On Tue, Aug 5, 2014 at 7:09 PM, jkir james.kirr...@baesystems.com wrote:
 Hi all,

 I am currently looking at the File2 processor, and it seems to me that my
 fairly simple use case isn't covered by this. I am a complete Camel newbie,
 so I am hoping someone can prove me wrong or suggest an alternative!

 I want to be able to watch a directory for changes, but I only want to
 further process the subdirectories of that directory when they appear, NOT
 the files. For example, if I was watching the D directory in:

 D/
 - D1/
 -- f1.txt
 -- f2.txt
 - D2/
 -- f3.txt
 -- f4.txt

 Then I would want to process two events for D1 and D2, ignoring any files
 underneath. Currently, with the consumer:

 file://C:/D?moveFailed=failedpreMove=processingmove=processed/${file:name}

 This will fail to pick up the subdirectories inside D, only matching when
 files are placed immediately below D but not directories. The documentation
 implies that directories can be matched by using a FileFilter
 (http://camel.apache.org/file2.html#File2-Filterusingorg.apache.camel.component.file.GenericFileFilter),
 however in my testing even this exact example still does not appear to match
 directories, only files.

 Has anyone got any suggestions?

 Thanks in advance,

 James



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Polling-a-directory-for-inner-directories-tp5754812.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 with Jackson will not run in JDK8, FYI

2014-08-05 Thread heregear
An update to this:  this only occurs when running with JDWP (i.e. in debug
mode), which is why the JDK team dropped the severity of the bug.

The workaround is to either not debug w/JDWP, or, when debugging to set the
JVM arg -Djava.compiler=NONE.  Your code will run a bit slower, but it's a
do-able workaround.

A more general question I have to ask:  To what extent has Camel been tested
with JDK 8?  

An update to this:  this only occurs when running with JDWP (i.e. in debug
mode), which is why the JDK team dropped the severity of the bug.

The workaround is to either not debug w/JDWP, or, when debugging to set the
JVM arg -Djava.compiler=NONE.  Your code will run a bit slower, but it's a
do-able workaround.

A more general question I have to ask:  To what extent has Camel been tested
with JDK 8?  

One final question:  camel core is definitely using Jackson, does anyone
have a list of components that use Jackson in core so that we can steer
clear of it until this bug is fixed or at least be prepped for it?

Thanks in advance.


Thanks in advance.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-with-Jackson-will-not-run-in-JDK8-FYI-tp5754815p5754818.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel with Jackson will not run in JDK8, FYI

2014-08-05 Thread Claus Ibsen
Camel 2.14 is the first release to support and be tested with Java 8.

camel-core does NOT depend or use Jackson. It only has limited
dependencies on slf4j and jaxb.



On Tue, Aug 5, 2014 at 9:57 PM, heregear e...@heregear.com wrote:
 An update to this:  this only occurs when running with JDWP (i.e. in debug
 mode), which is why the JDK team dropped the severity of the bug.

 The workaround is to either not debug w/JDWP, or, when debugging to set the
 JVM arg -Djava.compiler=NONE.  Your code will run a bit slower, but it's a
 do-able workaround.

 A more general question I have to ask:  To what extent has Camel been tested
 with JDK 8?

 An update to this:  this only occurs when running with JDWP (i.e. in debug
 mode), which is why the JDK team dropped the severity of the bug.

 The workaround is to either not debug w/JDWP, or, when debugging to set the
 JVM arg -Djava.compiler=NONE.  Your code will run a bit slower, but it's a
 do-able workaround.

 A more general question I have to ask:  To what extent has Camel been tested
 with JDK 8?

 One final question:  camel core is definitely using Jackson, does anyone
 have a list of components that use Jackson in core so that we can steer
 clear of it until this bug is fixed or at least be prepped for it?

 Thanks in advance.


 Thanks in advance.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-with-Jackson-will-not-run-in-JDK8-FYI-tp5754815p5754818.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/