Re: Camel JMS message topic handling

2014-10-21 Thread ddewaele
Interesting we had a similar issue with the MQTT endpoint

http://camel.465427.n5.nabble.com/Camel-Endpoint-Consumer-startup-td5757635.html

There the endpoint was also started (causing TCP connections to be
established) before any consumers became active (resulting in loss of
messages).

I'll try to debug this further today



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


Re: Camel JMS message topic handling

2014-10-21 Thread Minh Tran
I found this similar behaviour as well. 

http://mail-archives.apache.org/mod_mbox/camel-users/201404.mbox/%3cf54f1c39-dd8a-4c17-a51d-c564f3230...@winning.com.au%3E

Appears as though the topic subscription is not guaranteed to happen before the 
camel context finishes starting up. So if the message is published before the 
subscription occurs, the message gets sent to nobody as per usual topic 
subscription rules.

The unit test in camel puts in a thread sleep to get around the problem but IMO 
adding a sleep to get around race conditions are a poor solution. 

// give a bit of time for AMQ to properly setup topic subscribers
Thread.sleep(500);

I’m unsure if it’s a camel or an AMQ bug but I think the topic subscription 
should be guaranteed before the camel context has started up.



On 21 Oct 2014, at 9:16 pm, ddewaele  wrote:

> We were testing ActiveMQ topics with Camel and noticed the following
> behaviour:
> 
> - Our Camel route was up and running with an activemq topic consumer.
> - Messages were published on the topic whle the route is active.
> - our Camel JMS consumer that was listening on that topic didn't receive all
> messages.
> 
> We were not using Durable JMS topics or ActiveMQ Virtual Topics but I did
> find it strange that it would drop messages here.
> 
> I assume these JMS Consumers are connected to the JMS broker while messages
> are put on the topic and that all messages would be properly processed. Yet
> we noticed a lot of drops.
> 
> When using ActiveMQ virtual topics we don't experience this issue and the
> Camel route is always able to process all messages.
> 
> I was just wondering why this doesn't work with a plain vanilla topic and an
> active Camel route.
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-JMS-message-topic-handling-tp5757853.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel JMS message topic handling

