Re: Problem with FailOverLoadBalancer

2013-09-05 Thread sbo13
Thank's Claus, I must admitt I hadn't thought about that.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-FailOverLoadBalancer-tp5738515p5738728.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Using an Expression for the delayer in the Scala DSL

2013-09-05 Thread cflockhart
Hi,
It seems that only a fixed Period for the delay can be used in the Scala
DSL. I want to have different values for test and production (a 1 hour
message delay is no good when running unit tests). It's possible to use an
expression in the Java DSL though.. so is one way to do this to override
onJavaBuilder() and define the route in that method instead of using the
Scala DSL?

thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-an-Expression-for-the-delayer-in-the-Scala-DSL-tp5738729.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Command to add activemq-cxf 2.6.0 into karaf

2013-09-05 Thread mahii.in87
Hi Claus,


i tried ,but got below error* FuseESB:karaf@root> features:install
activemq-cxf*
Error executing command: No feature named 'activemq-cxf' with version
'0.0.0' av
ailable


thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Command-to-add-activemq-cxf-2-6-0-into-karaf-tp5738718p5738730.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Error _in_adding_active mq dependencies

2013-09-05 Thread mahii.in87
Hi ,
 when I try to add the active mq dependencies to an existing pom file of the
type "Camel CXF Contract First" project.
It is showing error in the tag under artifactid 
in the pom file.Please take a look in the error screen shot.
These are the dependencies added


  org.apache.activemq
  activemq-core
  5.7.0.fuse-71-047


  org.apache.activemq
  activemq-camel
  5.7.0.fuse-71-047




 

thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Error-in-adding-active-mq-dependencies-tp5738731.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Command to add activemq-cxf 2.6.0 into karaf

2013-09-05 Thread Claus Ibsen
Hi

You install using features. So do a features:list to see which is available.

And this is an Apache Camel mailing list. You talk about Fuse ESB /
ServiceMix / Karaf. So in the future please use another mailing list
for these kind of questions as its not related to Apache Camel.



On Thu, Sep 5, 2013 at 9:22 AM, mahii.in87  wrote:
> Hi Claus,
>
>
> i tried ,but got below error* FuseESB:karaf@root> features:install
> activemq-cxf*
> Error executing command: No feature named 'activemq-cxf' with version
> '0.0.0' av
> ailable
>
>
> thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Command-to-add-activemq-cxf-2-6-0-into-karaf-tp5738718p5738730.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Using an Expression for the delayer in the Scala DSL

2013-09-05 Thread Claus Ibsen
Hi

What version of Camel do you use?

There may be room for improvement in the Scala DSL. As we love
contributions you are welcome to dive into the code base of
camel-scala and provide patches to add such functionality.

http://camel.apache.org/contributing.html

Also you are welcome to log a JIRA ticket for this improvement


On Thu, Sep 5, 2013 at 9:17 AM, cflockhart  wrote:
> Hi,
> It seems that only a fixed Period for the delay can be used in the Scala
> DSL. I want to have different values for test and production (a 1 hour
> message delay is no good when running unit tests). It's possible to use an
> expression in the Java DSL though.. so is one way to do this to override
> onJavaBuilder() and define the route in that method instead of using the
> Scala DSL?
>
> thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Using-an-Expression-for-the-delayer-in-the-Scala-DSL-tp5738729.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: MultipleConsumer on a vm: endpoint

2013-09-05 Thread Claus Ibsen
Hi

Yeah multipleConsumers is not support for vm. As the consumers is not
static shared.

On Wed, Sep 4, 2013 at 4:38 PM, Cristiano Costantini
 wrote:
> Hi Claus,
> that what I would expect and it works if all the consumers are on the same
> CamelContext.
>
> If I start two consumers on two different CamelContext, only one is reached
> by the route, and apparently it is the first one which is registered.
>
> thank you for your interest,
>
> Cristiano
>
>
>
>
>
> 2013/9/4 Claus Ibsen 
>
>> When you have mutipleConsumers=true and have 2+ consumers on the queue
>> name. Then each of them get a copy of the exchange, to process in
>> parallel.
>>
>> Its kinda like Topics in JMS land.
>>
>> Are you saying you expect something else to happen?
>>
>> On Wed, Sep 4, 2013 at 12:26 PM, Cristiano Costantini
>>  wrote:
>> > Hi All,
>> >
>> > I've switched and endpoint using seda: with options
>> multipleConsumers=true
>> > and waitForTaskToComplete=Never to using vm: component.
>> >
>> > After this, the application does not respect anymore the
>> > multipleConsumers=true options and two concurrent consumer steal the
>> > message.
>> >
>> > I may have other issue which I'm going to investigate, but to avoid waste
>> > time I please ask you if I'm missing some detail by switching from seda:
>> to
>> > vm: (it is the first time I use vm: and I was expecting the same behavior
>> > of the seda:endpoint)
>> >
>> > I'm using Camel 2.10.6 inside Servicemix 4.5.2.
>> >
>> > Thank you very much!
>> >
>> > Cristiano
>>
>>
>>
>> --
>> 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
>>



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


Re: Error _in_adding_active mq dependencies

2013-09-05 Thread Willem Jiang
Hi,

Did you put the Fuse maven repo into your pom?
As you know, we don't publish the fuse artifact into the public maven repo.
So you can not access the fuse jar from the maven public repo


Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem


On Thu, Sep 5, 2013 at 3:29 PM, mahii.in87  wrote:

> Hi ,
>  when I try to add the active mq dependencies to an existing pom file of
> the
> type "Camel CXF Contract First" project.
> It is showing error in the tag under artifactid
> in the pom file.Please take a look in the error screen shot.
> These are the dependencies added
>
> 
>   org.apache.activemq
>   activemq-core
>   5.7.0.fuse-71-047
> 
> 
>   org.apache.activemq
>   activemq-camel
>   5.7.0.fuse-71-047
> 
> 
>
>
> 
>
> thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Error-in-adding-active-mq-dependencies-tp5738731.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Simple way to do some elementary bean operations

2013-09-05 Thread Claus Ibsen
Hi

The DSL in camel is intended to be as identical between Java and XML
as possible. In fact the XML is generated based on Java classes.

This allows people to easily transition between java and xml dsl. And
also read examples in Java and understand how to do that in XML - and
vice versa etc.

So we are a bit careful also to not bloat and expand the DSL etc. As
it should not grow too big etc. But stay in sight of its DNA of being
for routing and mediation.

Today you can add builder methods to your own RouteBuilder classes so
you can add a method to set a property on the message body from an
expression etc.

The simple language allows to call methods on the message body so you can do

simple("${body.setFoo(${header.bar})}") if you want. And you can do
that in both Java and XML etc. But there is of course no code
assistence from the editor as its just a String you type.

Where as a in java we could have more builder methods on body() so you can do

body().setProperty("foo", header("bar"))

Though what if you want to call a method on the body and pass in more arguments

body().callMethod("foo", header("bar"), true, xpath("/foo/bar"), 123)


Though all that becomes easier in Java 8 where we have lambda
expressions, and would be able to easier inline java code in the
routes without all the verboseness as today.





On Tue, Sep 3, 2013 at 8:09 PM, Dale King  wrote:
> Yeah, LIKE I SAID, I know I can break out to a bean or a processor, but
> that is such a heavyweight solution to do something so simple that really
> should be built into Camel. You have to create a class, come up with some
> meaningful name of the class, repeat that name a couple of times if using a
> Spring DSL, etc.
>
> Let's say we do it with anonymous classes in a Java DSL:
>
>   process(new Processor()
>   {
> @Override
>  public void process(Exchange exchange) throws Exception
>  {
>exchange.getIn().getBody(MyBodyType.class)
>
> .setSomeProperty(exchange.getIn().getHeader("foo", SomeType.class);
>  }
>   })
>
> Or perhaps better as a bean:
>
>   bean( new Object()
>   {
>   public void set( @Body MyBodyType body, @Header("foo") value)
>   {
>   body.setSomeProperty(value);
>   }
>   }
>
> I personally would rather replace any of those with something more like
> this in DSL:
>
>   body().set("someProperty", header("foo"))
>
> This is much more obvious what is happening when looking at the route.
>
>
>
> On Tue, Sep 3, 2013 at 1:51 PM, Claus Ibsen  wrote:
>
>> On Tue, Sep 3, 2013 at 5:51 PM, Dale King  wrote:
>> > Through simple and OGNL we have nice easy ways to read the properties of
>> > beans in the body, headers, or properties. But what I cannot find is an
>> > easy way to invoke a setter on a bean property, but perhaps I am missing
>> > something.
>> >
>> > I can certainly create a bean or processor to invoke the setter, but it
>> > seems to me that if I am forced to do it for something as simple as
>> setting
>> > a property then something is missing in Camel. I try to do as much as
>> > possible in Camel.
>> >
>> > I can certainly use another language like javascript, groovy, or el to do
>> > it, but once again bringing in a whole new language seems like overkill
>> > just to set a property.
>> >
>> > So 3 operations that i don't see an easy way to do in Camel without
>> > resorting to these heavyweight solutions are:
>> >
>> >  - Set a bean property
>> >  - More generally, you should be able to invoke any method on a bean
>> > including with parameters
>> >  - Create a new instance of a bean (possibly with parameters)
>> >
>> > Correct me if I am wrong and there is a simple way to do these.
>> >
>>
>> Well there is something called Java programming language, where you
>> can do all that ;)
>>
>> > --
>> > Dale King
>>
>>
>>
>> --
>> 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
>>
>
>
>
> --
> Dale King



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


Re: MultipleConsumer on a vm: endpoint

2013-09-05 Thread Cristiano Costantini
> Yeah multipleConsumers is not support for vm. As the consumers is not
> static shared.
>
> Hi,
is that something intentional (sharing statically the consumers had other
issues) or something, let say, a patch for is welcome?

Thank you,
Cristiano


Re: MultipleConsumer on a vm: endpoint

2013-09-05 Thread Claus Ibsen
On Thu, Sep 5, 2013 at 10:15 AM, Cristiano Costantini
 wrote:
>> Yeah multipleConsumers is not support for vm. As the consumers is not
>> static shared.
>>
>> Hi,
> is that something intentional (sharing statically the consumers had other
> issues) or something, let say, a patch for is welcome?
>
> Thank you,
> Cristiano

Yeah I think it could be doable to have them static as well on the
VmComponent. The consumer implementation is from the same camel-core
JAR which is shared, so that ought to be okay.

Yeah we love contributions
http://camel.apache.org/contributing.html


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


Re: Conceptual understanding of altering routes runtime

2013-09-05 Thread Claus Ibsen
Hi

You can just use a java bean to query the database to get the rows you want.

You can then call the bean from a Camel route, and trigger the route
using a timer etc if you want.

in your bean you can keep state and keep track of the row number
interval to fetch.

And from your bean you can use ProducerTemplate / POJO producing if
you want to use a Camel component for the database access.

http://camel.apache.org/producertemplate.html
http://camel.apache.org/pojo-messaging-example.html
http://camel.apache.org/bean

You dont have to use Camel for everything. Writing some logic in java
code is *still* encouraged and allowed :) Its what best for you to do
and maintain, understand, etc.



On Wed, Sep 4, 2013 at 6:53 PM, lassesvestergaard
 wrote:
> Hi all.
>
> This is a spinoff of a previous post:
> http://camel.465427.n5.nabble.com/Change-timer-runtime-td5738484.html
>
> I decided to start a new thread, because I think this question is of a more
> general character.
>
> First of all, I ran into a problem regarding how to update a camel route
> runtime. My concrete problem is that I can't figure out how to update a sql
> query runtime. If I, for instance, want to have a query that fetches the
> first 3000 records of a table, on the first cycle of the camel route (let's
> say I use a timer to "fire" the route). In the next cycle, I want to fetch
> from record 3001 to 6000. I simply can't get my head around this problem,
> which is extremely simple in regular java. My conclusion from this is, that
> I have some fundamental misconceptions of what Apache camel is, and therefor
> I want to use this thread to discuss runtime altering of routes.
>
> For starters: As I understand, an Exchange is a entity that only exists
> within a single cycle of a route. This means that I can't use the Exchange
> object to save variables that I can use in the next cycle of the route. This
> further means that I can't use Exchange to alter configurations of a
> component - ex. I can't use it for giving the timer component a different
> period and I can't use it for altering variables in a sql query.
>
> Besides this, it seems that you can only write your route once, and the
> first time it's run, all component configurations are set - they cannot be
> altered from within the route it self. In my specific case, I have tried to
> put java variables into my sql query (having them assigned as class scoped
> attributes). In my route I have a Processor (see referenced thread at the
> top), and in that I have altered the java attributes. This seems to work
> fine, but the sql query doesn't get updated with the new value of my java
> variable.
>
> Furthermore, I haven't been able to find any good examples, that show how to
> alter the route configurations runtime (actually the configurations of each
> component in a route).
>
> Since I can't Google the problem away, I conclude that I have issues on the
> conceptual understanding of Camel. So, could someone please clarify how to
> understand runtime alterings of routes, and it would be even better if you
> have some concrete coding examples.
>
> I have chosen to use the java DSL approach instead of Spring.
>
> Best regards
>
> Lasse Vestergaard
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Conceptual-understanding-of-altering-routes-runtime-tp5738697.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Conceptual understanding of altering routes runtime

2013-09-05 Thread Claus Ibsen
Hi

Also you dont have to use Camel routes.
Sometimes just use Camel as a client API and use ProducerTemplate /
ConsumerTemplate to use the Camel components can be fine.



On Wed, Sep 4, 2013 at 6:53 PM, lassesvestergaard
 wrote:
> Hi all.
>
> This is a spinoff of a previous post:
> http://camel.465427.n5.nabble.com/Change-timer-runtime-td5738484.html
>
> I decided to start a new thread, because I think this question is of a more
> general character.
>
> First of all, I ran into a problem regarding how to update a camel route
> runtime. My concrete problem is that I can't figure out how to update a sql
> query runtime. If I, for instance, want to have a query that fetches the
> first 3000 records of a table, on the first cycle of the camel route (let's
> say I use a timer to "fire" the route). In the next cycle, I want to fetch
> from record 3001 to 6000. I simply can't get my head around this problem,
> which is extremely simple in regular java. My conclusion from this is, that
> I have some fundamental misconceptions of what Apache camel is, and therefor
> I want to use this thread to discuss runtime altering of routes.
>
> For starters: As I understand, an Exchange is a entity that only exists
> within a single cycle of a route. This means that I can't use the Exchange
> object to save variables that I can use in the next cycle of the route. This
> further means that I can't use Exchange to alter configurations of a
> component - ex. I can't use it for giving the timer component a different
> period and I can't use it for altering variables in a sql query.
>
> Besides this, it seems that you can only write your route once, and the
> first time it's run, all component configurations are set - they cannot be
> altered from within the route it self. In my specific case, I have tried to
> put java variables into my sql query (having them assigned as class scoped
> attributes). In my route I have a Processor (see referenced thread at the
> top), and in that I have altered the java attributes. This seems to work
> fine, but the sql query doesn't get updated with the new value of my java
> variable.
>
> Furthermore, I haven't been able to find any good examples, that show how to
> alter the route configurations runtime (actually the configurations of each
> component in a route).
>
> Since I can't Google the problem away, I conclude that I have issues on the
> conceptual understanding of Camel. So, could someone please clarify how to
> understand runtime alterings of routes, and it would be even better if you
> have some concrete coding examples.
>
> I have chosen to use the java DSL approach instead of Spring.
>
> Best regards
>
> Lasse Vestergaard
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Conceptual-understanding-of-altering-routes-runtime-tp5738697.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Error _in_adding_active mq dependencies

2013-09-05 Thread mahii.in87
Hi Willem,


Thanks a lot

I am very new to camel.Could you please check the repo I added.


  release.fusesource.org
  FuseSource Release Repository
 
http://repo.fusesource.com/nexus/content/repositories/releases
  
false
  
  
true
  


  snapshot.fusesource.org
  FuseSource Snapshot Repository
 
http://repo.fusesource.com/nexus/content/repositories/snapshots
  
true
  
  
false
  


Thanks again,
mahesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/Error-in-adding-active-mq-dependencies-tp5738731p5738741.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using an Expression for the delayer in the Scala DSL

2013-09-05 Thread cflockhart
I'm using Camel 2.11.1. 
I'd looked at the 2.11 branch and it didn't look too hard to add it so I'll
have a go at a patch. However, if we want to use  a released version of
Camel, is the approach of overriding onJavaBuilder() the way to go?

thanks!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-an-Expression-for-the-delayer-in-the-Scala-DSL-tp5738729p5738742.html
Sent from the Camel - Users mailing list archive at Nabble.com.


JAX-WS and JAX-RS Webservice with Camel

2013-09-05 Thread ravishankarhassain
How to hit (give request to) an external JAX-WS and JAX-RS service and also
get the response from JAX-WS and JAX-RS service using camel ?
  
>From the documents and example, I can understand that we can create a proxy
webservice and expose that proxy webservice on the fly by giving
configuration details in the from endpoint [ i.e.,  ] 
using camel. But, is there any other way or approach to do it without using
the proxy service. Also I don't have any control over the external JAX-WS
and JAX-RS service which is exposed.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JAX-WS-and-JAX-RS-Webservice-with-Camel-tp5738743.html
Sent from the Camel - Users mailing list archive at Nabble.com.


no declaration can be found for element 'broker'.

2013-09-05 Thread mahii.in87
Hi...

Can you help me in resolving the error* ERROR | xtenderThread-12 |
ContextLoaderListener| 113 - org.springframework.osgi.extender -
1.2.1 | Application context refresh failed
(OsgiBundleXmlApplicationContext(bundle=com.outotec.mes-bw-energyconsumption-queue,
config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
35 in XML document from URL
[bundle://341.1:0/META-INF/spring/camel-route.xml] is invalid; nested
exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The
matching wildcard is strict, but no declaration can be found for element
'broker'.*

Thanks,
Mahesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/no-declaration-can-be-found-for-element-broker-tp5738752.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: no declaration can be found for element 'broker'.

2013-09-05 Thread Claus Ibsen
The xml file is invalid.

You can validate that from Eclipse or other editors which can have
such functionality.
It may be related to broker namespace not being defined.

If you dont know how to do about that, then spend time searching the
internet and learn about this.

Please spend a bit more time researching yourself before posting to
mailing list. When you do that there is 500+ ppl that get an email.
And if there is too many non Camel related mails they get a bit upset.




On Thu, Sep 5, 2013 at 1:31 PM, mahii.in87  wrote:
> Hi...
>
> Can you help me in resolving the error* ERROR | xtenderThread-12 |
> ContextLoaderListener| 113 - org.springframework.osgi.extender -
> 1.2.1 | Application context refresh failed
> (OsgiBundleXmlApplicationContext(bundle=com.outotec.mes-bw-energyconsumption-queue,
> config=osgibundle:/META-INF/spring/*.xml))
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 35 in XML document from URL
> [bundle://341.1:0/META-INF/spring/camel-route.xml] is invalid; nested
> exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The
> matching wildcard is strict, but no declaration can be found for element
> 'broker'.*
>
> Thanks,
> Mahesh
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/no-declaration-can-be-found-for-element-broker-tp5738752.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


Using HTTP and HTTPS proxies with Camel HTTP Component

2013-09-05 Thread Alex Anderson
I'm writing some test code which uses and HTTP/HTTPS proxy to mock 3rd
party webservices.

For non-camel code, I configure the proxy using the java system properties:
http.proxyHost, http.proxyPort, https.proxyHost, https.proxyPort,
http.nonProxyHosts.

These settings seem to be ignored by camel, so I have also explicitly
set the HTTP proxy in camelContext (code is groovy):

camelContext.properties['http.proxyHost'] =
System.properties['http.proxyHost']
camelContext.properties['http.proxyPort'] =
System.properties['http.proxyPort']

These settings work fine *for HTTP*.  However, I can't find
documentation for getting HTTPS working.

I've tried setting other properties on the camel context, such as
https.proxyPort, http.proxyScheme, http.proxyAuthSceme,
https.proxyScheme, https.proxyAuthScheme to no avail (although I've
seen a couple of different exceptions).

I'd be happy to document my findings, but thought I should first check:

* is this a known issue?
* has it been fixed in later version of camel? (I'm using 2.9.4)
* should I expect to be able to proxy both HTTP and HTTPS to either
different or the same ports using Camel without reconfiguring in
between requests?

Thanks for any help,

Alex


For interest, most common exception I got:

## 05 Sep 2013 13:49:32,931 ## seda.SedaConsumer Error processing
exchange. Exchange[Message: test]. Caused by: [java.io.IOException -
Stream closed]
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:151)
at java.io.BufferedInputStream.available(BufferedInputStream.java:398)
at 
org.apache.commons.httpclient.ContentLengthInputStream.available(ContentLengthInputStream.java:213)
...


Correct use of idempotentKey in the Camel file component

2013-09-05 Thread fransguelinckx
Hi,

According to the Camel documentation you can use a custom idempotentKey that
determines whether a certain file is already read with a uri-option:

This didn't seem to work for us and after a very long debugging session we
discovered the following does work:


Are we doing something wrong or does the documentation contain a mistake?

Frans



--
View this message in context: 
http://camel.465427.n5.nabble.com/Correct-use-of-idempotentKey-in-the-Camel-file-component-tp5738759.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel 2.11.1, sql component returns a LinkedCaseInsensitiveMap for evry row, not a ArrayList

2013-09-05 Thread kalber
I configured this route :
from("sql:select obj_code, prv_targa, stc_pccode, prv_prodtela, prv_modtela,
prv_tipobus from cust_positions where obj_org in ('ICT') and obj_class in
('BUS') order by prv_concessi?dataSource=#dataSource.infor&noop=true")
.process(new ExportFileConvert());

in the ExportFileConvert i recive for evry row and LinkedCaseInsensitiveMap
not how i excpected once an ArrayList of LinkedCaseInsensitiveMap;

How can configure the route to recive an ArrayList
?

NB:

Using a template with the direct component it works, here the code ;

public void configure() throws Exception {
from("direct:busmsg.select.sms_bus")
.to("sql:SELECT tipo_msg, from_unixtime(rcv_time) rcv_time,
from_unixtime(event_time) event_time, codazi, matr_bus, linea, corsa,
palina, anticipo, ritardo FROM busmsg.sms_bus_# where 
date_format(from_unixtime(event_time), '%Y-%m-%d %H') > #  and 
date_format(from_unixtime(event_time), '%Y-%m-%d %H') <= # order by
from_unixtime(rcv_time)?dataSource=#dataSource.busmsg")
.bean(new BusmsgConvert(), "convertMap2List");
}

  
ProducerTemplate template = camelWrapper.createProducerTemplate();
 List> response = (List>) template.requestBody(
"direct:busmsg.select.sms_bus",
new Object[] { processConfig.composeStartElabDate(),
processConfig.composeEndElabDate() });



-
kh
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-11-1-sql-component-returns-a-LinkedCaseInsensitiveMap-for-evry-row-not-a-ArrayList-tp5738761.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SEDA queue in Camel blocks.

2013-09-05 Thread Gaurav Sehgal
Hi Christina;
               This does not happen everytime; though it happens preodically; 
will post the thread dump once I see it.

Though; I am posting the camel routes I use in my application:

                    context.addRoutes(new RouteBuilder() {
public void configure() {
                 from("vm:interactions?concurrentConsumers=6")

.bean(interProcessing,"processInteraction")
.multicast()
.parallelProcessing()
.to("direct:index")
.to("direct:cassandra")
.to("direct:blobStore")
.end()

.bean(delTempStorage,"processTempStorage");
}
});

context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:index").threads(5).
                                        bean(indexProcessor, 
"processIndexStore");
}
});

context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:cassandra").threads(5)
                                       .bean(cassandraProcessing, 
"processCassandraStore");
}
});

context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:blobStore").threads(5)
                                        .bean(blobStoreProcessing, 
"processBlobStore");
}
});


Cheers!
Gaurav




 From: Christian Posta 
To: "users@camel.apache.org" ; Gaurav Sehgal 
 
Sent: Tuesday, September 3, 2013 7:18 PM
Subject: Re: SEDA queue in Camel blocks.
 


I've never seen something like that. What does your route look like (ie, what 
other endpoints are after the seda endpoints? how many consumers do you have 
for the seda endpoints?). 

Your best bet is to recreate this and take a thread dump. Or recreate it and 
post it as a test here.



On Tue, Sep 3, 2013 at 3:08 AM, Gaurav Sehgal  wrote:

Hi,
>    I am using Camel's implementation of SEDA queue inside JBOSS FUSE; though 
>at times the consumer does not get all the messages and when I restart the 
>camel context the messages seem to flow through. This seems like the messages 
>are blocked for some reason and the consumer is not processing them. Also; the 
>load on the queue is not very large; I tested this with payload 80 messages.
>   
>  Has anyone expreienced this issue and if so is there any configuration that 
>needs to be done to overcome this?
>
>Cheers!
>Gaurav
>


-- 
Christian Posta

http://www.christianposta.com/blog
twitter: @christianposta

Re: Camel routing issue after upgrade into active-mq 5.8

2013-09-05 Thread prabumc...@gmail.com
Hi Ceposta,

After enable debug i can see following log details.

2013-09-05 08:02:41,023 | DEBUG |
Endpoint[activemq://queue:BOA.InboundQueue] consumer received JMS message:
ActiveMQTextMessage {commandId = 24, responseRequired = true, messageId =
ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20, originalDestination =
null, originalTransactionId = null, producerId =
ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1, destination =
queue://BOA.InboundQueue, transactionId = null, expiration = 0, timestamp =
1378386161018, arrival = 0, brokerInTime = 1378386161020, brokerOutTime =
1378386161022, correlationId = null, replyTo = null, persistent = true,
type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content = null,
marshalledProperties = org.apache.activemq.util.ByteSequence@58b94e98,
dataStructure = null, redeliveryCounter = 0, size = 1539, properties =
{MESSAGE_ID=cde10e13-5e66-4dac-88bd-acc05aa091e8, PAST_EVENT_INTERVAL=0,
MEMOS_TARGET_SERVERS=PITB-MW-MSG0A01:PITB-MW-MSG0A02,
soft_EVENT_CLASS_NAME=com.soft.event.TestEvent, soft_EVENT_VERSION=1,
RESTFUL_SERVICE_URL=http://Corp-TSOpus02:5050/memos/, EXPIRY_TIME=30,
TestEventType=LogMessage, soft_EVENT_TYPE=Memos.Consumer.Test},
readOnlyProperties = true, readOnlyBody = true, droppable = false, text =
{"creationDate":"Sep 05, 2013 8:02:41 AM","na...nterval":0}
} | org.apache.camel.component.jms.EndpointMessageListener | Camel
(camelContext1) thread #0 - JmsConsumer[BOA.InboundQueue]
2013-09-05 08:02:41,024 | DEBUG | #0 - header{header(soft_EVENT_TYPE)} is
not null matches: true for: Exchange[JmsMessage[JmsMessageID:
ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20]] |
org.apache.camel.processor.ChoiceProcessor | Camel (camelContext1) thread
#0 - JmsConsumer[BOA.InboundQueue]

2013-09-05 08:02:41,025 | DEBUG | Redelivery enabled: false on error
handler:
DefaultErrorHandler[Producer[activemq://queue:Inbound.Memos.Consumer.Test]]
| org.apache.camel.processor.DefaultErrorHandler | Camel (camelContext1)
thread #0 - JmsConsumer[BOA.InboundQueue]
2013-09-05 08:02:41,025 | DEBUG | Executing callback on JMS Session: Cached
JMS Session: ActiveMQSession
{id=ID:pitb-mw-msg0a02.test.aus.soft.net-3432-1378385347963-3:1:30,started=true}
| org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate | Camel
(camelContext1) thread #0 - JmsConsumer[BOA.InboundQueue]

2013-09-05 08:02:41,026 | DEBUG | Sending JMS message to:
queue://Inbound.Memos.Consumer.Test with message: ActiveMQTextMessage
{commandId = 0, responseRequired = false, messageId = null,
originalDestination = null, originalTransactionId = null, producerId =
null, destination = null, transactionId = null, expiration = 0, timestamp =
0, arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = null,
replyTo = null, persistent = true, type = null, priority = 4, groupID =
null, groupSequence = 0, targetConsumerId = null, compressed = false,
userID = null, content = null, marshalledProperties = null, dataStructure =
null, redeliveryCounter = 0, size = 0, properties =
{MESSAGE_ID=cde10e13-5e66-4dac-88bd-acc05aa091e8, PAST_EVENT_INTERVAL=0,
MEMOS_TARGET_SERVERS=PITB-MW-MSG0A01:PITB-MW-MSG0A02,
soft_EVENT_CLASS_NAME=com.soft.event.TestEvent, soft_EVENT_VERSION=1,
breadcrumbId=ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20,
RESTFUL_SERVICE_URL=http://Corp-TSOpus02:5050/memos/, EXPIRY_TIME=30,
CamelJmsDeliveryMode=2, TestEventType=LogMessage,
soft_EVENT_TYPE=Memos.Consumer.Test}, readOnlyProperties = false,
readOnlyBody = false, droppable = false, text = {"creationDate":"Sep 05,
2013 8:02:41 AM","na...nterval":0}


*Thanks*
Prabu.N



On Thu, Sep 5, 2013 at 11:36 AM, Prabu  wrote:

> *Queue name*
>
> public static final String CONSUMER_TEST_QNAME   =
> "activemq:queue:ConsumerTestHandlerjmsMessageType=Text&preserveMessageQos=true";
>
> public static final String PRODUCER_TEST_QNAME=
> "activemq:queue:ProducerTestHandler?jmsMessageType=Text&preserveMessageQos=true";
>
> public static final String MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME  =
> "activemq:queue:Inbound.Memos.Consumer.Test";
>
> public static final String MESSAGING_TEST_PRODUCER_TYPE_SPECIFIC_QNAME  =
> "activemq:queue:Inbound.Memos.Producer.Test";
>
> Sorry,I am new to camel.So i am sure what your asking.
>
> *Thanks*
> Prabu.N
>
>
>
> On Thu, Sep 5, 2013 at 9:49 AM, ceposta [via Camel] <
> ml-node+s465427n573871...@n5.nabble.com> wrote:
>
>> Maybe a good idea to go through my previous questions closely and provide
>> answers so we can better help you:
>>
>> "What does it do?
>>
>> Does the broker dispatch messages to the client (you can see with the
>> "in-flight" metrics on the broker)?
>>
>> Can you turn up the logging and see what camel is doing? what sort of ack
>> mode are you using on the connection?"
>>
>>
>> On Wed, Sep 4, 2013 at 9:09 PM, [hidden 
>> email]
>> <[hidden email] 

Active Mq example deployment error

2013-09-05 Thread vrrajesh78
Hi,
 
 
I tried deploying camel-activemq example availabe in FUSE-IDE. I am getting
the below error.Thanks in advance
 
*Caused by: java.lang.IllegalArgumentException: Could not load property
editor: org.apache.activemq.util.BooleanEditor*
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.createPropertyEditor(XBeanNamespaceHandler.java:471)[140:org.apache.xbean.spring:3.12.0]
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.getValue(XBeanNamespaceHandler.java:446)[140:org.apache.xbean.spring:3.12.0]
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.addProperty(XBeanNamespaceHandler.java:417)[140:org.apache.xbean.spring:3.12.0]
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.addAttributeProperty(XBeanNamespaceHandler.java:406)[140:org.apache.xbean.spring:3.12.0]
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.addAttributeProperties(XBeanNamespaceHandler.java:339)[140:org.apache.xbean.spring:3.12.0]
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:227)[140:org.apache.xbean.spring:3.12.0]
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:278)[140:org.apache.xbean.spring:3.12.0]
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:156)[140:org.apache.xbean.spring:3.12.0]
at
org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)[140:org.apache.xbean.spring:3.12.0]
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1338)[105:org.springframework.beans:3.0.7.RELEASE]
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328)[105:org.springframework.beans:3.0.7.RELEASE]




--
View this message in context: 
http://camel.465427.n5.nabble.com/Active-Mq-example-deployment-error-tp5738760.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Could not load property editor: org.apache.activemq.util.BooleanEditor

2013-09-05 Thread vrrajesh78
HI,

help me in resolving this error 

* java.lang.IllegalArgumentException: Could not load property editor:
org.apache.activemq.util.BooleanEditor*

thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Could-not-load-property-editor-org-apache-activemq-util-BooleanEditor-tp5738758.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel 2.11.1, sql component returns a LinkedCaseInsensitiveMap for evry row, not a ArrayList

2013-09-05 Thread Claus Ibsen
What is the problem?

I assume you get a Map representation of the row. And a List to
contain the rows, eg List.




On Thu, Sep 5, 2013 at 2:57 PM, kalber  wrote:
> I configured this route :
> from("sql:select obj_code, prv_targa, stc_pccode, prv_prodtela, prv_modtela,
> prv_tipobus from cust_positions where obj_org in ('ICT') and obj_class in
> ('BUS') order by prv_concessi?dataSource=#dataSource.infor&noop=true")
> .process(new ExportFileConvert());
>
> in the ExportFileConvert i recive for evry row and LinkedCaseInsensitiveMap
> not how i excpected once an ArrayList of LinkedCaseInsensitiveMap;
>
> How can configure the route to recive an ArrayList
> ?
>
> NB:
>
> Using a template with the direct component it works, here the code ;
>
> public void configure() throws Exception {
> from("direct:busmsg.select.sms_bus")
> .to("sql:SELECT tipo_msg, from_unixtime(rcv_time) rcv_time,
> from_unixtime(event_time) event_time, codazi, matr_bus, linea, corsa,
> palina, anticipo, ritardo FROM busmsg.sms_bus_# where
> date_format(from_unixtime(event_time), '%Y-%m-%d %H') > #  and
> date_format(from_unixtime(event_time), '%Y-%m-%d %H') <= # order by
> from_unixtime(rcv_time)?dataSource=#dataSource.busmsg")
> .bean(new BusmsgConvert(), "convertMap2List");
> }
>
>
> ProducerTemplate template = camelWrapper.createProducerTemplate();
>  List> response = (List>) template.requestBody(
> "direct:busmsg.select.sms_bus",
> new Object[] { processConfig.composeStartElabDate(),
> processConfig.composeEndElabDate() });
>
>
>
> -
> kh
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-2-11-1-sql-component-returns-a-LinkedCaseInsensitiveMap-for-evry-row-not-a-ArrayList-tp5738761.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


Camel message router

2013-09-05 Thread luixv
We are developing an application which uses active mqueue and apache camel as
router. This application is getting .html files as input (this files are NOT
xml compliant). Depending on the prefix of the filename I have to route the
file to different process. Actually the pattern "message router"  /
 does what I am looking for. The problem is the switch works over an
xpath expression.

Then my question is: Is possible to access / apply the filename in a Xpath
expression? If yes then how? if not then how can I cope this problem?

Thanks!
v
Luix



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


Re: Correct use of idempotentKey in the Camel file component

2013-09-05 Thread Claus Ibsen
Hi

You may have some property placeholder clash with spring or something.

The doc is correct you can use ${ } or $simple{ }.



On Thu, Sep 5, 2013 at 2:29 PM, fransguelinckx
 wrote:
> Hi,
>
> According to the Camel documentation you can use a custom idempotentKey that
> determines whether a certain file is already read with a uri-option:
>
> This didn't seem to work for us and after a very long debugging session we
> discovered the following does work:
>
>
> Are we doing something wrong or does the documentation contain a mistake?
>
> Frans
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Correct-use-of-idempotentKey-in-the-Camel-file-component-tp5738759.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Camel 2.11.1, sql component returns a LinkedCaseInsensitiveMap for evry row, not a ArrayList

2013-09-05 Thread kalber
Î receive for every row of the resulset  an exchange - body with a
LinkedCaseInsensitiveMap object like this :
{OBJ_CODE=6036.1, PRV_TARGA=EL809DT, STC_PCCODE=3232.PC, PRV_PRODTELA=null,
PRV_MODTELA=530 K, PRV_TIPOBUS=null}

My question is how can a configure out the from endpoint to send me once an
ArrayList< LinkedCaseInsensitiveMap>
so that i can elaborate in my processor all records in one step.

My  problem is that i receive not one ArrayList with all
LinkedCaseInsensitiveMap but evry single row as a LinkedCaseInsensitiveMap.










-
kh
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-11-1-sql-component-returns-a-LinkedCaseInsensitiveMap-for-evry-row-not-a-ArrayList-tp5738761p5738783.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel message router

2013-09-05 Thread Christian Posta
give this a shot...


  
${header.CamelFileName} regex '^prefix.*$'

  



On Thu, Sep 5, 2013 at 8:58 AM, luixv  wrote:

> OK, thanks for your answer. How would you code this using spring xml?
>
> Luis
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-message-router-tp5738769p5738789.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Are there any Camel hack to make all the JMS component to use one and only thread?

2013-09-05 Thread gnani swami
Hi,

Camel was wonderful piece of software and using it in production for more
than a year.  Our version of Camel was 2.10.1

I recently added few additional route (and bug in buz logic too) to
interface with additional systems, all the routes are doing the similar
job. They read JMS message from an unique-end-point (MQ JMS Queue) and
invoke buzComponent (Camel component).

But recently discovered that some subtle concurrency issues inside the
buzComponent causing trouble to us. And I am looking for some sort of Camel
hack to prevent it from further damage by making all the end-point consumer
to use one and only thread.

1) As a short term solution, we like to convert all the JMS component to
use single threaded threadPool (or taskExecutor), and that new thread pool
shouldn't allow more than a thread across all the JMS end-point.  Is it
possible?  We are not worried about latency and performance for some time.

2) if there is a possibility, our camel error handlers were already
in-place, Can we assume that single thread would continue working despite
any exception configured to errorHandler. ErrorHandlers will have its own
thread.

3) I am also happy to introduce one or more route and end-point inside
camelcontex.xml, so all the buzComponent can be redirected into that new
route to make it SingleThreaded execution somehow.. are there any
suggestion to use some  camel component (We could use any hack as long as
configurable inside xml).

I am pretty sure all the above approach may be short sighted, but looking
for temporary solution which could work for few days. We are happy to
modify Camel xml, than changing code and making it complex.

I appreciate feedback.

Regards
Mohan
























...





Re: Are there any Camel hack to make all the JMS component to use one and only thread?

2013-09-05 Thread Christian Posta
So what's the underlying concurrency issue? Ordering? Can you just have a
route that multiplexes all of those incoming queues into a single queue (or
in-mem queue) and then have a route w/ only one thread that does CBR and
invoke the correct bean?


On Thu, Sep 5, 2013 at 9:02 AM, gnani swami wrote:

> Hi,
>
> Camel was wonderful piece of software and using it in production for more
> than a year.  Our version of Camel was 2.10.1
>
> I recently added few additional route (and bug in buz logic too) to
> interface with additional systems, all the routes are doing the similar
> job. They read JMS message from an unique-end-point (MQ JMS Queue) and
> invoke buzComponent (Camel component).
>
> But recently discovered that some subtle concurrency issues inside the
> buzComponent causing trouble to us. And I am looking for some sort of Camel
> hack to prevent it from further damage by making all the end-point consumer
> to use one and only thread.
>
> 1) As a short term solution, we like to convert all the JMS component to
> use single threaded threadPool (or taskExecutor), and that new thread pool
> shouldn't allow more than a thread across all the JMS end-point.  Is it
> possible?  We are not worried about latency and performance for some time.
>
> 2) if there is a possibility, our camel error handlers were already
> in-place, Can we assume that single thread would continue working despite
> any exception configured to errorHandler. ErrorHandlers will have its own
> thread.
>
> 3) I am also happy to introduce one or more route and end-point inside
> camelcontex.xml, so all the buzComponent can be redirected into that new
> route to make it SingleThreaded execution somehow.. are there any
> suggestion to use some  camel component (We could use any hack as long as
> configurable inside xml).
>
> I am pretty sure all the above approach may be short sighted, but looking
> for temporary solution which could work for few days. We are happy to
> modify Camel xml, than changing code and making it complex.
>
> I appreciate feedback.
>
> Regards
> Mohan
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> 
> 
> 
> ...
> 
> 
> 
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Web based camel route automation

2013-09-05 Thread Gnanaguru S

Hello,

I have two file endpoints, I need to route the files using camel routes. 

I have a web UI where I will provide the two file endpoints detail, One I
submit the details It has to create a camel context file. 

1. I am able to achieve this using route builder, but this is in-memory.
When the JVM crashes, I have to re-run the program. Is there any solution
which keep the camel context even when the JVM gets restarted ?

2. It would be helpful, if I can create routes dynamically in spring dsl. 

Any thoughts ?

Thanks
Guru
gnanaguru.com



--
View this message in context: 
http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Active Mq example deployment error

2013-09-05 Thread Gnanaguru S
 Post the complete stack trace. Then only we can help.

Thanks
Guru
gnanaguru.com



--
View this message in context: 
http://camel.465427.n5.nabble.com/Active-Mq-example-deployment-error-tp5738760p5738798.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel routing issue after upgrade into active-mq 5.8

2013-09-05 Thread prabumc...@gmail.com
Pls help me...

*Thanks*
Prabu.N


On Thu, Sep 5, 2013 at 6:41 PM, Prabu  wrote:

> Hi Ceposta,
>
> After enable debug i can see following log details.
>
> 2013-09-05 08:02:41,023 | DEBUG |
> Endpoint[activemq://queue:BOA.InboundQueue] consumer received JMS message:
> ActiveMQTextMessage {commandId = 24, responseRequired = true, messageId =
> ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20, originalDestination =
> null, originalTransactionId = null, producerId =
> ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1, destination =
> queue://BOA.InboundQueue, transactionId = null, expiration = 0, timestamp =
> 1378386161018, arrival = 0, brokerInTime = 1378386161020, brokerOutTime =
> 1378386161022, correlationId = null, replyTo = null, persistent = true,
> type = null, priority = 4, groupID = null, groupSequence = 0,
> targetConsumerId = null, compressed = false, userID = null, content = null,
> marshalledProperties = org.apache.activemq.util.ByteSequence@58b94e98,
> dataStructure = null, redeliveryCounter = 0, size = 1539, properties =
> {MESSAGE_ID=cde10e13-5e66-4dac-88bd-acc05aa091e8, PAST_EVENT_INTERVAL=0,
> MEMOS_TARGET_SERVERS=PITB-MW-MSG0A01:PITB-MW-MSG0A02,
> soft_EVENT_CLASS_NAME=com.soft.event.TestEvent, soft_EVENT_VERSION=1,
> RESTFUL_SERVICE_URL=http://Corp-TSOpus02:5050/memos/, EXPIRY_TIME=30,
> TestEventType=LogMessage, soft_EVENT_TYPE=Memos.Consumer.Test},
> readOnlyProperties = true, readOnlyBody = true, droppable = false, text =
> {"creationDate":"Sep 05, 2013 8:02:41 AM","na...nterval":0}
> } | org.apache.camel.component.jms.EndpointMessageListener | Camel
> (camelContext1) thread #0 - JmsConsumer[BOA.InboundQueue]
> 2013-09-05 08:02:41,024 | DEBUG | #0 - header{header(soft_EVENT_TYPE)} is
> not null matches: true for: Exchange[JmsMessage[JmsMessageID:
> ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20]] |
> org.apache.camel.processor.ChoiceProcessor | Camel (camelContext1) thread
> #0 - JmsConsumer[BOA.InboundQueue]
>
> 2013-09-05 08:02:41,025 | DEBUG | Redelivery enabled: false on error
> handler:
> DefaultErrorHandler[Producer[activemq://queue:Inbound.Memos.Consumer.Test]]
> | org.apache.camel.processor.DefaultErrorHandler | Camel (camelContext1)
> thread #0 - JmsConsumer[BOA.InboundQueue]
> 2013-09-05 08:02:41,025 | DEBUG | Executing callback on JMS Session:
> Cached JMS Session: ActiveMQSession
> {id=ID:pitb-mw-msg0a02.test.aus.soft.net-3432-1378385347963-3:1:30,started=true}
> | org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate | Camel
> (camelContext1) thread #0 - JmsConsumer[BOA.InboundQueue]
>
> 2013-09-05 08:02:41,026 | DEBUG | Sending JMS message to:
> queue://Inbound.Memos.Consumer.Test with message: ActiveMQTextMessage
> {commandId = 0, responseRequired = false, messageId = null,
> originalDestination = null, originalTransactionId = null, producerId =
> null, destination = null, transactionId = null, expiration = 0, timestamp =
> 0, arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = null,
> replyTo = null, persistent = true, type = null, priority = 4, groupID =
> null, groupSequence = 0, targetConsumerId = null, compressed = false,
> userID = null, content = null, marshalledProperties = null, dataStructure =
> null, redeliveryCounter = 0, size = 0, properties =
> {MESSAGE_ID=cde10e13-5e66-4dac-88bd-acc05aa091e8, PAST_EVENT_INTERVAL=0,
> MEMOS_TARGET_SERVERS=PITB-MW-MSG0A01:PITB-MW-MSG0A02,
> soft_EVENT_CLASS_NAME=com.soft.event.TestEvent, soft_EVENT_VERSION=1,
> breadcrumbId=ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20,
> RESTFUL_SERVICE_URL=http://Corp-TSOpus02:5050/memos/, EXPIRY_TIME=30,
> CamelJmsDeliveryMode=2, TestEventType=LogMessage,
> soft_EVENT_TYPE=Memos.Consumer.Test}, readOnlyProperties = false,
> readOnlyBody = false, droppable = false, text = {"creationDate":"Sep 05,
> 2013 8:02:41 AM","na...nterval":0}
>
>
> *Thanks*
> Prabu.N
>
>
>
> On Thu, Sep 5, 2013 at 11:36 AM, Prabu  wrote:
>
>> *Queue name*
>>
>> public static final String CONSUMER_TEST_QNAME   =
>> "activemq:queue:ConsumerTestHandlerjmsMessageType=Text&preserveMessageQos=true";
>>
>> public static final String PRODUCER_TEST_QNAME=
>> "activemq:queue:ProducerTestHandler?jmsMessageType=Text&preserveMessageQos=true";
>>
>> public static final String MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME  =
>> "activemq:queue:Inbound.Memos.Consumer.Test";
>>
>> public static final String MESSAGING_TEST_PRODUCER_TYPE_SPECIFIC_QNAME  =
>> "activemq:queue:Inbound.Memos.Producer.Test";
>>
>> Sorry,I am new to camel.So i am sure what your asking.
>>
>> *Thanks*
>> Prabu.N
>>
>>
>>
>> On Thu, Sep 5, 2013 at 9:49 AM, ceposta [via Camel] <
>> ml-node+s465427n573871...@n5.nabble.com> wrote:
>>
>>> Maybe a good idea to go through my previous questions closely and
>>> provide
>>> answers so we can better help you:
>>>
>>> "What does it do?
>>>
>>> Does the broker dispatch messages to the client (you can see with the
>>> "in-flight" metrics on the broker)?
>>>
>>> Can you turn up the logging 

Re: Active Mq example deployment error

2013-09-05 Thread Christian Posta
Seems to be some kind of classpath issue and a dependency cannot be found.


On Thu, Sep 5, 2013 at 5:46 AM, vrrajesh78  wrote:

> Hi,
>
>
> I tried deploying camel-activemq example availabe in FUSE-IDE. I am getting
> the below error.Thanks in advance
>
> *Caused by: java.lang.IllegalArgumentException: Could not load property
> editor: org.apache.activemq.util.BooleanEditor*
> at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.createPropertyEditor(XBeanNamespaceHandler.java:471)[140:org.apache.xbean.spring:3.12.0]
> at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.getValue(XBeanNamespaceHandler.java:446)[140:org.apache.xbean.spring:3.12.0]
> at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.addProperty(XBeanNamespaceHandler.java:417)[140:org.apache.xbean.spring:3.12.0]
> at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.addAttributeProperty(XBeanNamespaceHandler.java:406)[140:org.apache.xbean.spring:3.12.0]
> at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.addAttributeProperties(XBeanNamespaceHandler.java:339)[140:org.apache.xbean.spring:3.12.0]
> at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:227)[140:org.apache.xbean.spring:3.12.0]
> at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:278)[140:org.apache.xbean.spring:3.12.0]
> at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:156)[140:org.apache.xbean.spring:3.12.0]
> at
>
> org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)[140:org.apache.xbean.spring:3.12.0]
> at
>
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1338)[105:org.springframework.beans:3.0.7.RELEASE]
> at
>
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328)[105:org.springframework.beans:3.0.7.RELEASE]
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Active-Mq-example-deployment-error-tp5738760.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Re: Camel message router

2013-09-05 Thread Christian Posta
Well, it doesn't have to be an xpath expression.
It can be any of the supported expression language options:
http://camel.apache.org/expression.html

For example, when processing files off the file system, the filename would
be added to the exchange message as a header, and you can do your
content-based routing off the header:

choice()

 .when(header("CamelFileName").startsWith("filePrefix")).rest-of-route-here



On Thu, Sep 5, 2013 at 6:43 AM, luixv  wrote:

> We are developing an application which uses active mqueue and apache camel
> as
> router. This application is getting .html files as input (this files are
> NOT
> xml compliant). Depending on the prefix of the filename I have to route the
> file to different process. Actually the pattern "message router"  /
>  does what I am looking for. The problem is the switch works over an
> xpath expression.
>
> Then my question is: Is possible to access / apply the filename in a Xpath
> expression? If yes then how? if not then how can I cope this problem?
>
> Thanks!
> v
> Luix
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-message-router-tp5738769.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Re: Web based camel route automation

2013-09-05 Thread Charles Moulliard
Guru,

A CamelContext is a java object which is not persisted or replicated
between different JVM. So this is not possible to achieve what you would
like to do. The question here is not the CamelContext or RouteBuilder
object but what you transport (= files). They must be persisted (using
ActiveMQ, RDBMS, NoSQL, ...) to avoid to loose if JVM crashes.

Regards,

Charles


On Thu, Sep 5, 2013 at 7:16 PM, Gnanaguru S  wrote:

>
> Hello,
>
> I have two file endpoints, I need to route the files using camel routes.
>
> I have a web UI where I will provide the two file endpoints detail, One I
> submit the details It has to create a camel context file.
>
> 1. I am able to achieve this using route builder, but this is in-memory.
> When the JVM crashes, I have to re-run the program. Is there any solution
> which keep the camel context even when the JVM gets restarted ?
>
> 2. It would be helpful, if I can create routes dynamically in spring dsl.
>
> Any thoughts ?
>
> Thanks
> Guru
> gnanaguru.com
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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


Re: File renaming problems under Windows

2013-09-05 Thread bocamel
I ran into a similar problem.  My use case is slightly different and I am
using Camel 2.11.1 and JDK 1.7.  But the result is that Camel cannot delete
the file from the input folder and keeps processing it indefinitely.

I have two routes.  The first route reads in XML files from a directory then
puts them on SEDA. The second route retrieves the files from SEDA and sends
them to a web services (CXF).  

  
 
 
 

and 

  
 
 
 
java.lang.Exception

true


  
  

Everything works fine until a non-XML file (bad.xml) is thrown into the
xmlInput folder.  The CXF endpoint throws the following exception.  When
this happens, route1 cannot delete the bad.xml file from the xmlInput. 
Camel keeps picking it up and the same error repeats indefinitely.

org.apache.camel.InvalidPayloadException: No body available of type:
org.apache.camel.component.cxf.CxfPayload but has value:
GenericFile[M:\bad.xml] of type: org.apache.camel.component.file.GenericFile
on: null. Caused by: Error during type conversion from type:
org.apache.camel.component.file.GenericFile to the required type:
org.apache.camel.component.cxf.CxfPayload with value GenericFile[M:\bad.xml]
due org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 2; Content
is not allowed in prolog.. Exchange[null]. Caused by:
[org.apache.camel.TypeConversionException - Error during type conversion
from type: org.apache.camel.component.file.GenericFile to the required type:
org.apache.camel.component.cxf.CxfPayload with value GenericFile[M:\bad.xml]
due org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 2; Content
is not allowed in prolog.]

It is followed by the file deletion error:

2013-09-05 13:01:53,469 [ssCustomerInput] WARN  GenericFileOnCompletion   
- Caused by:
[org.apache.camel.component.file.GenericFileOperationFailedException - Error
renaming file from M:\bad.xml to M:\.camel\bad.xml]
org.apache.camel.component.file.GenericFileOperationFailedException: Error
renaming file from M:\bad.xml to M:\.camel\bad.xml
at
org.apache.camel.component.file.FileOperations.renameFile(FileOperations.java:72)
at
org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:113)
at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:88)
at
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:144)
at
org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:82)
at
org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:53)
at
org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:55)
at 
org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:226)
at
org.apache.camel.processor.UnitOfWorkProcessor.doneUow(UnitOfWorkProcessor.java:199)
at
org.apache.camel.processor.UnitOfWorkProcessor.access$000(UnitOfWorkProcessor.java:37)
at
org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:157)
at
org.apache.camel.processor.RouteContextProcessor$1.done(RouteContextProcessor.java:56)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:106)
at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at
org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:294)
at
org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:203)
at 
org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:150)
at java.ut

Traverse FTP tree

2013-09-05 Thread Tom.Fornoville
Hi everyone,

On our ftp server we have a home directory for every customer where they can
put their files, it look something like this:

ftp-root
  -- 001
  -- 20130905.xml
  -- feedback
  -- feedback_20130903.xml
  -- feedback_20130904.xml
  -- 002
  -- 20130905.xml
  -- feedback
  -- feedback_20130901.xml
...

Every hour we need to:

 1) go into every customer directory (001, 002, ...) and check for files
while skipping subdirectories like the feedback subdirectories in the
structure above

 2) rename the file: 20130905.xml for customer 001 should become
001_20130905.xml and so on

 3) delete the original file from the ftp (I think this can be done by
specifying delete=true)

If someone can put us on the right track for configuring the neccessary
routes and endpoints it would be appreciated.

Cheers,
Tom



--
View this message in context: 
http://camel.465427.n5.nabble.com/Traverse-FTP-tree-tp5738803.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel routing issue after upgrade into active-mq 5.8

2013-09-05 Thread prabumc...@gmail.com
I am using camel 2.10.3 version
On Sep 5, 2013 10:22 PM, "Prabu"  wrote:

> Pls help me...
>
> *Thanks*
> Prabu.N
>
>
> On Thu, Sep 5, 2013 at 6:41 PM, Prabu  wrote:
>
>> Hi Ceposta,
>>
>> After enable debug i can see following log details.
>>
>> 2013-09-05 08:02:41,023 | DEBUG |
>> Endpoint[activemq://queue:BOA.InboundQueue] consumer received JMS message:
>> ActiveMQTextMessage {commandId = 24, responseRequired = true, messageId =
>> ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20, originalDestination =
>> null, originalTransactionId = null, producerId =
>> ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1, destination =
>> queue://BOA.InboundQueue, transactionId = null, expiration = 0, timestamp =
>> 1378386161018, arrival = 0, brokerInTime = 1378386161020, brokerOutTime =
>> 1378386161022, correlationId = null, replyTo = null, persistent = true,
>> type = null, priority = 4, groupID = null, groupSequence = 0,
>> targetConsumerId = null, compressed = false, userID = null, content = null,
>> marshalledProperties = org.apache.activemq.util.ByteSequence@58b94e98,
>> dataStructure = null, redeliveryCounter = 0, size = 1539, properties =
>> {MESSAGE_ID=cde10e13-5e66-4dac-88bd-acc05aa091e8, PAST_EVENT_INTERVAL=0,
>> MEMOS_TARGET_SERVERS=PITB-MW-MSG0A01:PITB-MW-MSG0A02,
>> soft_EVENT_CLASS_NAME=com.soft.event.TestEvent, soft_EVENT_VERSION=1,
>> RESTFUL_SERVICE_URL=http://Corp-TSOpus02:5050/memos/,
>> EXPIRY_TIME=30, TestEventType=LogMessage,
>> soft_EVENT_TYPE=Memos.Consumer.Test}, readOnlyProperties = true,
>> readOnlyBody = true, droppable = false, text = {"creationDate":"Sep 05,
>> 2013 8:02:41 AM","na...nterval":0}
>> } | org.apache.camel.component.jms.EndpointMessageListener | Camel
>> (camelContext1) thread #0 - JmsConsumer[BOA.InboundQueue]
>> 2013-09-05 08:02:41,024 | DEBUG | #0 - header{header(soft_EVENT_TYPE)} is
>> not null matches: true for: Exchange[JmsMessage[JmsMessageID:
>> ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20]] |
>> org.apache.camel.processor.ChoiceProcessor | Camel (camelContext1) thread
>> #0 - JmsConsumer[BOA.InboundQueue]
>>
>> 2013-09-05 08:02:41,025 | DEBUG | Redelivery enabled: false on error
>> handler:
>> DefaultErrorHandler[Producer[activemq://queue:Inbound.Memos.Consumer.Test]]
>> | org.apache.camel.processor.DefaultErrorHandler | Camel (camelContext1)
>> thread #0 - JmsConsumer[BOA.InboundQueue]
>> 2013-09-05 08:02:41,025 | DEBUG | Executing callback on JMS Session:
>> Cached JMS Session: ActiveMQSession
>> {id=ID:pitb-mw-msg0a02.test.aus.soft.net-3432-1378385347963-3:1:30,started=true}
>> | org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate | Camel
>> (camelContext1) thread #0 - JmsConsumer[BOA.InboundQueue]
>>
>> 2013-09-05 08:02:41,026 | DEBUG | Sending JMS message to:
>> queue://Inbound.Memos.Consumer.Test with message: ActiveMQTextMessage
>> {commandId = 0, responseRequired = false, messageId = null,
>> originalDestination = null, originalTransactionId = null, producerId =
>> null, destination = null, transactionId = null, expiration = 0, timestamp =
>> 0, arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = null,
>> replyTo = null, persistent = true, type = null, priority = 4, groupID =
>> null, groupSequence = 0, targetConsumerId = null, compressed = false,
>> userID = null, content = null, marshalledProperties = null, dataStructure =
>> null, redeliveryCounter = 0, size = 0, properties =
>> {MESSAGE_ID=cde10e13-5e66-4dac-88bd-acc05aa091e8, PAST_EVENT_INTERVAL=0,
>> MEMOS_TARGET_SERVERS=PITB-MW-MSG0A01:PITB-MW-MSG0A02,
>> soft_EVENT_CLASS_NAME=com.soft.event.TestEvent, soft_EVENT_VERSION=1,
>> breadcrumbId=ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20,
>> RESTFUL_SERVICE_URL=http://Corp-TSOpus02:5050/memos/,
>> EXPIRY_TIME=30, CamelJmsDeliveryMode=2, TestEventType=LogMessage,
>> soft_EVENT_TYPE=Memos.Consumer.Test}, readOnlyProperties = false,
>> readOnlyBody = false, droppable = false, text = {"creationDate":"Sep 05,
>> 2013 8:02:41 AM","na...nterval":0}
>>
>>
>> *Thanks*
>> Prabu.N
>>
>>
>>
>> On Thu, Sep 5, 2013 at 11:36 AM, Prabu  wrote:
>>
>>> *Queue name*
>>>
>>> public static final String CONSUMER_TEST_QNAME   =
>>> "activemq:queue:ConsumerTestHandlerjmsMessageType=Text&preserveMessageQos=true";
>>>
>>> public static final String PRODUCER_TEST_QNAME=
>>> "activemq:queue:ProducerTestHandler?jmsMessageType=Text&preserveMessageQos=true";
>>>
>>> public static final String MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME
>>>  = "activemq:queue:Inbound.Memos.Consumer.Test";
>>>
>>> public static final String MESSAGING_TEST_PRODUCER_TYPE_SPECIFIC_QNAME
>>>  = "activemq:queue:Inbound.Memos.Producer.Test";
>>>
>>> Sorry,I am new to camel.So i am sure what your asking.
>>>
>>> *Thanks*
>>> Prabu.N
>>>
>>>
>>>
>>> On Thu, Sep 5, 2013 at 9:49 AM, ceposta [via Camel] <
>>> ml-node+s465427n573871...@n5.nabble.com> wrote:
>>>
 Maybe a good idea to go through my previous questions closely and
 provide
 answers so we can better hel

Re: Camel message router

2013-09-05 Thread luixv
OK, thanks for your answer. How would you code this using spring xml?

Luis 



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


Re: HTTP endpoint

2013-09-05 Thread sacauskis
Thanks for the reply.  This is what the code ultimately looked like:

public class CamelHTTP {

public static void main(String args[]) throws Exception {
// create CamelContext
final CamelContext context = new DefaultCamelContext();


// add our route to the CamelContext
context.addRoutes(new RouteBuilder() {
public void configure() {


from("direct:start")
.setHeader(Exchange.CONTENT_TYPE,
constant("application/x-www-form-urlencoded"))  

.setHeader(Exchange.HTTP_METHOD,constant("POST"))
.setHeader("If-Modified-Since", constant(" Tue, 
4 Sep 2013 18:10:00
GMT"))

.setBody(constant("mbl-stmt=(synloader(bounding-box 90 -180 -90
180)(report-type BBXX)(products(SYN)))"))

.to("https://weather.severl/metcast/cgi-bin/mcsrvr/server?authMethod=Basic&authUsername=fusername&authPassword=password";)
.to("file:data");
}
});

// start the route and let it do its work
context.start();
ProducerTemplate template = context.createProducerTemplate();
template.sendBody("direct:start","");

context.setTracing(false);
Thread.sleep(9);

// stop the CamelContext
context.stop();
}
}



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


Re: Are there any Camel hack to make all the JMS component to use one and only thread?

2013-09-05 Thread gnani swami
Some of the messages where handled by wrong service and they are all queued
in FailedErrorMessages directory. Application failed to process them. So it
will end up in ordering, and lost message.  Looking at our various
exception it is quite easy for us to understand that they are caused by
concurrency bug inside the buz logic.

We like to move the  to new route
under some endpoint (in-mem-queue). Quick google doesn't return anything
related to multiplex, could you point me sample route?  Can I create that
multiplex in the new route under new endpoint.

Thanks



On Fri, Sep 6, 2013 at 12:35 AM, Christian Posta
wrote:

> So what's the underlying concurrency issue? Ordering? Can you just have a
> route that multiplexes all of those incoming queues into a single queue (or
> in-mem queue) and then have a route w/ only one thread that does CBR and
> invoke the correct bean?
>
>
> On Thu, Sep 5, 2013 at 9:02 AM, gnani swami  >wrote:
>
> > Hi,
> >
> > Camel was wonderful piece of software and using it in production for more
> > than a year.  Our version of Camel was 2.10.1
> >
> > I recently added few additional route (and bug in buz logic too) to
> > interface with additional systems, all the routes are doing the similar
> > job. They read JMS message from an unique-end-point (MQ JMS Queue) and
> > invoke buzComponent (Camel component).
> >
> > But recently discovered that some subtle concurrency issues inside the
> > buzComponent causing trouble to us. And I am looking for some sort of
> Camel
> > hack to prevent it from further damage by making all the end-point
> consumer
> > to use one and only thread.
> >
> > 1) As a short term solution, we like to convert all the JMS component to
> > use single threaded threadPool (or taskExecutor), and that new thread
> pool
> > shouldn't allow more than a thread across all the JMS end-point.  Is it
> > possible?  We are not worried about latency and performance for some
> time.
> >
> > 2) if there is a possibility, our camel error handlers were already
> > in-place, Can we assume that single thread would continue working despite
> > any exception configured to errorHandler. ErrorHandlers will have its own
> > thread.
> >
> > 3) I am also happy to introduce one or more route and end-point inside
> > camelcontex.xml, so all the buzComponent can be redirected into that new
> > route to make it SingleThreaded execution somehow.. are there any
> > suggestion to use some  camel component (We could use any hack as long as
> > configurable inside xml).
> >
> > I am pretty sure all the above approach may be short sighted, but looking
> > for temporary solution which could work for few days. We are happy to
> > modify Camel xml, than changing code and making it complex.
> >
> > I appreciate feedback.
> >
> > Regards
> > Mohan
> >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > 
> > 
> > 
> > ...
> > 
> > 
> > 
> >
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta
>


Re: Camel message router

2013-09-05 Thread Raul Kripalani
You can use the in:header() XPath function provided by Camel to access an
IN message header.

For example:

contains(in:header('CamelFileName'), 'foo')

Or combine it with any other XPath function like starts-with, matches, etc.

The Camel XPath documentation page describes this function and others. And
it also explains how to enable Saxon if you need XPath 2.0 functions.

Regards,
Raúl.
On 5 Sep 2013 14:44, "luixv"  wrote:

> We are developing an application which uses active mqueue and apache camel
> as
> router. This application is getting .html files as input (this files are
> NOT
> xml compliant). Depending on the prefix of the filename I have to route the
> file to different process. Actually the pattern "message router"  /
>  does what I am looking for. The problem is the switch works over an
> xpath expression.
>
> Then my question is: Is possible to access / apply the filename in a Xpath
> expression? If yes then how? if not then how can I cope this problem?
>
> Thanks!
> v
> Luix
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-message-router-tp5738769.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Could not load property editor: org.apache.activemq.util.BooleanEditor

2013-09-05 Thread Christian Müller
How should we do this?
Please start here: http://camel.apache.org/support.html

Best,
Christian
Am 05.09.2013 15:27 schrieb "vrrajesh78" :

> HI,
>
> help me in resolving this error
>
> * java.lang.IllegalArgumentException: Could not load property editor:
> org.apache.activemq.util.BooleanEditor*
>
> thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Could-not-load-property-editor-org-apache-activemq-util-BooleanEditor-tp5738758.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: SEDA queue in Camel blocks.

2013-09-05 Thread Raul Kripalani
Is it possible that one of your beans is blocking for some reason, and all
of your 6 concurrent consumers become occupied waiting at the blocking
point?

When you restart your context, do you see any log statements about inflight
exchanges?

Regards,
Raúl.
On 5 Sep 2013 13:59, "Gaurav Sehgal"  wrote:

> Hi Christina;
>This does not happen everytime; though it happens
> preodically; will post the thread dump once I see it.
>
> Though; I am posting the camel routes I use in my application:
>
> context.addRoutes(new RouteBuilder() {
> public void configure() {
>  from("vm:interactions?concurrentConsumers=6")
>
> .bean(interProcessing,"processInteraction")
> .multicast()
> .parallelProcessing()
> .to("direct:index")
> .to("direct:cassandra")
> .to("direct:blobStore")
> .end()
>
> .bean(delTempStorage,"processTempStorage");
> }
> });
>
> context.addRoutes(new RouteBuilder() {
> public void configure() {
> from("direct:index").threads(5).
> bean(indexProcessor,
> "processIndexStore");
> }
> });
>
> context.addRoutes(new RouteBuilder() {
> public void configure() {
> from("direct:cassandra").threads(5)
>.bean(cassandraProcessing,
> "processCassandraStore");
> }
> });
>
> context.addRoutes(new RouteBuilder() {
> public void configure() {
> from("direct:blobStore").threads(5)
> .bean(blobStoreProcessing,
> "processBlobStore");
> }
> });
>
>
> Cheers!
> Gaurav
>
>
>
> 
>  From: Christian Posta 
> To: "users@camel.apache.org" ; Gaurav Sehgal <
> gaurav_seh...@yahoo.com>
> Sent: Tuesday, September 3, 2013 7:18 PM
> Subject: Re: SEDA queue in Camel blocks.
>
>
>
> I've never seen something like that. What does your route look like (ie,
> what other endpoints are after the seda endpoints? how many consumers do
> you have for the seda endpoints?).
>
> Your best bet is to recreate this and take a thread dump. Or recreate it
> and post it as a test here.
>
>
>
> On Tue, Sep 3, 2013 at 3:08 AM, Gaurav Sehgal 
> wrote:
>
> Hi,
> >I am using Camel's implementation of SEDA queue inside JBOSS FUSE;
> though at times the consumer does not get all the messages and when I
> restart the camel context the messages seem to flow through. This seems
> like the messages are blocked for some reason and the consumer is not
> processing them. Also; the load on the queue is not very large; I tested
> this with payload 80 messages.
> >
> >  Has anyone expreienced this issue and if so is there any configuration
> that needs to be done to overcome this?
> >
> >Cheers!
> >Gaurav
> >
>
>
> --
> Christian Posta
>
> http://www.christianposta.com/blog
> twitter: @christianposta


CxfProducer cache problem on Camel

2013-09-05 Thread liugang594 Liu
Hi All:

I found the CxfProducer object will be cached to reuse in Camel, however
this may can's suatable for any time, to make things simple, assume we have
below route:

class CustomDefaultCxfBinding extends DefaultCxfBinding {
private String a;
public CustomDefaultCxfBinding(String a) {
this.a = a;
setHeaderFilterStrategy(new CxfHeaderFilterStrategy());
}

@Override
public void populateCxfRequestFromExchange(org.apache.cxf.message.Exchange
cxfExchange,
Exchange camelExchange, Map requestContext) {
System.out.println(a);
super.populateCxfRequestFromExchange(cxfExchange,camelExchange,
requestContext);
}
}

String url = "...";
CxfEndpoint cxfEndpoint1 = (CxfEndpoint) endpoint(url);
cxfEndpoint1.setCxfBinding(new CustomDefaultCxfBinding("a1"));
 CxfEndpoint cxfEndpoint2 = (CxfEndpoint) endpoint(url);
cxfEndpoint2.setCxfBinding(new CustomDefaultCxfBinding("a2"));

from("timer:foo?repeatCount=1") .setBody(constant(content)).to(cxfEndpoint1)
.setBody(constant(content)).to(cxfEndpoint2);


both "a1" and "a2" are expected to be printed, but only "a2" for now.

Does anybody knows how to handle this situation?
Thanks alot


-- 
Thanks
GangLiu
Mail: clevers...@gmail.com


Set CxfEndpoint Property Dynamicly

2013-09-05 Thread liugang594 Liu
Hi All:

I'd like to know how can I set the properties of CxfEndpoint dynamicly, for
example use simple expression to calculate and set the property value
during running.

Thanks alot


Thanks
GangLiu
Mail: clevers...@gmail.com


HL7 Mina throwing org.apache.mina.filter.codec.ProtocolDecoderException: org.apache.mina.common.BufferDataException

2013-09-05 Thread Dayakar Reddy
Hi,

I am new to Camel-HL7 component. It seems like you implemented this
component. can you please share me the sample code base/ your project code?
In my case , I need to convert the java object to HL7 format and then send
those messages to an endpoint.

Thanks,,,


Re: Active Mq example deployment error

2013-09-05 Thread mahii.in87
hi..

could you guide me in solving the class path issue.

thanks,
mahesh




--
View this message in context: 
http://camel.465427.n5.nabble.com/Active-Mq-example-deployment-error-tp5738760p5738792.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel2.11.0 threads

2013-09-05 Thread risen
I'm new in camel. 
threadPool: 


camel-route: 






when the "update" method runs in 2s,the eight threads can run every 2s. 
but when anyone of the threads run over 2s,others will wait until the thread
is over. 
How can i make the threads work every 2s whether anyone is working or not. 
Thank you so much!



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel2-11-0-threads-tp5738811.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Securing Inbound WebService Endpoint

2013-09-05 Thread contactreji
Can I secure my inbound cxf:enpoint with

*http://example.com/}HelloWorldServicePort.http-conduit";
   xmlns:sec="http://cxf.apache.org/configuration/security";
   xmlns="http://cxf.apache.org/transports/http/configuration";>
   
  myuser
  mypasswd
  Basic
   
 *

My Endpoint looks like 
*
http://server:8181/mes/bw/MyFuseEndpointAddress";
serviceClass="company.pi.mes.id56.interface.PortDetails"
wsdlURL="wsdl/myWsdl.wsdl"
serviceName="p1:SI_ID56_MyFuseEndpointServiceAddress"
endpointName="p1:HTTPS_Port"
xmlns:p1="urn:company:pi:mes:id56:WSDLNamespace"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; />*

Could  you please help me with this simple basic authentication. 

I am really in need of the same.. and its quite urgent :-(



--
View this message in context: 
http://camel.465427.n5.nabble.com/Securing-Inbound-WebService-Endpoint-tp5738816.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: HL7 Mina throwing org.apache.mina.filter.codec.ProtocolDecoderException: org.apache.mina.common.BufferDataException

2013-09-05 Thread Claus Ibsen
Hi

A good idea could be too see the unit tests of camel-hl7 which can be
of inspiration.

On Thu, Sep 5, 2013 at 10:00 PM, Dayakar Reddy
 wrote:
> Hi,
>
> I am new to Camel-HL7 component. It seems like you implemented this
> component. can you please share me the sample code base/ your project code?
> In my case , I need to convert the java object to HL7 format and then send
> those messages to an endpoint.
>
> Thanks,,,



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


Re: Set CxfEndpoint Property Dynamicly

2013-09-05 Thread Claus Ibsen
Hi

What do you mean can you explain in more details?


On Fri, Sep 6, 2013 at 6:18 AM, liugang594 Liu  wrote:
> Hi All:
>
> I'd like to know how can I set the properties of CxfEndpoint dynamicly, for
> example use simple expression to calculate and set the property value
> during running.
>
> Thanks alot
>
>
> Thanks
> GangLiu
> Mail: clevers...@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


Re: CxfProducer cache problem on Camel

2013-09-05 Thread Claus Ibsen
Hi

The url is the same in the endpoint(url) so you get the same instance.
And then afterwards you set the custom cxf binding. You need 2
different urls, so its 2 different endpoint instances. Or you can
crate the cxf endpoints using java code, with the new constructor.

On Fri, Sep 6, 2013 at 5:36 AM, liugang594 Liu  wrote:
> Hi All:
>
> I found the CxfProducer object will be cached to reuse in Camel, however
> this may can's suatable for any time, to make things simple, assume we have
> below route:
>
> class CustomDefaultCxfBinding extends DefaultCxfBinding {
> private String a;
> public CustomDefaultCxfBinding(String a) {
> this.a = a;
> setHeaderFilterStrategy(new CxfHeaderFilterStrategy());
> }
>
> @Override
> public void populateCxfRequestFromExchange(org.apache.cxf.message.Exchange
> cxfExchange,
> Exchange camelExchange, Map requestContext) {
> System.out.println(a);
> super.populateCxfRequestFromExchange(cxfExchange,camelExchange,
> requestContext);
> }
> }
>
> String url = "...";
> CxfEndpoint cxfEndpoint1 = (CxfEndpoint) endpoint(url);
> cxfEndpoint1.setCxfBinding(new CustomDefaultCxfBinding("a1"));
>  CxfEndpoint cxfEndpoint2 = (CxfEndpoint) endpoint(url);
> cxfEndpoint2.setCxfBinding(new CustomDefaultCxfBinding("a2"));
>
> from("timer:foo?repeatCount=1") .setBody(constant(content)).to(cxfEndpoint1)
> .setBody(constant(content)).to(cxfEndpoint2);
>
>
> both "a1" and "a2" are expected to be printed, but only "a2" for now.
>
> Does anybody knows how to handle this situation?
> Thanks alot
>
>
> --
> Thanks
> GangLiu
> Mail: clevers...@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


Re: camel2.11.0 threads

2013-09-05 Thread Claus Ibsen
Hi

Camel 2.12 should allow to do this. So just try to upgrade to use it
when its out.

As the timer supports the async routing engine from 2.12 onwards
http://camel.apache.org/asynchronous-routing-engine.html

For earlier releases you can send to a seda queue first

from timer
  to seda

from seda
  to bean



On Fri, Sep 6, 2013 at 4:02 AM, risen  wrote:
> I'm new in camel.
> threadPool:
>  threadName="pcSend" maxPoolSize="8" maxQueueSize="1024"
> keepAliveTime="0" />
>
> camel-route:
> 
> 
> 
> 
> 
> 
> when the "update" method runs in 2s,the eight threads can run every 2s.
> but when anyone of the threads run over 2s,others will wait until the thread
> is over.
> How can i make the threads work every 2s whether anyone is working or not.
> Thank you so much!
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel2-11-0-threads-tp5738811.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