Re: websocket with jetty 9

2015-05-14 Thread Amit
I did try websocket component with jetty 9 and Apache Camel 2.15.2 and i got
same exception due to  SslContextFactory  class 
moved in jetty 9 to  org.eclipse.jetty.util.ssl.folder and Apache  websocket
reference to  org.eclipse.jetty.http.ssl.SslContextFactory  that is only
exit in Jetty 8 and below version. 


java.lang.ClassNotFoundException 
 org.eclipse.jetty.http.ssl.SslContextFactory



--
View this message in context: 
http://camel.465427.n5.nabble.com/websocket-with-jetty-9-tp5766712p5767118.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: websocket with jetty 9

2015-05-14 Thread Amit
I did try websocket component with jetty 9 and Apache Camel 2.15.2 and i got
same exception due to  SslContextFactory  class 
moved in jetty 9 to  org.eclipse.jetty.util.ssl.folder and Apache  websocket
reference to  org.eclipse.jetty.http.ssl.SslContextFactory  that is only
exit in Jetty 8 and below version. 


java.lang.ClassNotFoundException 
 org.eclipse.jetty.http.ssl.SslContextFactory



--
View this message in context: 
http://camel.465427.n5.nabble.com/websocket-with-jetty-9-tp5766712p5767115.html
Sent from the Camel - Users mailing list archive at Nabble.com.


spring-ws component 2.15.2

2015-05-14 Thread Nick Bryan
Hi,
Trying to use spring-ws as a web service client and set up the following very 
simple route based on the component doc