2014-10-21 Thread ddewaele
We're using the Camel ActiveMQ endpoint
(http://camel.apache.org/activemq.html) and have setup a consumer in our
route via the following URI : *activemq:topic:TopicName*.







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


Webdav

2014-10-21 Thread apostle
Hi there,I need to create a webdav proxying route. I found no better solution
but  extend an HTTP4 component to support Webdav specific operations. My
questions are:1. If camel somehow supports webdav?2. If there is no support,
if there is better solution than extending the HTTP4 component?3. Could it
be a good idea to include Webdav support into HTTP4 component? I can prepare
a patch for this. Actually regardless adding support for webdav it would be
nice to be able to extend standard HTTP with custom requests which is (if I
am not mistaken) not quite possible now. Thank you in advance.Pavel



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

Re: Camel JMS message topic handling

2014-10-21 Thread Charles Moulliard
Hi,

We have different unit tests within the Apache Camel project using a Topic
and they work perfectly
Which component do you use (camel-activemq, camel-jms or camel-sjms) ?

Examples :
-
https://github.com/apache/camel/blob/master/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteWithInOnlyTest.java
-
https://github.com/apache/camel/blob/master/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameTopicTest.java

Regards,


On Tue, Oct 21, 2014 at 12:16 PM, ddewaele  wrote:

> We were testing ActiveMQ topics with Camel and noticed the following
> behaviour:
>
> - Our Camel route was up and running with an activemq topic consumer.
> - Messages were published on the topic whle the route is active.
> - our Camel JMS consumer that was listening on that topic didn't receive
> all
> messages.
>
> We were not using Durable JMS topics or ActiveMQ Virtual Topics but I did
> find it strange that it would drop messages here.
>
> I assume these JMS Consumers are connected to the JMS broker while messages
> are put on the topic and that all messages would be properly processed. Yet
> we noticed a lot of drops.
>
> When using ActiveMQ virtual topics we don't experience this issue and the
> Camel route is always able to process all messages.
>
> I was just wondering why this doesn't work with a plain vanilla topic and
> an
> active Camel route.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JMS-message-topic-handling-tp5757853.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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


Camel JMS message topic handling

2014-10-21 Thread ddewaele
We were testing ActiveMQ topics with Camel and noticed the following
behaviour:

- Our Camel route was up and running with an activemq topic consumer.
- Messages were published on the topic whle the route is active.
- our Camel JMS consumer that was listening on that topic didn't receive all
messages.

We were not using Durable JMS topics or ActiveMQ Virtual Topics but I did
find it strange that it would drop messages here.

I assume these JMS Consumers are connected to the JMS broker while messages
are put on the topic and that all messages would be properly processed. Yet
we noticed a lot of drops.

When using ActiveMQ virtual topics we don't experience this issue and the
Camel route is always able to process all messages.

I was just wondering why this doesn't work with a plain vanilla topic and an
active Camel route.



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


Re: Camel Splitter EIP

2014-10-21 Thread Charles Moulliard
xtokenize is only available since Apache Camel 2.14 as described in the
documentation.

On Tue, Oct 21, 2014 at 12:06 PM, contactreji  wrote:

> Hi Charles
>
> I also found something called xtokenize on
> http://camel.apache.org/splitter.html documentation page.
>
> Can you suggest how this can be used to my use case?
>
> Reji
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Splitter-EIP-tp5757844p5757851.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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


Re: Camel Splitter EIP

2014-10-21 Thread contactreji
Hi Charles

I also found something called xtokenize on
http://camel.apache.org/splitter.html documentation page.

Can you suggest how this can be used to my use case?

Reji



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


Re: Camel Splitter EIP

2014-10-21 Thread contactreji
Thanks Charles


My camel xml file looks like 
*



http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:camel="http://camel.apache.org/schema/spring";
xmlns:jaxws="http://cxf.apache.org/jaxws";
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration";
xmlns:http="http://cxf.apache.org/transports/http/configuration";
xmlns:ctx="http://www.springframework.org/schema/context";
xmlns:cxf="http://camel.apache.org/schema/cxf";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:osgi="http://www.springframework.org/schema/osgi";
xmlns:sec="http://cxf.apache.org/configuration/security";

xsi:schemaLocation="
 http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
 http://camel.apache.org/schema/cxf 
 http://camel.apache.org/schema/cxf/camel-cxf.xsd
 http://cxf.apache.org/jaxws 
http://cxf.apache.org/schemas/jaxws.xsd 
 http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
 http://camel.apache.org/schema/spring 
 http://camel.apache.org/schema/spring/camel-spring-2.10.7.xsd
 http://cxf.apache.org/configuration/security
http://cxf.apache.org/schemas/configuration/security.xsd
 http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
 http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
  http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
 ">


http://camel.apache.org/schema/spring";>



ns:SyncPersonnel/ns:DataArea/ns:Personnel








*


It gives me a new set or errors as 

*Caused by: org.xml.sax.SAXParseException; lineNumber: 29; columnNumber: 16;
cvc-complex-type.2.4.a: Invalid content was found starting with element
'camelContext'. One of
'{"http://www.springframework.org/schema/beans":description,
"http://www.springframework.org/schema/beans":import,
"http://www.springframework.org/schema/beans":alias,
"http://www.springframework.org/schema/beans":bean,
WC[##other:"http://www.springframework.org/schema/beans"]}' is expected.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)*

Can u suggest if there is some version mismatches to be checked? Is the mode
attribute really usable in camel 2.10.x versions?



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


Re: REST DSL setup - Failed because of multiple consumers

2014-10-21 Thread David S
Great, It is working when using 2.14.1-SNAPSHOT.

Thanks :-)



--
View this message in context: 
http://camel.465427.n5.nabble.com/REST-DSL-setup-Failed-because-of-multiple-consumers-tp5757805p5757849.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Splitter EIP

2014-10-21 Thread Charles Moulliard
Hi,

The error reported tells you that you can't use the `mode` attribute within
the  tag. Here is the schema definition (
http://camel.apache.org/schema/spring/camel-spring-2.10.7.xsd). You will
simply your life if you use autocompletion for the XML within your IDE
studio (Eclipse, ...).

Regards,

On Tue, Oct 21, 2014 at 11:15 AM, contactreji  wrote:

> Hi Charles
>
>
> Thanks for you input.
>
> I have change to token.  But i get errors as
>
> *Caused by: org.xml.sax.SAXParseException; lineNumber: 50; columnNumber:
> 24;
> cvc-complex-type.3.2.2: Attribute 'mode' is not allowed to appear in
> element
> 'tokenize'.
> at
>
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
> at
>
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
> at
>
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)*
>
> Looks like xtokenise is available from Camel 2.14.
>
> I am using camel 2.10.xx version. Is there a way to achieve the use case
> with this version? or rather with  ?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Splitter-EIP-tp5757844p5757847.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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


Re: Camel Splitter EIP

2014-10-21 Thread contactreji
Hi Charles


Thanks for you input.

I have change to token.  But i get errors as 

*Caused by: org.xml.sax.SAXParseException; lineNumber: 50; columnNumber: 24;
cvc-complex-type.3.2.2: Attribute 'mode' is not allowed to appear in element
'tokenize'.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)*

Looks like xtokenise is available from Camel 2.14.

I am using camel 2.10.xx version. Is there a way to achieve the use case
with this version? or rather with  ?



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


Re: Camel Splitter EIP

2014-10-21 Thread Charles Moulliard
Hi,

The tag  is not correct. Replace it with 

Regards,


On Tue, Oct 21, 2014 at 11:03 AM, contactreji  wrote:

> I tried doing it this way
>
> 
>  />
> 
>  mode="w">ns:SyncPersonnel/ns:DataArea/ns:Personnel
>  uri="file://C:/Users/re267981/Desktop/output" />
> 
>
> 
>
> Is this the correct way? I also get an error as
> *
> Caused by: org.xml.sax.SAXParseException; lineNumber: 33; columnNumber: 25;
> cvc-complex-type.2.4.a: Invalid content was found starting with element
> 'xtokenize'. One of '{"http://camel.apache.org/schema/spring":description,
> "http://camel.apache.org/schema/spring":expressionDefinition,
> "http://camel.apache.org/schema/spring":constant,
> "http://camel.apache.org/schema/spring":el,
> "http://camel.apache.org/schema/spring":groovy,
> "http://camel.apache.org/schema/spring":header,
> "http://camel.apache.org/schema/spring":jxpath,
> "http://camel.apache.org/schema/spring":javaScript,
> "http://camel.apache.org/schema/spring":language,
> "http://camel.apache.org/schema/spring":method,
> "http://camel.apache.org/schema/spring":mvel,
> "http://camel.apache.org/schema/spring":ognl,
> "http://camel.apache.org/schema/spring":php,
> "http://camel.apache.org/schema/spring":property,
> "http://camel.apache.org/schema/spring":python,
> "http://camel.apache.org/schema/spring":ref,
> "http://camel.apache.org/schema/spring":ruby,
> "http://camel.apache.org/schema/spring":simple,
> "http://camel.apache.org/schema/spring":spel,
> "http://camel.apache.org/schema/spring":sql,
> "http://camel.apache.org/schema/spring":tokenize,
> "http://camel.apache.org/schema/spring":xpath,
> "http://camel.apache.org/schema/spring":xquery}' is expected.
> at
>
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)*
>
>
> Do i need to add any namespace anywhere?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Splitter-EIP-tp5757844p5757845.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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


Re: Camel Splitter EIP

2014-10-21 Thread contactreji
I tried doing it this way




ns:SyncPersonnel/ns:DataArea/ns:Personnel





Is this the correct way? I also get an error as 
*
Caused by: org.xml.sax.SAXParseException; lineNumber: 33; columnNumber: 25;
cvc-complex-type.2.4.a: Invalid content was found starting with element
'xtokenize'. One of '{"http://camel.apache.org/schema/spring":description,
"http://camel.apache.org/schema/spring":expressionDefinition,
"http://camel.apache.org/schema/spring":constant,
"http://camel.apache.org/schema/spring":el,
"http://camel.apache.org/schema/spring":groovy,
"http://camel.apache.org/schema/spring":header,
"http://camel.apache.org/schema/spring":jxpath,
"http://camel.apache.org/schema/spring":javaScript,
"http://camel.apache.org/schema/spring":language,
"http://camel.apache.org/schema/spring":method,
"http://camel.apache.org/schema/spring":mvel,
"http://camel.apache.org/schema/spring":ognl,
"http://camel.apache.org/schema/spring":php,
"http://camel.apache.org/schema/spring":property,
"http://camel.apache.org/schema/spring":python,
"http://camel.apache.org/schema/spring":ref,
"http://camel.apache.org/schema/spring":ruby,
"http://camel.apache.org/schema/spring":simple,
"http://camel.apache.org/schema/spring":spel,
"http://camel.apache.org/schema/spring":sql,
"http://camel.apache.org/schema/spring":tokenize,
"http://camel.apache.org/schema/spring":xpath,
"http://camel.apache.org/schema/spring":xquery}' is expected.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)*
 

Do i need to add any namespace anywhere?



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


Camel Splitter EIP

2014-10-21 Thread contactreji
Hi friends

I am trying to split my messages using camel splitter. But its a slightly
different way of doing things.

I have an input file as follows

*
ECONOMICS

Paul
Thomas


*
I want the output as follows

*
ECONOMICS



 Paul




*

And another record as 

*
ECONOMICS



 Paul


*


How can I acheive this with Camel out of box feature?
Basically , I have a case where some values in multiple line items might be
invalid and the target system rejects the whole lot of records due to one
bad record.

Hence i want to send records one by one.

Cheers
Reji




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


LoadBalance for pollenrich

2014-10-21 Thread imranrazakhan
Hi,

I have following route and i want to apply loadbalance with failover for
pollenrich in route

from("jpa:com.test.VasRequest?consumeDelete=false&consumer.delay=2&consumer.namedQuery=selectLoanRequests&persistenceUnit=VasServicePU")
.choice()

.when(simple("${body.VasRequest.getMessage}=='Y'"))
.loadBalance().failover()

.pollEnrich("jpa:VasRequest?consumer.namedQuery=verifyRequests&persistenceUnit=VasServicePU1")
.otherwise()
.to("direct:verifyOffer")
.endChoice()
.to("jpa:com.test.VasResponse?persistenceUnit=VasServicePU")
.end();

Now if i couldnt get response from pollEnrich, i would like to query on
other jpa endpoint, but pollenrich is showing error if i provide other
endpoint by comma separation.

Regards



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


Re: Private variables not being inspected camel-swagger

2014-10-21 Thread panzerhans
I haven't tried going through CXF. We are trying to be consistent in the
route definitions, and the REST DSL is extremely clean and nice in that
regards (however still lacking a few features - such as interceptors and
query paramteres). 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Private-variables-not-being-inspected-camel-swagger-tp5757833p5757836.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Private variables not being inspected camel-swagger

2014-10-21 Thread Charlie Mordant
Hi,

What if you expose the service with regular web service (i.e. CXF)? What if
you annotate getters?

On my side I'm publishing CXFRS services with Swagger jaxb databinding and
its working fine...

Regards,

2014-10-21 9:15 GMT+02:00 panzerhans :

> NB, this is happening in camel-swagger 2.14.0
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Private-variables-not-being-inspected-camel-swagger-tp5757833p5757834.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charlie Mordant

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


Re: Private variables not being inspected camel-swagger

2014-10-21 Thread panzerhans
NB, this is happening in camel-swagger 2.14.0



--
View this message in context: 
http://camel.465427.n5.nabble.com/Private-variables-not-being-inspected-camel-swagger-tp5757833p5757834.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Private variables not being inspected camel-swagger

2014-10-21 Thread panzerhans
I I expose this class:

@ApiModel(value = "MyDTO ", description = "My data transporter")
public class MyDTO {
@ApiModelProperty(value = "This is a private field")
private String myPrivateField;
}

Swagger will not document the class as JSON. I am unsure if this is
happening in camel-core, or if this is a problem with Swagger. However, the
behaviour is inconsistent with e.g. Gson, which handles private fields just
fine. Instead it relies on annotations for how the class variables should be
exposed. 

Is there anywhere that I can change the configuration to have this private
property inspected by camel-swagger?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Private-variables-not-being-inspected-camel-swagger-tp5757833.html
Sent from the Camel - Users mailing list archive at Nabble.com.