public void configure() {

String dataRequest = ns1:GetWeather 
xmlns:ns1='http://www.webservicex.com' +
  ns1:CityNameLondon/ns1:CityName +
  ns1:CountryNameEngland/ns1:CountryName +
/ns1:GetWeather;

ProducerTemplate template = getContext().createProducerTemplate();

from(direct:example)
.to(spring-ws:http://www.webservicex.com/globalweather.asmx;);

template.requestBody(direct:example, dataRequest);
}

When I run it I'm getting the error -  No consumers available on endpoint: 
Endpoint[direct://example]

Any pointers as to what I'm doing wrong?
Thanks
Nick


Re: websocket with jetty 9

2015-05-14 Thread Amit
I did try websocket component with jetty 2.15.2 and i got same exception due
to  SslContextFactory  class
moved in jetty 9 to  org.eclipse.jetty.util.ssl.folder and Apache  websocket
reference to  org.eclipse.jetty.http.ssl.SslContextFactory  that is only
exit in Jetty 8 and below version.


java.lang.ClassNotFoundException
 org.eclipse.jetty.http.ssl.SslContextFactory 



--
View this message in context: 
http://camel.465427.n5.nabble.com/websocket-with-jetty-9-tp5766712p5767114.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JSON to XML Mapping/Transformation

2015-05-14 Thread erd
Hello,

I had a similar situation. From my google-fu, it seems like Unmarshalling
with jackson is your best bet. The 'nesting' is a bit of a curveball. I
found explicitly binding the POJO is the easiest for uniform keys- I think
your POJO structure should look something like

public class myJson{
@JsonProperty(Format)
String format;
@JsonProperty(TestData)
TestData testData;

 class TestData{
 @JsonProperty(Key with Spaces in it)
  KeyWithSpacesInIt keyWspaces;
  //setters 
  }
 ...
 //setters
 //default constructor
}
just define an object for each 'layer'.
I hope that answers it. I'm not terribly familiar with Xstream, however.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JSON-to-XML-Mapping-Transformation-tp5767112p5767116.html
Sent from the Camel - Users mailing list archive at Nabble.com.


High Availability and No Down Time Deployments

2015-05-14 Thread Ryan Moquin
Hi,

I had a question I was hoping that someone could help me with, make
suggestions or give me an example of how they handle this.  I'm currently
using Camel running in Karaf and it's working really well.

I'm trying to develop a strategy for being able to hot update production
environments with no downtime.  I was thinking the safest way would be to
simply deploy new versions to each running Karaf instance and leave the old
one running.  For the camel rest interfaces, I'll insert a version into the
URL so that other deployed services won't be interrupted and can be
upgraded to point to the new REST interface when ready.  I am stuck on one
part though.  We have some camel routes listening to SQS queues.  I'm not
sure the best way to force only the latest version of those camel routes to
listen to the SQS queue.  Also, the new versions of the camel routes will
conflict with the camel routes that were previously deployed right?  Or do
the new camel routes need to have a version in their names as well?  It
there a strategy anyone uses for having different versions of the same
camel route running in an environment at the same time to achieve
deployment updates without any downtime?

I know we could just destroy an environment and redeploy it, but then the
servers that are updated will be on the new version and some running the
old which I was told we can't have.  It also makes coordination with other
servers a little more complicated since you'd have to upgrade half the
camel routes upgrade other services to use the new versioned URLs and then
upgrade the second half.

Does anyone have any thoughts on how this might be achieved in a sensical
way without being over complicated?

Thanks!
Ryan


Re: 2.15.1 -FailedToCreateRouteException : DataSource must be configured

2015-05-14 Thread yogu13
try renaming bean id sqlCDM to sql

Regards,
-Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/2-15-1-FailedToCreateRouteException-DataSource-must-be-configured-tp5766999p5767109.html
Sent from the Camel - Users mailing list archive at Nabble.com.


JSON to XML Mapping/Transformation

2015-05-14 Thread Gnanaguru S
How is JSON to XML mapping is generally done in Camel ?

We have xmljson component, but it doesn't do some classic json use cases. 

In my case I have incoming JSON payload which has all kind of possible
symbols supported by a String which includes white spaces as well. 

I can use JACKSON to convert JSON to POJOs, then from POJOs I can convert to
XML straight away using XSTREAM. But again this xml is again going to be
tough to handle, because its all going to be maps and entries. 

My incoming JSON looks like this:

{ 
  Format: JSON, 
  TestData: { 
Key with Spaces in it: { 
  And Again: { 
ChildKey1: Financial, 
ChildKey2: null 
  }, 
. 
. 

Any thoughts / suggestions ? I would love to hear some ideas which is
Camelish :)

Regards
Guru
@tallguru



--
View this message in context: 
http://camel.465427.n5.nabble.com/JSON-to-XML-Mapping-Transformation-tp5767112.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: InOut MEP

2015-05-14 Thread akoufoudakis
Hello, Henryk!
Thanks for the hint.
It is a good workaround.
I myself would do something similar: simple pipes and filters or a
content-based router.

I just wanted to see how InOut works in theory.

So, what I did, I just continued experimenting with routes, and tried the
following:
public void configure() {
from(jms:incomingOrders)
.inOut(jms:validate).log(${body});

from(jms:validate)
.bean(ValidatorBean.class);
}


After log EIP is executed, I can see the Valid output. 
If I change it to:
from(jms:incomingOrders)
.inOut(jms:validate).to(jms:queue:smth);

from(jms:validate)
.bean(ValidatorBean.class);
I can see the Valid in the  smth queue. Most probably, I missed
something, when I was testing it yesterday...



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


ElasticSearch- Best practice for indexing entire JSON Files?

2015-05-14 Thread erd
Hello, 

What is the best way to index an entire JSON file? Say i have a file called
widgets.json with structure

{widgets: {
{name:foo,properties:{status:green, type: fooWidget}}, 
{name: ayy, properties:{status:lmao}}
}
}

I am currently using a splitter, but the actual file is quite large, and
makes thousands of messages to send to the server. Is there a way where I
could just send the file or string, and ES will use the default analyzer to
split it?



--
View this message in context: 
http://camel.465427.n5.nabble.com/ElasticSearch-Best-practice-for-indexing-entire-JSON-Files-tp5767123.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to get subject and body for mail from a properties file

2015-05-14 Thread Mukundha Reddy
route id=ActionProcessor:direct:email
from uri=direct:email/
setHeader headerName=subject
   
simple${property.some.processor.consumer.camel.email.subject}/simple
/setHeader
setHeader headerName=contentType
constanttext/plain;charset=UTF-8/constant
/setHeader
setBody
   
simple${property.some.processor.consumer.camel.email.body}/simple
/setBody
to ref=uri/
/route



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-get-subject-and-body-for-mail-from-a-properties-file-tp5767080p5767129.html
Sent from the Camel - Users mailing list archive at Nabble.com.


rapid consumption of ActiveMQ messages

2015-05-14 Thread mayur_bm
i am sending appx 1000 messages/sec in to ActiveMQ queue, via Camel Route.
Camel Context is as follows:

beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:camel=http://camel.apache.org/schema/spring;
   xsi:schemaLocation=
 http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
 http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd 
 http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd;


camelContext id=MsgServlet xmlns=http://camel.apache.org/schema/spring;


 route id=ConfigComponent
 from uri=timer:foo?period=25s/
 to
uri=http://10.53.138.245:8080/demo/DemoServlet?component=1/


 to uri=bean:InitConfig?method=process/

/route


route id=servletToProcessor
from uri=jetty:http://10.53.138.100:10666/mytestservice/
  unmarshal
json library=Jackson/
/unmarshal
to uri=bean:MsgProcessor?method=process/
 to uri=activemq:queue:inbox pattern=InOnly/
/route

 route id=inToOutRoute
  from uri=activemq:queue:inbox/
  to uri=bean:ESPProcessor?method=process/
 /route



/camelContext

bean id=InitConfig class=org.sap.camel.iot.example.InitConfig
/bean


bean id=MsgProcessor class=org.sap.camel.iot.example.MsgProcessor
/bean

  bean id=ESPProcessor
class=org.sap.camel.iot.example.ESPProcessor
/bean

  bean id=MMSProcessor
class=org.sap.camel.iot.example.MMSProcessor
/bean

broker id=broker brokerName=myBroker useShutdownHook=false
useJmx=true
   persistent=true dataDirectory=activemq-data
   xmlns=http://activemq.apache.org/schema/core;

transportConnectors

transportConnector name=vm uri=vm://myBroker/

transportConnector name=tcp uri=tcp://0.0.0.0:61616/
/transportConnectors

destinationPolicy
policyMap
  policyEntries
policyEntry queue=inbox  maxPageSize=1000 memoryLimit=100MB
queuePrefetch=2000/
/policyEntries
/policyMap
  /destinationPolicy

/broker




bean class=org.apache.activemq.camel.component.ActiveMQComponent
id=amq
  property name=connectionFactory ref=pooledCF /

/bean

bean class=org.apache.activemq.pool.PooledConnectionFactory
destroy-method=stop id=pooledCF init-method=start
  property name=connectionFactory ref=AMQCF /
  property name=maxConnections value=2 /
/bean

bean class=org.apache.activemq.ActiveMQConnectionFactory id=AMQCF
  property name=brokerURL
value=vm://myBroker?create=falseamp;waitForStart=5000/
property name=userName value=karaf/
property name=password value=karaf/
property name=copyMessageOnSend value=true /
property name=useAsyncSend value=true /

property name=prefetchPolicy.queuePrefetch value=2000/
/bean

/beans

issue i am facing is, its taking lot of time to empty the queue. what
configuration changes i need to do to clean up the queue at earliest?

Regards,
Mayur



--
View this message in context: 
http://camel.465427.n5.nabble.com/rapid-consumption-of-ActiveMQ-messages-tp5767100.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JSON To XML Converter

2015-05-14 Thread Gnanaguru S
Hi Raul, 

This is a pretty useful component but it does work if the JSON keys has
whitespaces in it. :(

Regards
Guru



--
View this message in context: 
http://camel.465427.n5.nabble.com/JSON-To-XML-Converter-tp5714624p5767088.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Handle white space - JSON to XML using XMLJSON component

2015-05-14 Thread Gnanaguru S
Well, I understand your point. But any valid string is a valid JSON key. 

We cant blame the JSON payload at this point :(

So any ideas ? Or best way to handle these kind of scenarios ?

Cheers
Guru



--
View this message in context: 
http://camel.465427.n5.nabble.com/Handle-white-space-JSON-to-XML-using-XMLJSON-component-tp5767042p5767084.html
Sent from the Camel - Users mailing list archive at Nabble.com.


how to get subject and body for mail from a properties file

2015-05-14 Thread gmh
Hi,
I am using Camel mail to send an email when something happens in a rabbitmq
queue.
I have all of my properties in a properties file.
I have the propertyplaceholder defined before camel context:

  context:property-placeholder ignore-resource-not-found=true
location=classpath:xxx

Below is my route:
route id=ActionProcessor:direct:email
from uri=direct:email/
setHeader headerName=subject
constantHello/constant
/setHeader
setHeader headerName=contentType
constanttext/plain;charset=UTF-8/constant
/setHeader
setBody
constantTest/constant
/setBody
to ref=uri/
/route
The question is how do I read the values from the below properties and
populate the body and subject?

some.processor.consumer.camel.email.body=Test
some.processor.consumer.camel.email.subject=Hello
Thanks,
Gordon



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-get-subject-and-body-for-mail-from-a-properties-file-tp5767080.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: QueueReplyManager - reply received for unknown correlationID

2015-05-14 Thread Henrique Viecili
Hi Claus,

In this scenario, what would happen with the second message? Especially
when the route uses a Shared Reply queue.

Regards,
Henrique Viecili

Henrique Viecili

On 13 May 2015 at 04:31, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 If you get duplicate reply messages then it smells like the other
 party is sending 2 reply messages with the same JMSCorrelationID.

 On Mon, May 11, 2015 at 10:11 AM, MS matija.slivo...@gmail.com wrote:
   These are some of the dependencies:
 mvn dependencies:list
 
  org.apache.activemq:activemq-broker:jar:5.11.1:compile
  org.apache.activemq:activemq-camel:jar:5.6.0:compile
  org.apache.activemq:activemq-client:jar:5.11.1:compile
  org.apache.activemq:activemq-core:jar:5.6.0:compile
  org.apache.activemq:activemq-kahadb-store:jar:5.11.1:compile
  org.apache.activemq:activemq-openwire-legacy:jar:5.11.1:compile
  org.apache.activemq:activemq-pool:jar:5.6.0:compile
  org.apache.activemq:activemq-spring:jar:5.11.1:compile
  org.apache.activemq:kahadb:jar:5.6.0:compile
  org.apache.activemq.protobuf:activemq-protobuf:jar:1.1:compile
  org.apache.camel:camel-core:jar:2.15.2:compile
  org.apache.camel:camel-cxf:jar:2.15.2:compile
  org.apache.camel:camel-cxf-transport:jar:2.15.2:compile
  org.apache.camel:camel-http:jar:2.15.2:compile
  org.apache.camel:camel-jaxb:jar:2.15.2:compile
  org.apache.camel:camel-jetty:jar:2.15.2:compile
  org.apache.camel:camel-jetty-common:jar:2.15.2:compile
  org.apache.camel:camel-jetty8:jar:2.15.2:compile
  org.apache.camel:camel-jms:jar:2.15.2:compile
  org.apache.camel:camel-spring:jar:2.15.2:compile
  org.apache.camel:camel-test:jar:2.15.2:compile
  org.apache.camel:camel-test-spring:jar:2.15.2:test
  org.apache.cxf:cxf-core:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-bindings-soap:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-bindings-xml:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-features-clustering:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-frontend-simple:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-rs-client:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-rs-security-oauth:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-transports-http:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-transports-http-jetty:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-transports-jms:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-ws-addr:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-ws-policy:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-wsdl:jar:3.0.1:compile
 
  I'm using external ActiveMQ instance version 5.11.1.
 
  Yes. this WARN is for every message sent to WS endpoint.
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/QueueReplyManager-reply-received-for-unknown-correlationID-tp5766856p5766955.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: Handle white space - JSON to XML using XMLJSON component

2015-05-14 Thread Pontus Ullgren
The xmljson component is using json-lib[1] to do the actual work. Check the
documentation for that project or put a question in there forum if there is
some configuration that can be set to properly handle whitespaces.

[1] http://json-lib.sourceforge.net/

On Thu, 14 May 2015 08:48 Gnanaguru S gnanagu...@gmail.com wrote:

 Well, I understand your point. But any valid string is a valid JSON key.

 We cant blame the JSON payload at this point :(

 So any ideas ? Or best way to handle these kind of scenarios ?

 Cheers
 Guru



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Handle-white-space-JSON-to-XML-using-XMLJSON-component-tp5767042p5767084.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: QueueReplyManager - reply received for unknown correlationID

2015-05-14 Thread Claus Ibsen
If the correlation id do not match then the incoming message is dropped.

On Thu, May 14, 2015 at 9:28 AM, Henrique Viecili viec...@gmail.com wrote:
 Hi Claus,

 In this scenario, what would happen with the second message? Especially
 when the route uses a Shared Reply queue.

 Regards,
 Henrique Viecili

 Henrique Viecili

 On 13 May 2015 at 04:31, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 If you get duplicate reply messages then it smells like the other
 party is sending 2 reply messages with the same JMSCorrelationID.

 On Mon, May 11, 2015 at 10:11 AM, MS matija.slivo...@gmail.com wrote:
   These are some of the dependencies:
 mvn dependencies:list
 
  org.apache.activemq:activemq-broker:jar:5.11.1:compile
  org.apache.activemq:activemq-camel:jar:5.6.0:compile
  org.apache.activemq:activemq-client:jar:5.11.1:compile
  org.apache.activemq:activemq-core:jar:5.6.0:compile
  org.apache.activemq:activemq-kahadb-store:jar:5.11.1:compile
  org.apache.activemq:activemq-openwire-legacy:jar:5.11.1:compile
  org.apache.activemq:activemq-pool:jar:5.6.0:compile
  org.apache.activemq:activemq-spring:jar:5.11.1:compile
  org.apache.activemq:kahadb:jar:5.6.0:compile
  org.apache.activemq.protobuf:activemq-protobuf:jar:1.1:compile
  org.apache.camel:camel-core:jar:2.15.2:compile
  org.apache.camel:camel-cxf:jar:2.15.2:compile
  org.apache.camel:camel-cxf-transport:jar:2.15.2:compile
  org.apache.camel:camel-http:jar:2.15.2:compile
  org.apache.camel:camel-jaxb:jar:2.15.2:compile
  org.apache.camel:camel-jetty:jar:2.15.2:compile
  org.apache.camel:camel-jetty-common:jar:2.15.2:compile
  org.apache.camel:camel-jetty8:jar:2.15.2:compile
  org.apache.camel:camel-jms:jar:2.15.2:compile
  org.apache.camel:camel-spring:jar:2.15.2:compile
  org.apache.camel:camel-test:jar:2.15.2:compile
  org.apache.camel:camel-test-spring:jar:2.15.2:test
  org.apache.cxf:cxf-core:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-bindings-soap:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-bindings-xml:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-features-clustering:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-frontend-simple:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-rs-client:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-rs-security-oauth:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-transports-http:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-transports-http-jetty:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-transports-jms:jar:3.0.1:compile
  org.apache.cxf:cxf-rt-ws-addr:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-ws-policy:jar:3.0.4:compile
  org.apache.cxf:cxf-rt-wsdl:jar:3.0.1:compile
 
  I'm using external ActiveMQ instance version 5.11.1.
 
  Yes. this WARN is for every message sent to WS endpoint.
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/QueueReplyManager-reply-received-for-unknown-correlationID-tp5766856p5766955.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/




-- 
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: how to get subject and body for mail from a properties file

2015-05-14 Thread Claus Ibsen
Hi

You can use the properties-location function from simple to lookup a properties
http://camel.apache.org/simple

If you are using and older Camel then the function is named
properties. But its all explained on that simple docs.




On Wed, May 13, 2015 at 9:58 PM, gmh gordon...@gmail.com wrote:
 Hi,
 I am using Camel mail to send an email when something happens in a rabbitmq
 queue.
 I have all of my properties in a properties file.
 I have the propertyplaceholder defined before camel context:

   context:property-placeholder ignore-resource-not-found=true
 location=classpath:xxx

 Below is my route:
 route id=ActionProcessor:direct:email
 from uri=direct:email/
 setHeader headerName=subject
 constantHello/constant
 /setHeader
 setHeader headerName=contentType
 constanttext/plain;charset=UTF-8/constant
 /setHeader
 setBody
 constantTest/constant
 /setBody
 to ref=uri/
 /route
 The question is how do I read the values from the below properties and
 populate the body and subject?

 some.processor.consumer.camel.email.body=Test
 some.processor.consumer.camel.email.subject=Hello
 Thanks,
 Gordon



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/how-to-get-subject-and-body-for-mail-from-a-properties-file-tp5767080.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: how to get subject and body for mail from a properties file

2015-05-14 Thread akoufoudakis
Hello, Gordon!

I would do it like this.


camelContext
propertyPlaceholder id=emailProps location=classpath:xxx/
route id=ActionProcessor:direct:email
from uri=direct:email/
setHeader headerName=subject
   
constant{{some.processor.consumer.camel.email.subject}}/constant
/setHeader
setHeader headerName=contentType
constanttext/plain;charset=UTF-8/constant
/setHeader
setBody
   
constant{{some.processor.consumer.camel.email.body}}/constant
/setBody
to ref=uri/
/route
/camelContext

If you want to keep your property file visible in your whole spring context,
then I would do a trick like:

 context:property-placeholder ignore-resource-not-found=true
location=classpath:xxx id=props/
   propertyPlaceholder id=myProps location=ref:props/
   ..
camelContext


/camelContext


For more information you can always go to
http://camel.apache.org/properties.html




--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-get-subject-and-body-for-mail-from-a-properties-file-tp5767080p5767095.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: InOut MEP

2015-05-14 Thread Henryk Konsek
Hi,

Set the validation results on the message header instead of the out message
body. For example:

  exchange.getIn().setHeader(VALIDATION_STATUS, Valid);

Cheers!

czw., 14.05.2015 o 00:06 użytkownik Anton Hughes kurren...@gmail.com
napisał:

 Please take a look at http://camel.apache.org/content-based-router.html

 I think this will help.

 On Wed, May 13, 2015 at 9:57 PM, akoufoudakis akoufoudaki...@gmail.com
 wrote:

  Dear all!
 
  I am sure that this questions has been already asked. Apologies that you
  have to look at it again.
 
  I have a very trivial route, which uses InOut MEP:
 
  @Component
  public class InOutRouter extends RouteBuilder {
 
  public void configure() {
  from(jms:incomingOrders)
  .inOut(jms:validate);
 
  from(jms:validate)
  .bean(ValidatorBean.class);
  }
 
  }
 
  The bean is also very trivial:
  public class ValidatorBean {
 
  private static Logger logger =
  Logger.getLogger(ValidatorBean.class);
 
  public void validateSmth(Exchange exchange) {
  logger.info(bean invoked!!!);
  String body = exchange.getIn().getBody(String.class);
  if(body.contains(SOMETHING)) {
  exchange.getOut().setBody(Valid);
  } else {
  exchange.getOut().setBody(Invalid);
  }
  }
 
  }
 
  The bean is invoked and I can see the logging output.
  I can also see that the route works. The number of enqueued/dequeued
  messages grows in both incomingOrders and validate queues.
 
  However, I cannot see any kind of output after the bean execution is
 over.
 
  Please, help me to find out what I am doing wrong or recommend what
 should
  I
  do to process the reply (i.e., how and where can process the
  Valid/Invalid
  bodies).
 
  Thank you in advance.
 
 
 
  --
  View this message in context:
  http://camel.465427.n5.nabble.com/InOut-MEP-tp5767079.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 



Re: rapid consumption of ActiveMQ messages

2015-05-14 Thread akoufoudakis
If you want to speed up, you can use concurrentConsumers option.
http://camel.apache.org/competing-consumers.html.



--
View this message in context: 
http://camel.465427.n5.nabble.com/rapid-consumption-of-ActiveMQ-messages-tp5767100p5767102.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Spring versions in camel features file for Karaf

2015-05-14 Thread Charlie Mordant
Hi,

As what I saw, camel-spring manifests are also excluding spring 4.x. In
addition spring-dm does not support spr 4.x...

Regards,

2015-05-13 16:57 GMT+02:00 Svend-Ole Nielsen svend-ole.niel...@vehco.com:

 Hi

 I have installed a plain vanilla Karaf version 2.4 with Camel 2.15.
 According to the release notes Camel 2.15 supports Spring version 4+ which
 also appears to be the version that Karaf is using. According to the
 feature for example camel-spring the version 4 is excluded. See the snippet
 below.

 feature name=camel-spring version=2.15.2 resolver=(obr)
 start-level=50
bundle
 dependency=truemvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1/bundle
feature version=[3.2,4)spring/feature
feature version=[1.2,2)spring-dm/feature
feature version=[3.2,4)spring-tx/feature
feature version=2.15.2camel-core/feature
bundlemvn:org.apache.camel/camel-spring/2.15.2/bundle
 /feature

 According to the pom of camel-spring it is dependent on version 4+ of
 Spring, so I'm a bit confused. So my question is if I am missing something,
 a bug or something different  ??

 Anyway - the Karaf is installing 2 versions of Spring and is unable to
 deploy a xml-spring file due to namespace mismatch.

 Any help would be greatly appreciated

 /Svend




-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent