Merging Swagger definitions into one

2016-09-15 Thread Raul Kripalani
Hi,

We have several Camel contexts using the REST DSL and exposing Swagger
definitions.

Unfortunately, each context is exposing its own and we don't have a unified
view of all API endpoints.

I am aware about the API Context Listing feature, but it's not what I'm
after at the moment.

Do we support – or are we planning to support – merging all Swagger defs
into a single one? Or any ideas if this could be achieved in an
"extra-Camel" manner?

Cheers.

---
Raúl Kripalani
linkedin.com/in/raulkripalani | evosent.com

| blog: raul.io
 |
skype: raul.fuse


Re: CXF cross cutting concerns

2016-03-14 Thread Raul Kripalani
Hi

I blogged about this a long while ago. CXF registers all buses as OSGi
services, so you can create a service listener that watches them come and
go, reacting accordingly. You do get a reference to the bus, so you can add
interceptors, features or change whatever configuration you'd like to by
finding your way around the API.

Have a look at
http://raul.io/enriching-services-with-cxf-interceptors-in-osgi/, and let
me know if it helped.

Cheers,
Raúl.
On 9 Mar 2016 15:26, "Ranx"  wrote:

> I have a client who wants to use deployable microservice bundles with
> REST/SOAP APIs.  Not a problem of course as it works very well.
>
> The issue is that I'm getting a lot of boilerplate replication across the
> project which is only getting to get bigger and more difficult to manage
> with time.
>
> This includes everything from basic host/port settings to security.
> Obviously setting that up in every bundles is error prone (especially with
> XML) and the a real headache for maintenance.  Part of the problem is that
> from what I've read sharing cfg files across bundles is not recommended.
> Perhaps with an update strategy reload that isn't such a big deal.  But it
> would be nice to have something like:
>
> com.foo.basic.rest.cfg
> com.foo.basic.soap.cfg
>
> and use that in each of my bundles to load basic configuration information.
> Each bundle would still have its own cfg file that will be used for very
> special and custom items.
>
> Things like PasswordCallback and keystores are exactly the same.  In the
> past I've always used a gateway bundle to centralize that.  I may still end
> up using something like that in this project but as "microservices" become
> more and more the holy grail (until it isn't anymore) this is going to be
> an
> on-going concern.
>
> I'm using Karaf so can also imagine using OSGi registry for creating CXF
> interceptors that I might inject into the setup of each of my projects.
>
> This problem is manifesting on the endpoints in both directions.  For
> example, one of the systems I'm integrating with is JDEdwards SOAP services
> which require PasswordCallbacks and http conduit settings.  But there are a
> large number of these services with WSDLs for many aspects of inventory,
> supply, invoices, etc.
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/CXF-cross-cutting-concerns-tp5778798.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: How to insert Date String as date in MongoDB

2016-03-14 Thread Raul Kripalani
Yeah. Converting the body to a String is a good way to guarantee that the
conversion logic we're interested in will kick in.

Just for reference, have a look at the MongoDbConverters class.

Cheers,
Raúl.
On 14 Mar 2016 18:52, "gramanero"  wrote:

> Yes I can try that. To make sure I am on the same page is this what you are
> asking for?
>
> *Route:*
> /
>   
> uri="mongodb:mongoBean?database=PMA&collection=Elmah&writeResultAsHeader=true&operation=insert"
> />/
>
> *JSON to send:*
> /{ "time" : { "$date" : "2016-02-19T17:37:57.673+" } }/
>
>
> Or do think we should not perform the convertBodyTo string?
>
> Thank you for the quick response! I seriously appreciate the attention.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-insert-Date-String-as-date-in-MongoDB-tp5778310p5779043.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: How to insert Date String as date in MongoDB

2016-03-14 Thread Raul Kripalani
Jackson is not MongoDB-specific and therefore doesn't recognise $date types.

The camel-mongodb component uses MongoDB's JSON class to parse Strings,
which does recognise Mongo-specific types:
http://api.mongodb.org/java/2.6.5/com/mongodb/util/JSON.html.

Can you try sending the JSON string directly to the endpoint, with no
Jackson marshal/unmarshalling?

Cheers,

*Raúl Kripalani*
PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
Messaging Engineer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
Blog: raul.io | twitter: @raulvk 

On Fri, Mar 4, 2016 at 9:43 PM, gramanero  wrote:

> Thank you for the response and information. I believe I tried what is
> recommended in the link that you provided. Below is a copy from the Logs
> via
> the Karaf console. I hope the formatting is not too terrible. I can try and
> provide it another way if necessary.
>
> Pretty much the same result as I was seeing before as I believe I already
> tried this approach. Here is the document that I used: /{ "time" : {
> "$date"
> : "2016-02-19T17:37:57.673+" } }/
>
> Here is what is going on in the route (the reason for the tracing is that I
> wanted to see what type the body was being converted to and from...I was
> toying around with different conversions to see if I could come up with
> some
> magic incantation that would work):
> /  
>   
>   
>   
>   
> uri="mongodb:mongoBean?database=PMA&collection=Elmah&writeResultAsHeader=true&operation=insert"
> />/
>
> And the jsonMarshaller dataformat definition is this:
> /
>disableFeatures="FAIL_ON_UNKNOWN_PROPERTIES,WRITE_DATES_AS_TIMESTAMPS"/>
> 
> /
>
> And the Mongo bean definition:
> /  
> 
>   
> 
> value="mongodb://DEVVLMONGORPLLOGS00.oecapplications.dev:27018/?replicaSet=rsLOGS&connectTimeoutMS=3&wtimeoutMS=3&w=1&journal=true"
> />
>   
> 
>   /
>
>
> Hope this information is helpful. I certainly appreciate someone looking
> into this. We are not Java developers here, but at the moment it feels like
> my next course of action is to write some Java code to customize the
> serializer.
>
> *From the Logs available via the Karaf Console:*
> *3/4/2016, 4:29:33 PM   WARN*   /Execution of JMS message listener failed.
> Caused by: [org.apache.camel.RuntimeCamelException -
> org.apache.camel.component.mongodb.CamelMongoDbException: MongoDB operation
> = insert, Body is not conversible to type DBObject nor List]
> camel-core  org.apache.camel.RuntimeCamelException:
> org.apache.camel.component.mongodb.CamelMongoDbException: MongoDB operation
> = insert, Body is not conversible to type DBObject nor List/
>
> *3/4/2016, 4:29:33 PM   ERROR*  /Failed delivery for (MessageId:
> ID:devvlapifuse01-42307-1456773862280-9:8:3:1:1 on ExchangeId:
> ID-devvlapifuse01-49834-1456773865165-1-9). Exhausted after delivery
> attempt: 1 caught:
> org.apache.camel.component.mongodb.CamelMongoDbException:
> MongoDB operation = insert, Body is not conversible to type DBObject nor
> List Message History
>
> ---
> RouteId ProcessorId Processor Elapsed (ms) [oec.common.logger.]
> [oec.common.logger.] [activemq://queue:oec.common.logger.elmah.request ] [
> 2] [oec.common.logger.] [validate4 ]
> [validate[simple{${in.header.MongoDatabase}}] ] [ 0] [oec.common.logger.]
> [validate5 ] [validate[simple{${in.header.MongoCollection}}] ] [ 0]
> [oec.common.logger.] [log2 ] [log ] [ 0] [oec.common.logger.]
> [convertBodyTo1 ] [convertBodyTo[String] ] [ 0] [oec.common.logger.] [log3
> ]
> [log ] [ 1] [oec.common.logger.] [log4 ] [log ] [ 0] [oec.common.logger.]
> [to1 ]
>
> [mongodb:mongoBean?database=PMA&collection=Elmah&writeResultAsHeader=true&opera]
> [ 1] Exchange
>
> ---
> Exchange[ Id ID-devvlapifuse01-49834-1456773865165-1-9 ExchangePattern
> InOnly Headers {Accept=*/*, Accept-Encoding=gzip, deflate,
> Accept-Language=en-US,en;q=0.8, AppKey=NfQFDRu7Ogq4xF4hZpMGV0CxdgQCnDPW,
> breadcrumbId=ID-devvlapifuse01-49834-1456773865165-1-8,
> CamelRedelivered=false, CamelRedeliveryCounter=0,
> CamelServletContextPath=/private/common/logger/elmah, Content-Length=59,
> Content-Type=application/json, JMSCorrelationID=null,
> JMSCorrelationIDAsBytes=null, JMSDeliveryMode=2,
> JMSDestination=queue://oec.common.logger.elmah.request, JMSExpiration=0,
> JMSMessageID=ID:devvlapifuse01-42307-1456773862280-9:8:3:1:1,
> JMSPriority=4,
> JMSRedelivered=false, JMSReplyTo=null, JMSTimestamp=1457126973022,
> JMSType=null, JMSXGroupID=null, JMSXUserID=null, MongoCollection=Elmah,
> MongoDatabase=PMA,
> Origin=chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop,
> Postman-Token=fc4ab341-5fbb-fb41-d0ad-c30cc7c3c30a, TestType=2} BodyTyp

Re: How to insert Date String as date in MongoDB

2016-03-03 Thread Raul Kripalani
MongoDB uses a special representation of JSON they call BSON.

According to their docs, timestamps should be represented with the
$timestamp token, along with 't' and 'i' portions for them to be
interpreted correctly by the drivers:
https://docs.mongodb.org/manual/reference/mongodb-extended-json/#timestamp.
It requires turning the date into an epoch.

For dates:
https://docs.mongodb.org/manual/reference/mongodb-extended-json/#data_date.

Could you guys try that?

*Raúl Kripalani*
PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
Messaging Engineer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
Blog: raul.io | twitter: @raulvk 

On Thu, Mar 3, 2016 at 3:47 PM, gramanero  wrote:

> I would be interested in knowing the answer on how to do this as well. I
> posted in a different thread and the datatype I am trying to do this with
> is
> the ISODate built-in mongo type. I am using Spring DSL as well. Thanks!
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-insert-Date-String-as-date-in-MongoDB-tp5778310p5778555.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: How to specify types in marshalling from XML to JSON

2016-01-07 Thread Raul Kripalani
Hi,

Have you changed any defaults of the xmljson data format? By default it
comes with type hints enabled with type hints compatibility = true.

I'm looking at the jsonlib docs and it seems contradictory with the value
of type hints compatibility. Could you try calling your attribute
json_type, or switching to the TypeHintsEnum.WITH_PREFIX value for the
typeHints option?

Cheers,

*Raúl Kripalani*
PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
Messaging Engineer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Thu, Jan 7, 2016 at 4:38 PM, Jack Ding 
wrote:

> Hello,
> I am trying to do the XML to JSON conversion using camel-xmljson with some
> specified date types such as number, boolean, etc.
> Example 1: input XML:  string
>
>   12345
>
>
> Expected JSON:
> {"a":{"b":"string", "c": 12345}}
> You can see 12345 should be a number instead of a string.
>
> Result JSON:{"a":{"b":"string", "c": "12345"}}
>
> Notice the double quotes around the 12345.
> Example 2: In this example we specify the type="number" . input XML:
> string
>
>   12345
>
>
> Expected JSON:
> {"a":{"b":"string", "c": 12345}}
> You can see 12345 should be a number instead of a string.
>
> Result JSON:{"a":{"b":"string", "c": {"@type":"number","#text":"12345"}}}
>
> We are using the spring XML to configure the camel routes and data format.
> Could anybody give some advise if there is a easier way to configure above
> in Spring XML wihtout involving customized java code?
> Thanks
>


Re: The Camel Name - Just A Thought

2015-12-10 Thread Raul Kripalani
I would also venture a guess that the name Camel has something to do with
another platform called Mule back in 2006-2007 :)

Regards,
Raúl.

On Thu, Dec 10, 2015 at 3:26 PM, Claus Ibsen  wrote:

> Yeah and there is some other reasons here
> http://camel.apache.org/why-the-name-camel.html
>
> On Thu, Dec 10, 2015 at 4:10 PM, gbchriste 
> wrote:
> > Section 1.1 of Camel In Action says, "The Apache Camel project was named
> > Camel simply because the name is short and easy to remember."
> >
> > But here's a thought.  When you think about it, the name "Camel" is so
> > appropriate to the notion of what Camel does that you'd think the name
> was
> > chosen on purpose.  Even the picture of the Bedouin fits.
> >
> > For the nomadic, desert-dwelling people of ages past, the camel was the
> key
> > method of transport, and was essential to creating and maintaining the
> lines
> > of communication that connected distant communities.  Individuals,
> families,
> > trade goods of all kinds, and messages were all carried back and forth by
> > caravans of camels.
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/The-Camel-Name-Just-A-Thought-tp5774938.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: Transactional Route with JTA

2015-10-30 Thread Raul Kripalani
Alright. BTW, you also need to define a Resource Manager.

In this repo is another set of examples:
https://github.com/FuseByExample/camel-persistence-part2/blob/jboss-fuse-6.2/route-one-tx-manager/src/main/resources/OSGI-INF/blueprint/route-one-tx-manager.xml

Regards,
Raúl.
On 30 Oct 2015 19:24, "Christian Schneider"  wrote:

> Hi Raul,
>
> thanks for the smx blueprint. The only difference I found was to use
> org.apache.activemq.jms.pool.JcaPooledConnectionFactory instead of the
> XaPooledConnectionFactory.
> I remember that I used this one for the tests in CXF JMS and it is the
> right one I think. So that should be a useful change.
>
> I am pretty sure that I do not need the XAConnectionFactory on the service
> level. If you look at the SMX blueprint you see that a
> org.apache.activemq.ActiveMQXAConnectionFactory is used internally and
> injected into the JcaPooledConnectionFactory but this is then published
> using the regular ConnectionFactory interface. As far as I know this is
> correct and is also the way you do it for a db XA DataSource.
>
> My logging already showed that the XA part of my demo should be correct
> now. So I think the only missing part is the redelivery. I will ask about
> it on the ActiveMQ list.
>
> Christian
>
> On 30.10.2015 18:37, Raul Kripalani wrote:
>
>> Hey Christian,
>>
>> I had a look at your code and I think you need to grab the
>> XaConnectionFactory from the OSGi Service Registry (or create one).
>>
>> Not sure if you're using ServiceMix or not, but here is how SMX makes
>> these
>> services available in the container:
>>
>> https://git-wip-us.apache.org/repos/asf?p=servicemix.git;a=blob;f=activemq/activemq-service/src/main/resources/OSGI-INF/blueprint/activemq-service.xml
>> .
>>
>> Regards,
>>
>> *Raúl Kripalani*
>>
>>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>


Re: Transactional Route with JTA

2015-10-30 Thread Raul Kripalani
Hey Christian,

I had a look at your code and I think you need to grab the
XaConnectionFactory from the OSGi Service Registry (or create one).

Not sure if you're using ServiceMix or not, but here is how SMX makes these
services available in the container:
https://git-wip-us.apache.org/repos/asf?p=servicemix.git;a=blob;f=activemq/activemq-service/src/main/resources/OSGI-INF/blueprint/activemq-service.xml
.

Regards,

*Raúl Kripalani*
PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
Messaging Engineer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Oct 30, 2015 at 4:58 PM, Christian Schneider <
ch...@die-schneider.net> wrote:

> I have now added more logging and see that I indeed have a JTA transaction
> and it seems to include the receive of the jms message.
> I also see that the transaction is rolled back when the error happens. So
> the only thing missing seems to be the redelivery. Any idea why that can
> happen?
>
> Christian
>
> On 30.10.2015 15:37, Raul Kripalani wrote:
>
>> Hi Christian,
>>
>> You need to plug in the JTA TransactionManager into the JMS consumer, so
>> that the transaction is opened as part of the consumption.
>>
>> Otherwise, the transaction starts after the route kicks off and therefore
>> doesn't cover the JMS consumption itself.
>>
>> Maybe this resource helps:
>>
>> https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.0/html/EIP_Transactions_Guide/XaJms-Overview.html
>>
>> Raúl.
>> On 30 Oct 2015 14:31, "Christian Schneider" 
>> wrote:
>>
>> I am trying to set up a route that spans an XA transaction from a jms
>>> endpoint to a db based endpoint or to another JMS endpoint.
>>>
>>> If I do a route like this:
>>> from("jms:queue1").transacted().to("jms:queue2")
>>>
>>> Will the transaction then also include the receive of the JMS message?
>>>
>>> I have set up an example at:
>>>
>>> https://github.com/Talend/tesb-rt-se/tree/ebook-example/examples/tesb/ebook
>>>
>>> The route is at
>>>
>>>
>>> https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-importer/src/main/java/org/talend/esb/examples/ebook/importer/ImportRoutes.java
>>> and the blueprint is here
>>>
>>>
>>> https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-importer/src/main/resources/OSGI-INF/blueprint/blueprint.xml
>>>
>>> I have implemented the BookRepository using Aries JPA and it supports XA
>>> transactions. For the test I throw an exception if the book title is
>>> "error1".
>>> I see the exception in camel but the message does not seem to be returned
>>> to the broker and I see no redelivery.
>>>
>>> I configured the ConnectionFactory like this:
>>>
>>>
>>> https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-connectionfactory/src/main/resources/OSGI-INF/blueprint/blueprint.xml
>>>
>>> Any idea what I am doing wrong? Or do I misunderstand the concept of
>>> transactional routes in camel and this simply can not work?
>>> Can I debug the transaction handling somehow?
>>>
>>> Christian
>>>
>>> --
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>>
>>> Open Source Architect
>>> http://www.talend.com
>>>
>>>
>>>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>


Re: Transactional Route with JTA

2015-10-30 Thread Raul Kripalani
Hi Christian,

You need to plug in the JTA TransactionManager into the JMS consumer, so
that the transaction is opened as part of the consumption.

Otherwise, the transaction starts after the route kicks off and therefore
doesn't cover the JMS consumption itself.

Maybe this resource helps:
https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.0/html/EIP_Transactions_Guide/XaJms-Overview.html

Raúl.
On 30 Oct 2015 14:31, "Christian Schneider"  wrote:

> I am trying to set up a route that spans an XA transaction from a jms
> endpoint to a db based endpoint or to another JMS endpoint.
>
> If I do a route like this:
> from("jms:queue1").transacted().to("jms:queue2")
>
> Will the transaction then also include the receive of the JMS message?
>
> I have set up an example at:
> https://github.com/Talend/tesb-rt-se/tree/ebook-example/examples/tesb/ebook
>
> The route is at
>
> https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-importer/src/main/java/org/talend/esb/examples/ebook/importer/ImportRoutes.java
> and the blueprint is here
>
> https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-importer/src/main/resources/OSGI-INF/blueprint/blueprint.xml
>
> I have implemented the BookRepository using Aries JPA and it supports XA
> transactions. For the test I throw an exception if the book title is
> "error1".
> I see the exception in camel but the message does not seem to be returned
> to the broker and I see no redelivery.
>
> I configured the ConnectionFactory like this:
>
> https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-connectionfactory/src/main/resources/OSGI-INF/blueprint/blueprint.xml
>
> Any idea what I am doing wrong? Or do I misunderstand the concept of
> transactional routes in camel and this simply can not work?
> Can I debug the transaction handling somehow?
>
> Christian
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>


Re: XmlJsonDataFormat - Camel 2.16.0 - xom.jar

2015-10-16 Thread Raul Kripalani
Hi

We cannot include that dependency due to licensing issues, as its license
is not compatible with ASLv2. This situation is alerted in the Camel
XmlJson doc page if I remember correctly.

Your IDE probably didn't complain because the dependency does exist in the
POM and can be resolved from Maven Central, but it's marked with scope =
runtime (or test, I can't remember), that's why it's not packaged with the
build.

Raúl.
On 16 Oct 2015 21:04, "Shiv Kandavelu"  wrote:

> I am a newbie when it comes to Camel. So bear with me if I don't use the
> correct Terminology.
>
> I am converting a large amount of XML to JSON format and was trying to use
> the XmlJsonDataFormat in my Router. It compiled fine but during run time I
> kept getting class loader error in nu/../parent... I found after a while
> that I have to include xom.jar in my dependencies. I couldn't find xom.jar
> as part of camel and I have to download it separately, once I added xom,
> everything worked fine.
>
> I have 2 questions,
>
> 1. if xom.jar is a dependency why it is not packaged and distributed with
> Camel?
> 2. When I added camel-xmljson in my project in NetBeans, it added the
> dependent jars, but it never complained about the xom dependency. why it
> didn't complain?
>
> Please help me understand.
>
> Thanks,
> -Shiv
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/XmlJsonDataFormat-Camel-2-16-0-xom-jar-tp5772736.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: http4 component - producer endpoint config - http 401 error

2015-09-29 Thread Raul Kripalani
It looks like this is an authorization key for a restricted API available
publicly. Be careful of posting such things on public forums.

*Raúl Kripalani*
PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
Messaging Engineer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Sep 29, 2015 at 11:20 AM, contactreji  wrote:

> Hi guys
>
> Am trying to hit a REST API using camel http4 component.
>
> But I get following exception -
>
> *Stacktrace
>
> ---
> org.apache.camel.component.http4.HttpOperationFailedException: HTTP
> operation failed invoking
>
> http://stage-api.target.com/v2/location?key=KiTA3ErWjEeJh6C3wSeUwvJyMv3lk0PA+
> with statusCode: 401
> at
>
> org.apache.camel.component.http4.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:236)
> at
>
> org.apache.camel.component.http4.HttpProducer.process(HttpProducer.java:163)
> at
>
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
> at
>
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> at
>
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
> at
>
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
> at
>
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at
>
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:165)
> at
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:73)
> at java.util.TimerThread.mainLoop(Timer.java:555)
> at java.util.TimerThread.run(Timer.java:505)*
>
>
> I tried the same from SOAP UI - And I have following log in Soap UI. All
> seems neat and API is working perfectly fine via Soap UI.
>
> Can you suggest what could be the necessary settings which is missing on my
> http4 endpoint?
>
>
> SOAP UI LOG
> ---
> Tue Sep 29 15:42:39 IST 2015:DEBUG:Attempt 1 to execute request
> Tue Sep 29 15:42:39 IST 2015:DEBUG:Sending request: GET
>
> http://stage-api.target.com/v2/location?key=KiTA3ErWjEeJh6C3wSeUwvJyMv3lk0PA
> HTTP/1.1
> Tue Sep 29 15:42:40 IST 2015:DEBUG:Receiving response: HTTP/1.1 302 Found
> Tue Sep 29 15:42:40 IST 2015:DEBUG:Connection can be kept alive
> indefinitely
> Tue Sep 29 15:42:40 IST 2015:DEBUG:Sending request: CONNECT
> storage101.dfw1.clouddrive.com:443 HTTP/1.1
> Tue Sep 29 15:42:40 IST 2015:DEBUG:Receiving response: HTTP/1.1 200
> Connection established
> Tue Sep 29 15:42:40 IST 2015:DEBUG:Tunnel to target created.
> Tue Sep 29 15:42:40 IST 2015:DEBUG:Attempt 1 to execute request
> Tue Sep 29 15:42:40 IST 2015:DEBUG:Sending request: GET
>
> /v1/MossoCloudFS_a3913144-fa23-4e09-8e56-9e4d5d2a7101/esv-locations-v2-stage/location_providers/full/locations_2015-09-29.xml?temp_url_sig=cc4d2c061ed57cecd10abee5f61e733700f06371&temp_url_expires=1443607499
> HTTP/1.1
> Tue Sep 29 15:42:56 IST 2015:DEBUG:Receiving response: HTTP/1.1 200 OK
> Tue Sep 29 15:42:56 IST 2015:DEBUG:Connection can be kept alive
> indefinitely
> Tue Sep 29 15:43:06 IST 2015:DEBUG:Connection shut down
> Tue Sep 29 15:43:06 IST
> 2015:INFO:[http://stage-api.target.com.Location:Request 1] - CANCELED
> Tue Sep 29 15:43:06 IST 2015:ERROR:An error occurred [Socket is closed],
> see
> error log for details
> Tue Sep 29 15:43:13 IST 2015:DEBUG:Connection closed
>
>
>
> -
> Reji Mathews
> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
> & Jboss Fuse ESB | Mule ESB )
> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
> Twitter - reji_mathews
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/http4-component-producer-endpoint-config-http-401-error-tp5772087.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: XML 2 JSON marshaling fails due to missing library in embedded Camel within ServiceMix

2015-09-22 Thread Raul Kripalani
Also check the Dependencies section of the component page.

https://camel.apache.org/xmljson.html#XmlJson-Dependencies

*Raúl Kripalani*
PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
Messaging Engineer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Sep 22, 2015 at 11:04 AM, Claus Ibsen  wrote:

> Hi
>
> Its on purpose, see the info of the feature
>
> I think the command is features:info camel-xmljson
>
> On Tue, Sep 22, 2015 at 12:00 PM, catshout  wrote:
> > Dear all,
> >
> > with following snippet
> >
> >
> >
> > I'm getting following error while deploying the route (even vice versa
> while
> > trying to unmarshal)
> >
> > java.lang.NoClassDefFoundError: nu/xom/ParentNode
> > ...
> > java.lang.ClassNotFoundException: nu.xom.ParentNode not found by
> > org.apache.servicemix.bundles.json-lib
> >
> > Seems that the xom classes are missing.
> >
> > I'm working with ServiceMix 6.0.0 with embedded Camel 2.15.2
> >
> > Does anyone have an idea about this?
> >
> > Best
> > -Gerald
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/XML-2-JSON-marshaling-fails-due-to-missing-library-in-embedded-Camel-within-ServiceMix-tp5771771.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2nd edition: https://www.manning.com/books/ibsen2
>


Re: Camel MemoryIdempotentRepository based Idempotent Consumer

2015-09-18 Thread Raul Kripalani
Ah, by the way, our MemoryIdempotentRepository has a size property. So you
can set the max size of the cache without having to resort to another
implementation.

Try that first... We do not support time-based expiry or TTL though. If
you're looking for that, you can implement IdempotentRepository and use a
Guava cache (for example) to provide the functionality.

Regards,
Raúl.
On 18 Sep 2015 20:19, "contactreji"  wrote:

> Hey Raul
>
> Thanks for that.
>
> I was checking out your way of doing it on
> http://camel.apache.org/idempotent-consumer.html ..
> Couldn't find a way to use cache though.
>
> Can you paste a code snippet of the implementation if you have any. That
> would be a big help for me to proceed!
>
> Cheers
> Reji
>
>
>
> -
> Reji Mathews
> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
> & Jboss Fuse ESB | Mule ESB )
> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
> Twitter - reji_mathews
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-MemoryIdempotentRepository-based-Idempotent-Consumer-tp5771668p5771671.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel MemoryIdempotentRepository based Idempotent Consumer

2015-09-18 Thread Raul Kripalani
Hi Reji,

I would suggest you use a local cache implementation with an entry TTL or
FIFO eviction support with a maximum limit on entry count.

I find myself using Guava caches quite often when I require a lightweight
cache [1] like what you describe.

Beware that the content of the repository will not survive Camel context
restarts, or a restart of anything further down the stack (app server,
container, machine, etc.), but I guess you already are onto that since
you're specifically using a Memory-based idempotent repo.

[1] https://github.com/google/guava/wiki/CachesExplained

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Sep 18, 2015 at 5:40 PM, contactreji  wrote:

> Hello friends
>
> I have implemented a idempotent consumer which filter's out duplicates.
>
> Implemented it using MemoryIdempotentRepository implementation.
>
> However, I feel that if the server runs over a long period of time, it must
> eventually run out of memory after storing all the filter keys for a long
> period of time.
>
> Is there a way we can clear the Memory Idempotent Repository after a
> certain
> period of time? Or is there an API which I can call and get it cleared from
> the memory?
>
> Cheers
> Reji
>
>
>
> -
> Reji Mathews
> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
> & Jboss Fuse ESB | Mule ESB )
> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
> Twitter - reji_mathews
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-MemoryIdempotentRepository-based-Idempotent-Consumer-tp5771668.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Interceptor into external file

2015-09-10 Thread Raul Kripalani
If you are using OSGi you can leverage OSGi Service Listeners to
programmatically add the interceptors whenever a new context appears in the
environment.

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Thu, Sep 10, 2015 at 11:57 AM, fabrizio.spataro <
fabrizio.spat...@bizmate.it> wrote:

> Hello,
>
> i would use same interceptor (XML Spring implementation) into my different
> projects.
>
> Can i reference an interceptor like "routeContextRef" tag or
> "restContextRef" tag?
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Interceptor-into-external-file-tp5771400.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: CamelExecutionException: Exception occurred during execution on the exchange

2015-09-09 Thread Raul Kripalani
Normally CamelExecutionExceptions wrap the actual exception inside it as a
cause. Is your log not outputting the cause exception? If not, you can try
to insert a Processor to explore the exception.getCause().

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Sep 9, 2015 at 4:59 PM, Sashimi  wrote:

> Hi during the trasmission of a message i get this error:
>
> <
> http://camel.465427.n5.nabble.com/file/n5771388/Schermata_2015-09-09_alle_17.png
> >
>
> the strange thing is that if I send (in the body message) a very similar
> object (but smaller) this work
> perfectly.
>
> I'm wondering if the problem is the objects size (the second one is
> smaller)
> or something that in the first object is not serializable.
> Before i send my configurations i would like to know if there are size
> limitations for sending objects?
>
> thank you very much.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/CamelExecutionException-Exception-occurred-during-execution-on-the-exchange-tp5771388.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: PEM File for Authentication in route

2015-09-08 Thread Raul Kripalani
Please create a Github repo or Gist with your code so we can assist you
better.

Thanks,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Sep 8, 2015 at 7:04 AM, anish.somadevan  wrote:

> I tried having the SSLContextParameters tag outside the routes tag, but it
> resulted in error. Seems like routes tag should be the first node in XML.
> Also, i had checked the blueprint schema and found that
> SSLContextParameters
> bean is referred in this schema, but not in spring schema
> (http://camel.apache.org/schema/) Does this have anything to do with the
> bean not being referenced? I tried having blueprint as the namespace in my
> routes tag, but it resulted in error expecting spring schema.
>
> Thanks,
> Anish
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/PEM-File-for-Authentication-in-route-tp5771084p5771321.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: what's happening to camel extra?

2015-09-04 Thread Raul Kripalani
Good point, Thierry. The conversation has certainly taken a twist which
makes it now belong to dev@.

@All, let's continue there.

Thanks.

On Fri, Sep 4, 2015 at 4:14 PM, Rabuel, Thierry  wrote:

> Hi all,
>
> Despite the fact this subject is really interesting, could you please
> notice that you are on the USERS' mailing-list and not the DEVS' one ?
>
> Best regards,
>
> Thierry
>
> 2015-09-04 16:59 GMT+02:00 Rob Davies :
>
> > The way I read it is comdev are doing a mass migration to SF - its
> > understandable they wouldn’t want multiple targets - so to pick one
> > destination for the code move makes sense. However its not clear that we
> > have to keep camel-extra at SF - or why we couldn’t just move it to
> GitHub
> > ourselves ?
> >
> >
> > > On 4 Sep 2015, at 15:54, Pontus Ullgren  wrote:
> > >
> > > Victor and David: You are welcome to join the com-dev mailing list and
> > > enlighten them.
> > > Here is a link the latest answer on that question :-)
> > >
> > >
> >
> https://mail-archives.apache.org/mod_mbox/community-dev/201507.mbox/%3CBY2PR03MB490B6943E12F5D925203A2E99900%40BY2PR03MB490.namprd03.prod.outlook.com%3E
> > >
> > > // Pontus
> > >
> > >
> > > On Fri, 4 Sep 2015 at 16:01 David Karlsen 
> > wrote:
> > >
> > >> Why not github?
> > >> 4. sep. 2015 3:54 p.m. skrev "Victor NOËL"  >:
> > >>
> > >>> Are they even aware of the problem with sourceforge?
> > >>> Maybe someone that is known there (such as a member of an Apache
> > Project
> > >>> ;) could tell them before they take the wrong decision?
> > >>>
> > >>> It's even worse than what I thought because after the Gimp people
> told
> > SF
> > >>> to stop doing their shady things, they actually insisted during 2015:
> > >>>
> > >>
> >
> https://mail.gnome.org/archives/gimp-developer-list/2015-May/msg00097.html
> > >>>
> > >>
> >
> https://mail.gnome.org/archives/gimp-developer-list/2015-May/msg00098.html
> > >>>
> > >>> Victor
> > >>>
> > >>> Le 04/09/2015 15:36, Raul Kripalani a écrit :
> > >>>
> > >>>> Quite frankly, SF would be my last resort. But the Apache Extras
> > >>>> repositories are governed by the ASF and the consensus seems to
> point
> > to
> > >>>> SF
> > >>>> rather than Github (which would have been my personal preference) or
> > >>>> Bitbucket.
> > >>>>
> > >>>> Regards,
> > >>>>
> > >>>> *Raúl Kripalani*
> > >>>> Apache Camel PMC Member & Committer | Enterprise Architect, Open
> > Source
> > >>>> Integration specialist
> > >>>> http://about.me/raulkripalani |
> > >> http://www.linkedin.com/in/raulkripalani
> > >>>> http://blog.raulkr.net | twitter: @raulvk
> > >>>>
> > >>>> On Fri, Sep 4, 2015 at 2:22 PM, Victor NOËL <
> victor.n...@linagora.com
> > >
> > >>>> wrote:
> > >>>>
> > >>>> I arrive a bit late, but are we sure sourceforge is a good solution?
> > >>>>>
> > >>>>> After all the fuss about their terrible behaviour by implanting
> > adware
> > >>>>> and
> > >>>>> other spyware in installers available to download there.
> > >>>>> It became known with the big complain of the Gimp project (that
> > wasn't
> > >>>>> even fixed by SourceForge…).
> > >>>>>
> > >>>>> See
> > >>>>>
> > >>>>>
> > >>
> >
> http://www.theregister.co.uk/2013/11/08/gimp_dumps_sourceforge_over_dodgy_ads_and_installer/
> > >>>>> for details.
> > >>>>>
> > >>>>> Victor
> > >>>>>
> > >>>>>
> > >>>>> Le 04/09/2015 13:29, Pontus Ullgren a écrit :
> > >>>>>
> > >>>>> Do we not already have volunteers in the current set of
> contributors
> > >> for
> > >>>>>> the project ?
> > >>>>>> I for one is willing in continue maintaining the project once it
> has
> > >>>>>> been

Re: what's happening to camel extra?

2015-09-04 Thread Raul Kripalani
Quite frankly, SF would be my last resort. But the Apache Extras
repositories are governed by the ASF and the consensus seems to point to SF
rather than Github (which would have been my personal preference) or
Bitbucket.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Sep 4, 2015 at 2:22 PM, Victor NOËL 
wrote:

> I arrive a bit late, but are we sure sourceforge is a good solution?
>
> After all the fuss about their terrible behaviour by implanting adware and
> other spyware in installers available to download there.
> It became known with the big complain of the Gimp project (that wasn't
> even fixed by SourceForge…).
>
> See
> http://www.theregister.co.uk/2013/11/08/gimp_dumps_sourceforge_over_dodgy_ads_and_installer/
> for details.
>
> Victor
>
>
> Le 04/09/2015 13:29, Pontus Ullgren a écrit :
>
>> Do we not already have volunteers in the current set of contributors for
>> the project ?
>> I for one is willing in continue maintaining the project once it has been
>> moved (where ever it is moved).
>>
>> I think the question right now is the progress of the SF migration.
>>
>> // Pontus
>>
>> On Fri, 4 Sep 2015 at 09:18 Henryk Konsek  wrote:
>>
>> Hi,
>>>
>>> As far as I know the Apache Extras projects are being moved to the...
>>> SourceForge. So we need to find a volunteer willing to maintain the
>>> project
>>> after  SourceForge migration.
>>>
>>> Cheers!
>>>
>>> czw., 3.09.2015 o 20:38 użytkownik Pontus Ullgren 
>>> napisał:
>>>
>>> Have not seen any other updates on the comdev mailing list no.
>>>>
>>>> Perhaps we should reach out to Daniel Gruno (that seems to be in charge
>>>>
>>> of
>>>
>>>> the move) to get a status update for camel-extra.
>>>>
>>>> // Pontus
>>>>
>>>> On Wed, 2 Sep 2015 at 23:57 Raul Kripalani  wrote:
>>>>
>>>> Hey guys,
>>>>>
>>>>> Do we have an update on the ASF front about the Apache Extras
>>>>>
>>>> migration?
>>>
>>>> Users are asking for new releases of camel-extras components...
>>>>>
>>>>> I quickly went through the ComDev thread but found no conclusion.
>>>>>
>>>> Maybe I
>>>
>>>> overlooked an email in that thread. Things tend to get very chatty over
>>>>> there and there's no clearly marked conclusion email.
>>>>>
>>>>> Regards,
>>>>>
>>>>> *Raúl Kripalani*
>>>>> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
>>>>> Integration specialist
>>>>> http://about.me/raulkripalani |
>>>>>
>>>> http://www.linkedin.com/in/raulkripalani
>>>
>>>> http://blog.raulkr.net | twitter: @raulvk
>>>>>
>>>>> On Fri, Aug 21, 2015 at 8:56 AM, Pontus Ullgren 
>>>>>
>>>> wrote:
>>>>
>>>>>  From this thread[1]  it seems that Daniel Gruno is the one in charge
>>>>>>
>>>>> for
>>>>
>>>>> the move.
>>>>>> However I fail to find any indication on the progress or roadmap.
>>>>>> Using Github as a backup plan does NOT[2] seem to be a option in the
>>>>>> opinion of the community-dev decision.
>>>>>> Anyway perhaps we should move this discussion to the camel-dev
>>>>>>
>>>>> mailinglist.
>>>>>
>>>>>> [1]
>>>>>>
>>>>>>
>>>>>>
>>> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3C559EC097.7000707%40apache.org%3E
>>>
>>>> [2]
>>>>>>
>>>>>>
>>>>>>
>>> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3cby2pr03mb490b6943e12f5d925203a2e99...@by2pr03mb490.namprd03.prod.outlook.com%3E
>>>
>>>> // Pontus
>>>>>>
>>>>>> On Fri, 21 Aug 2015 at 07:17 Christoph Emmersberger <
>>>>>>
>>>>> cemme...@gmail.com>
>>>>
>>>>> wrote:
>>>>>>
>>>>>> Is there any date when this move is expe

Re: Problem upgrading to Camel 2.15.3 in Karaf 3.0.4

2015-09-03 Thread Raul Kripalani
No worries. Welcome and feel free to ask and contribute!

Raúl.
On 3 Sep 2015 10:03, "michael.esmann" 
wrote:

> Thank you very much for the answer!! I will try the new Camel version.
>
> NB: I am new to this user forum, and must learn how to search in the
> existing jira issues to see if a problem has already been resolved ;-)
>
> Regards
>
> Michael
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Problem-upgrading-to-Camel-2-15-3-in-Karaf-3-0-4-tp5771113p5771196.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Problem upgrading to Camel 2.15.3 in Karaf 3.0.4

2015-09-02 Thread Raul Kripalani
Hey,

This has been resolved already on the unreleased versions 2.16.0 and
2.15.4: https://issues.apache.org/jira/browse/CAMEL-9099.

You may want to try a SNAPSHOT for the time being.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Sep 1, 2015 at 10:02 AM, michaelesmann <
camel.michael.esm...@gmail.com> wrote:

> Hi,
>
> I am trying to upgrade to Camel 2.15.3 from 2.14.1. We are using Karaf
> 3.0.4
> as server.
>
> There is a problem with this, which can be reproduced this way:
>
> - Make a clean Karaf 3.0.4 installation
>
> - Start Karaf and install features:
>
>feature:repo-add camel 2.15.3
>feature:install camel
>feature:install camel-script
>
> Now there is a warning and stacktrace in the Karaf logfile, as seen below.
> It looks as if "something" is trying read a line comment as a Java class(?)
>
> Can anybody help?
>
> Thanks,
> Michael
>
>
> -
>
> 2015-09-01 10:53:56,794 | WARN  | l for user karaf | Activator
> | 94 - org.apache.camel.camel-script - 2.15.3 | Cannot create the
> ScriptEngineFactory: java.lang.ClassNotFoundException
> java.lang.ClassNotFoundException: # Licensed to the Apache Software
> Foundation (ASF) under one or more not found by groovy-all [92]
> at
>
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
> at
>
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
> at
>
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_51]
> at
> org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)
> at
> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)
> at
>
> org.apache.camel.script.osgi.Activator$BundleScriptEngineResolver.getFactory(Activator.java:229)
> at
>
> org.apache.camel.script.osgi.Activator$BundleScriptEngineResolver.getScriptNames(Activator.java:210)
> at
>
> org.apache.camel.script.osgi.Activator$BundleScriptEngineResolver.access$000(Activator.java:191)
> at
>
> org.apache.camel.script.osgi.Activator.getAvailableScriptNames(Activator.java:118)
> at
>
> org.apache.camel.script.osgi.Activator.updateAvailableScriptLanguages(Activator.java:138)
> at
> org.apache.camel.script.osgi.Activator.serviceChanged(Activator.java:184)
> at
>
> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)
> at
>
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
> at
>
> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
> at
> org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4419)
> at
> org.apache.felix.framework.Felix.registerService(Felix.java:3423)
> at
>
> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)
> at
>
> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:320)
> at
>
> org.apache.camel.impl.osgi.Activator$BaseService.doRegister(Activator.java:515)
> at
>
> org.apache.camel.impl.osgi.Activator$BaseService.doRegister(Activator.java:507)
> at
>
> org.apache.camel.impl.osgi.Activator$BundleMetaLanguageResolver.register(Activator.java:282)
> at
> org.apache.camel.impl.osgi.Activator.addingBundle(Activator.java:129)
> at
>
> org.apache.camel.impl.osgi.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:431)
> at
>
> org.apache.camel.impl.osgi.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
> at
>
> org.apache.camel.impl.osgi.tracker.AbstractTracked.track(AbstractTracked.java:234)
> at
>
> org.apache.camel.impl.osgi.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:407)
> at
>
> org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:868)
> at
>
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:789)
> at
>
> org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:514)
> at
> org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4403)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:2092)
> at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
> at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
> at
>
> org.apache.karaf.features.internal.FeaturesServiceImpl.startBundle(

Re: Stopping file reading via splitter on exception?

2015-09-02 Thread Raul Kripalani
Hey,

You might want to look at the Splitter's stopOnException and
shareUnitOfWork options [1].

[1] https://camel.apache.org/splitter.html

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Sep 2, 2015 at 11:28 PM, furchess123  wrote:

> Hi,
> I am using Splitter to read and process files line by line. The Splitter
> definition is actually a small nested route within the parent main route.
> The Splitter tokenizes by line breaks and groups lines into N lines before
> handing them to the processor bean. If a system/application exception
> occurs
> processing any particular group of lines from the file, I want the route to
> stop processing the file and jump to the end of the parent route.
>
> Right now, I have my exception handling configured in the following way (to
> handle all uncaught application errors):
>
>
>
> *onException(Exception.class).process(errorHandler).handled(true).to("direct:writeToErrorFileEndpoint");*
>
> where "/direct:writeToErrorFileEndpoint/" is the starting endpoint of
> another tiny route that writes out the error report accumulated in the
> exchange.
>
> The way it works now: any system error that occurs during the given file
> fragment (group of lines) processing is handled by my /errorHandler/ bean,
> the error report is appended to the errors file, and the next group of
> lines
> is picked up by the Splitter, and so on... So, the file is always read to
> the very end.
>
> What I want is to STOP processing the file after the first system error is
> caught and handled. I think it may have worked as I wanted before I
> extracted then splitter part into its own route - for code clarity, but, in
> any case, I am looking for the best strategy to instantly - and gracefully
> -
> complete the Main route if any system exception occurs (an exception that
> indicates a programming or system error and does not have a specific
> handler) without processing the rest of the file, or stopping the route.
>
> Thanks for any advice.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Stopping-file-reading-via-splitter-on-exception-tp5771181.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: PEM File for Authentication in route

2015-09-02 Thread Raul Kripalani
1. sslContextParameters is a component option, which means you need to
configure it in the component, not in the endpoint.





2. I don't think the  element supports nesting the
 element. Note how it is configured here [1].

[1] https://camel.apache.org/camel-configuration-utilities.html

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Sep 2, 2015 at 11:09 PM, anish.somadevan  wrote:

> Am not able to make any progress beyond this. Can you please let me know if
> there is anything that am missing in my implementation?
>
> Thanks,
> Anish
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/PEM-File-for-Authentication-in-route-tp5771084p5771180.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel extra jcifs for camel 2.15.x ?

2015-09-02 Thread Raul Kripalani
Hello,

There has been no release of camel-extras partly due to the fact that
Google Code is being switched off and the Camel community is pending a
decision from ASF ComDev with regards to the upcoming home of Apache Extras
projects.

The thread is here [1] but there seems to be no conclusion or immediate
roadmap.

[1]
https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3c559ec097.7000...@apache.org%3E

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Sep 1, 2015 at 3:08 PM, rwijngaa 
wrote:

> Hi,
>
> Where can i find the 2.15 version for camel-jcifs ?
>
> The last version on maven central is 2.14.1
>
>
> http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache-extras.camel-extra%22%20AND%20a%3A%22camel-jcifs%22
>
> Regards
> Rino
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-extra-jcifs-for-camel-2-15-x-tp5771125.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: what's happening to camel extra?

2015-09-02 Thread Raul Kripalani
Hey guys,

Do we have an update on the ASF front about the Apache Extras migration?
Users are asking for new releases of camel-extras components...

I quickly went through the ComDev thread but found no conclusion. Maybe I
overlooked an email in that thread. Things tend to get very chatty over
there and there's no clearly marked conclusion email.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Aug 21, 2015 at 8:56 AM, Pontus Ullgren  wrote:

> From this thread[1]  it seems that Daniel Gruno is the one in charge for
> the move.
> However I fail to find any indication on the progress or roadmap.
> Using Github as a backup plan does NOT[2] seem to be a option in the
> opinion of the community-dev decision.
> Anyway perhaps we should move this discussion to the camel-dev mailinglist.
>
> [1]
>
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3C559EC097.7000707%40apache.org%3E
> [2]
>
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3cby2pr03mb490b6943e12f5d925203a2e99...@by2pr03mb490.namprd03.prod.outlook.com%3E
>
> // Pontus
>
> On Fri, 21 Aug 2015 at 07:17 Christoph Emmersberger 
> wrote:
>
> > Is there any date when this move is expected? We have still the backup
> plan
> > with Github in place, ...
> >
> > On Thu, Aug 20, 2015 at 6:54 AM, Pontus Ullgren 
> wrote:
> >
> > > Diging through the community development list shows that it will be
> moved
> > > to sourceforge along with the rest of the apache extra.
> > >
> > >
> > >
> >
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/browser
> > >
> > > On Thu, 20 Aug 2015 14:12 Pontus Ullgren  wrote:
> > >
> > > >
> > > > Yes this has been discussed on the dev list[1][2] and the Apache
> > > community
> > > > development mailing list [2].
> > > >
> > > > Unfortuantly there does not seem to be any conclusion on this
> > discussion
> > > > yet.
> > > >
> > > > // Pontus
> > > >
> > > > [1]
> > > >
> > >
> >
> http://camel.465427.n5.nabble.com/Moving-camel-extra-to-github-tt5764066.html
> > > > [2]
> > > >
> > >
> >
> http://camel.465427.n5.nabble.com/PROPOSAL-camel-extra-moves-forward-tt5765822.html
> > > > [3]
> > > >
> > http://www.apache.org/foundation/mailinglists.html#foundation-community
> > > >
> > > >
> > > > On Wed, 19 Aug 2015 at 18:53 Tim Dudgeon 
> > wrote:
> > > >
> > > >> Now that the Google code site is about to switch to read only
> > > >> (https://code.google.com/a/apache-extras.org/p/camel-extra/) I
> > wondered
> > > >> what is going to happen to the Camel Extras stuff?
> > > >>
> > > >> Tim
> > > >>
> > > >
> > >
> >
>


Re: REST (DSL) in ?

2015-09-02 Thread Raul Kripalani
Hi,

Could you please open a JIRA [1] ticket for this improvement?

[1] https://issues.apache.org/jira/browse/CAMEL

Thanks,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Sep 2, 2015 at 2:36 PM, Scott Stroud 
wrote:

> Is the  declaration only supported in the  (in Spring
> DSL)?  And not the RouteContext?  If not, is there any plan to support
>  in the ?
>
> I believe its a very common approach to define routes into (domain)
> specific files and then import them into the camel-context via Spring, then
> use a  to include them in the  and it would
> be desirable to be able to define those  routes in those (domain)
> specific route files.  Im using Camel 2.15.3.  Thanks.
>
>
>
>
>
>
>


Re: component couchdb

2015-09-02 Thread Raul Kripalani
Hey,

Thanks for posting the problem and the solution!

Which version of Karaf are you using?

We may be able to fix the issue in the features descriptor.

Thanks,
Raúl.
On 1 Sep 2015 20:41, "Hilderich"  wrote:

> Hello fellows,
>
> In my camel route (Apache Camel 2.15.2) I'd like to use the component
> couchdb and I have follow all instructions as here:
>
> http://camel.apache.org/couchdb.html
>
> My camel route runs in Apache Karaf and when I try to start the bundle with
> the camel context I get the following error:
>
> I have commons-logging installed via
>
> but it has not fixed the problem.
>
> Any Ideas?
>
> Every hint is appreciated. Thanks!
> Hilderich
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/component-couchdb-tp5771133.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Groovy DSL

2015-09-02 Thread Raul Kripalani
Hi Reji,

Yeah, users tend to use Java DSL or the XML DSLs (Spring or Blueprint) more
frequently. Consequently the number Groovy DSL-related topics will be
lower, as well as the attention that the contributors and committers give
to this DSL. I guess you have already come across the Groovy DSL page [1].

Our DSL just provides extensions and a fluid syntax on top of the Java DSL,
as well as the ability to define shortcuts or custom DSLs easily. I suggest
you play around with it and if you encounter any issues or cases where the
DSL is unlevelled (i.e. recently developed Java DSL or XML DSL features
that have not yet been ported to the Groovy DSL), ping the mailing list for
help.

[1] https://camel.apache.org/groovy-dsl.html

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Sep 2, 2015 at 3:34 PM, contactreji  wrote:

> Hi all
>
> Was wondering if we have any camel component documentations which can help
> in exploring more on camel groovy dsl and its usage.
>
> How do we declare the cxf endpoints, endpoint security configurations and
> use them in camel groovy dsl?
>
> Again, I see very less support for groovy dsl on the forums.
>
> Cheers
> Reji
>
>
>
> -
> Reji Mathews
> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
> & Jboss Fuse ESB | Mule ESB )
> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
> Twitter - reji_mathews
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Groovy-DSL-tp5771161.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: JSON to XML Conversion

2015-09-02 Thread Raul Kripalani
I'm not suggesting that you use JAXB. I just wanted you to try defining the
JSON to XML data format nested inside the unmarshal.
On 2 Sep 2015 02:06, "anish.somadevan"  wrote:

> Am actually trying to convert a JSON response from an API to XML, and i
> don't
> think it can be done using JAXB. Please correct me if am wrong.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JSON-to-XML-Conversion-tp5771032p5771141.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: JSON to XML Conversion

2015-09-01 Thread Raul Kripalani
You don't need to use ref. Have a look at the first XML example for the
JAXB data format here: http://camel.apache.org/jaxb.html.

Raúl. No
On 2 Sep 2015 01:25, "anish.somadevan"  wrote:

> Am not sure if i have implemented it as you said. This is what i have in my
> route now,
>
> http://camel.apache.org/schema/spring";>
> 
> 
>  trimSpaces="true" rootName="newRoot" skipNamespaces="true"
> removeNamespacePrefixes="true" expandableProperties="d e"/>
> 
>
> 
> 
>
> 
> 
>
> 
> 
> 
>
>
> I still get the same error
>
>  Failed to create route parseJSON at: >>> Unmarshal[ref:xmljsonWithOptions]
> <<< in route: Route[[From[direct:inter2]] ->
> [Unmarshal[ref:xmljsonWithOpt... because of Cannot find data format in
> registry with ref: xmljsonWithOptions
>
>
> But when i have just "xmljson" in the route, everything works fine,
>
> 
> 
>
> 
> 
>
> 
> 
> 
>
> Can you let me know your thoughts on this. Am facing issue wherever am
> trying to refer something from registry.
>
> Thanks,
> Anish
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JSON-to-XML-Conversion-tp5771032p5771139.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: JSON to XML Conversion

2015-09-01 Thread Raul Kripalani
Aha! So you are using the  XML approach to load your routes.

You can define data formats in two places: either (a) inside your Camel
Context, which, if you are using exactly this approach [1], is being
configured programmatically, or (b) inline inside your marshal / unmarshal
XML element.

I would suggest you try (b):





[1] http://camel.apache.org/loading-routes-from-xml-files.html

Regards,
Raúl.
On 1 Sep 2015 23:55, "anish.somadevan"  wrote:

> I currently have this as the first line in my XML.
>
> http://camel.apache.org/schema/spring";>
> And then i have defined the camelContext tags,
> 
> 
> 
>  trimSpaces="true" rootName="newRoot" skipNamespaces="true"
>  removeNamespacePrefixes="true" expandableProperties="d e"/>
> 
> 
> 
>
> When i tried to give camelContext as the first line, I get this error
>
> unexpected element (uri:"http://camel.apache.org/schema/spring";,
> local:"camelContext"). Expected elements are
> <{http://camel.apache.org/schema/spring}aggregate>,<{
> http://camel.apache.org/schema/spring}aop>,<{
> http://camel.apache.org/schema/spring}avro>,<{
> http://camel.apache.org/schema/spring}batchResequencerConfig>,<{
> http://camel.apache.org/schema/spring}bean>,<{
> http://camel.apache.org/schema/spring}beanio>,<{
> http://camel.apache.org/schema/spring}bindy>,<{
> http://camel.apache.org/schema/spring}castor>,<{
> http://camel.apache.org/schema/spring}choice>,<{
> http://camel.apache.org/schema/spring}constant>,<{
> http://camel.apache.org/schema/spring}contextScan>,<{
> http://camel.apache.org/schema/spring}convertBodyTo>,<{
> http://camel.apache.org/schema/spring}crypto>,<{
> http://camel.apache.org/schema/spring}csv>,<{
> http://camel.apache.org/schema/spring}customDataFormat>,<{
> http://camel.apache.org/schema/spring}customLoadBalancer>,<{
> http://camel.apache.org/schema/spring}dataFormats>,<{
> http://camel.apache.org/schema/spring}delay>,<{
> http://camel.apache.org/schema/spring}description>,<{
> http://camel.apache.org/schema/spring}doCatch>,<{
> http://camel.apache.org/schema/spring}doFinally>,<{
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JSON-to-XML-Conversion-tp5771032p5771137.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: [Camel-Kafka] Value of KafkaConstants.KEY constant

2015-09-01 Thread Raul Kripalani
Hi,

Good point.

Maybe Samuel (the contributor of camel-kafka, CC'ed) can have a look for us
;-)

We should also harmonise the header names with the style we use in other
components: CamelKafka... (upper camel case starting with Camel, followed
by component name, then header name).

We could only include this change for 2.16 but not for the 2.15.x or 2.14.x
release lines.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Sep 1, 2015 at 11:34 AM, Rahul Jain  wrote:

> In KafkaConstants, the constant "KEY" is declared as
>
> * public static final String KEY = "kafka.CONTENT_TYPE";*
>
> This is used to store the kafka message key in exchange. But why do we
> refer to it as CONTENT_TYPE  here?
>


Re: PEM File for Authentication in route

2015-08-31 Thread Raul Kripalani
It depends on what your PEM file contains and what the server is requesting
of you.

The PEM file may contain a private key for client SSL authentication, in
which case you need to use the camel-http4 [1] sslContextParameters option
to configure the keystore, key alias, keystore passwd, key passwd, etc.
using the Camel JSSE Configuration Utility (modelled after CXF SSL config
approach) as indicated in [2].

If the PEM file contains a certificate for the remote server which you need
to trust, then you're probably better off adding it to your server's
truststore and using the JVM options to pass in the location, password,
etc. If you don't want to add the certificate to the server-wide
truststore, you may use the JSSE Config Utility to configure it separately
in this particular endpoint.

[1] https://camel.apache.org/http4.html
[2]
https://camel.apache.org/http4.html#HTTP4-UsingtheJSSEConfigurationUtility

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Mon, Aug 31, 2015 at 11:47 PM, anish.somadevan 
wrote:

> Am trying to use Http4 or SSH components. Can you please let me know how to
> resolve this issue using these components?
>
> Thanks,
> Anish
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/PEM-File-for-Authentication-in-route-tp5771084p5771107.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: PEM File for Authentication in route

2015-08-30 Thread Raul Kripalani
Yes, but which component exactly? We have many for the HTTP transport.
On 31 Aug 2015 00:31, "anish.somadevan"  wrote:

> Its a HTTPS call, and am using recipeintList coz i need to construct
> dynamic
> URI. Also, due to some compatibility issues i can use only 2.10.3 version
> camel JARs.
>
> Thanks,
> Anish
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/PEM-File-for-Authentication-in-route-tp5771084p5771089.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Send Message to a queue before start & end of a route starts prcoessing

2015-08-30 Thread Raul Kripalani
BeforeConsumer means that the logic will be executed before the consumer
finishes, ie. when the route ends and before returning the response to the
caller if InOut and/or before executing the Exchange.done().

To capture the start of the route, you may want to look at interceptFrom.

Regards,
Raúl.
On 28 Aug 2015 14:50, "fxthomas"  wrote:

> sorry it works , but not the way i want it to be.
>
> the Start message comes in the end of the queue just before the end message
> entry, ideally i thought it would be the first message in the queue , but
> its the second last .
>
> any workarounds ?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Send-Message-to-a-queue-before-start-end-of-a-route-starts-prcoessing-tp5771056p5771061.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: PEM File for Authentication in route

2015-08-30 Thread Raul Kripalani
I assume this is an HTTP call. Which component are you using in your
producer endpoint?

Raúl.
On 30 Aug 2015 22:42, "anish.somadevan"  wrote:

> I have a route where i need to make a GET request to an API which is hosted
> on a server. The authentication is done using a PEM file. Is there a way i
> can include PEM file foe authentication in my route? I need to do this in
> Spring DSL XML. Can anyone please let me know if this is possible?
>
> Thanks,
> Anish
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/PEM-File-for-Authentication-in-route-tp5771084.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: JSON to XML Conversion

2015-08-30 Thread Raul Kripalani
Do you have camel-xmljson in your classpath?

Regards,
Raúl.
On 30 Aug 2015 22:38, "anish.somadevan"  wrote:

> Hi Yogesh,
>
> I did define it as you mentoned, and referenced it in my route as given
> below,
>
> 
> 
>  trimSpaces="true" rootName="newRoot" skipNamespaces="true"
>  removeNamespacePrefixes="true" expandableProperties="d e"/>
> 
>
>
>  
> 
>  
>
>
> But i still get the same error as mentioned earlier,
>
> JmsConsumer[ISEEOutboundQueue]) Apache Camel 2.10.3 (CamelContext: camel-4)
> is starting
> 21:30:46,732 INFO  [org.apache.camel.management.ManagementStrategyFactory]
> (Camel (camelAgent) thread #6 - JmsConsumer[ISEEOutboundQueue]) JMX
> enabled.
> 21:30:46,904 WARN  [org.apache.camel.util.ObjectHelper] (Camel (camelAgent)
> thread #6 - JmsConsumer[ISEEOutboundQueue]) Cannot find class:
> xmljsonWithOptions
> 21:30:46,905 INFO  [org.apache.camel.impl.DefaultCamelContext] (Camel
> (camelAgent) thread #6 - JmsConsumer[ISEEOutboundQueue]) Apache Camel
> 2.10.3
> (CamelContext: camel-4) is shutting down
> 21:30:46,909 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter]
> (Camel (camelAgent) thread #6 - JmsConsumer[ISEEOutboundQueue])
> TypeConverterRegistry utilization[attempts=1, hits=1, misses=0, failures=0]
> mappings[total=186, misses=0]
> 21:30:46,911 INFO  [org.apache.camel.impl.DefaultCamelContext] (Camel
> (camelAgent) thread #6 - JmsConsumer[ISEEOutboundQueue]) Apache Camel
> 2.10.3
> (CamelContext: camel-4) is shutdown in 0.006 seconds. Uptime 0.191 seconds.
> 21:30:46,913 INFO  [com.acp.adapter.cameladapter.CamelOutboundAdapter]
> (Camel (camelAgent) thread #6 - JmsConsumer[ISEEOutboundQueue])
> CamelOutboundAdapter exception: Failed to create route parseJSON at: >>>
> Unmarshal[ref:xmljsonWithOptions] <<< in route: Route[[From[direct:inter2]]
> -> [ConvertBodyTo[java.lang.Stri... because of Cannot find data format in
> registry with ref: xmljsonWithOptions
>
>
> I see a warning mentioning that the class is not found
> 21:30:46,904 WARN  [org.apache.camel.util.ObjectHelper] (Camel (camelAgent)
> thread #6 - JmsConsumer[ISEEOutboundQueue]) Cannot find class:
> xmljsonWithOptions
>
> But when i refer my just "xmljson" in my route, it works fine. The JSON
> gets
> converted to XML.
> 
> 
>  
>
> Please let me know how to resolve this.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JSON-to-XML-Conversion-tp5771032p5771083.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Velocity pass ArrayList

2015-08-28 Thread Raul Kripalani
I assume you mean a JMS queue. Is your class Serializable? If not, it'll
not get passed on.

Try making it Serializable and let us know.

Thanks,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Aug 28, 2015 at 2:52 PM, Copernico  wrote:

> OK. It's working now. I had to change my routerbuilder class. Before, i
> had a
> bean to query the items in the database, put the headers and send it to a
> queue. In another route, after consumed this, passed it to velocity
> component producer and send it with smtp.
>
> Now i pass the query items to the velocity template directly and then send
> it to the queue where the other route sends the email. I don't know why
> camel does not keep references to the object pased in the header.
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Velocity-pass-ArrayList-tp5771027p5771062.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Velocity pass ArrayList

2015-08-28 Thread Raul Kripalani
Ah, of course, I missed that. Sifting through emails too quickly ;-)

What version of Camel are you on?

Could JPA lazy loading be the culprit here? Can you switch to eager loading?

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Aug 28, 2015 at 1:08 PM, Copernico  wrote:

> Yes. I'm sure. The code is working. All this code is inside a bean not in
> my
> route builder class. From the route builder, i generate the email, pass the
> template to velocity and send email.
>
> The code is working because i send the email to myself and i can see the
> body of the email as i said before:
>
> Template
>
> *
> Dear ${headers.name}
>
> You request ${headers.itemList.size} items
>
> #foreach(${item} in ${headers.itemList})
>  Item ${item.description} - ${item.price}
> #end *
>
> Email
> *
> Dear George
>
> You request ${headers.itemList.size} items
>
> /(the item list should go here)/
> *
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Velocity-pass-ArrayList-tp5771027p5771054.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Velocity pass ArrayList

2015-08-28 Thread Raul Kripalani
The signature of .setHeader() is .setHeader(String headerName, Expression
expression).

Your itemList() method returns a List, so I'm pretty sure something's
missing here.

Are you sure that's the code you're running?

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Aug 28, 2015 at 12:33 PM, Copernico  wrote:

> private List itemList(){
>   Query query = em.createNamedQuery("Items.findByDescription",
> Items.class);
>   query.setParameter("description", "something");
>
>   if(query.getResultList() != null && !query.getResultList().isEmpty()){
>   return query.getResultList();
>   }
>
>   return new ArrayList();
> }
>
>
> The function is working well: when i debugging the fuction it returns a
> list
> of item (is not empty). The problem is with adding the list to the header
> and using it in a foreach loop in velocity template.
>
> So the custion is how to use this array list in a foreach loop in velocity?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Velocity-pass-ArrayList-tp5771027p5771052.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: http4 ignoring CamelHttpPath

2015-08-27 Thread Raul Kripalani
On Thu, Aug 27, 2015 at 4:16 AM, Minh Tran  wrote:

>  uri="http4:myhost:80?httpclient.connectTimeout=1&httpclient.socketTimeout=12"/>
>

You have a typo related to casing. The option prefixes are httpClient
(capital C, using lowerCamelCase).

Nevertheless, we do have a bug because your options are being interpreted
as query parameters, so Camel should really be invoking this URL:

http://myhost:80/my/path?httpclient.connectTimeout=1&httpclient.socketTimeout=12

But is instead using this URL:

http://myhost:80?httpclient.connectTimeout=1&httpclient.socketTimeout=12/my/path

(path and query parameters are concatenated in the wrong order).

Working on that: CAMEL-9104

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk


Re: http4 ignoring CamelHttpPath

2015-08-27 Thread Raul Kripalani
I don't think it's expected behaviour. Normally I configure timeouts and
the like in the AsyncHttpClientConfig directly. Doing that, the
CamelHttpPath header works properly.

I will check what you said, but it definitely sounds like a bug.

Raúl.
On 27 Aug 2015 04:17, "Minh Tran"  wrote:

> Hi
>
> I've come across a strange behaviour with the http4 component on 2.15.2.
> If I have the following in my route
>
> 
> /my/path
> 
> 
>
> then it works just fine hitting http://myhost:80/my/path
>
>
> However I now have a need to set the connect and read timeouts on this so
> I've done the following
>
> 
> /my/path
> 
>  uri="http4:myhost:80?httpclient.connectTimeout=1&httpclient.socketTimeout=12"/>
>
>
> Now it ignores the CamelHttpPath header and hits http://myhost:80. I can
> verify this by enabling logging in httpclient.
>
> If I then change it to the following where I add the path directly to the
> uri and skip the setHeader element
>
>  uri="http4:myhost:80/my/path?httpclient.connectTimeout=1&httpclient.socketTimeout=12
> "/>
>
> It hits the correct link. So it looks like the CamelHttpPath gets ignored
> if I add any options to the http4 uri. Is this expected behaviour?
>
> Thanks
> Minh


Re: CXF SOAP Message Sent from a Camel Client Twice When No HTTP Response Received

2015-08-27 Thread Raul Kripalani
Are you sure the first request was not an HTTP request that ended with an
401 Unauthorized?

Are you using some kind of HTTP auth? If that's the case and you don't set
up preemptive auth (for HTTP Basic), it is expected for the server to see 2
wire requests.

Could you please try enabling the CXF Logging interceptors, or the Logging
feature? (same thing)

Also, it would help to see your code and configuration.

Thanks!
On 27 Aug 2015 12:11, "segev"  wrote:

> We came across the following issue when using the Camel CXF component to
> invoke a SOAP request with Payload mode over HTTPS on a third party
> service.
>
> The third party server provides two endpoints primary and secondary.
>
> As part of certifying our system with this service (fail over test), we
> were
> required to invoke a test request on the primary (which failed with No HTTP
> Response error).
> The Camel client sent one message (as observed on our Camel Trace log) but
> the server received two requests.
> We used soapUI client to invoke the same test server just to confirm that
> the server register one request only.
>
> Note that the 'Redelivery Policies' were configured with
> 'maximumRedeliveries' of 0.
>
> We ended up replacing the "cxf://.." endpoint with a 'processor' with
> Apache
> HTTPClient and this solve the duplicate message being sent.
>
> We couldn't find any obvious setting on the cxf configuration or the HTTP
> Conduit to prevent this from happening.
> Any suggestions on what may cause a 'NoHttpResponse' error to trigger
> sending a second message will be appreciated.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/CXF-SOAP-Message-Sent-from-a-Camel-Client-Twice-When-No-HTTP-Response-Received-tp5771010.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Velocity pass ArrayList

2015-08-27 Thread Raul Kripalani
Could you please paste the itemList() function?

Thanks.
On 27 Aug 2015 18:17, "Copernico"  wrote:

> Hi!
>
> I have a velocity template for send an email. In this template i send to
> our
> clients a list of items (JPA Entities) as an arraylist (is a result of a
> query which size may be diferent each time)
>
> Dear ${headers.name}
>
> You request ${headers.itemList.size} items
>
> #foreach(${item} in ${headers.itemList})
>  Item ${item.description} - ${item.price}
> #end
>
> With Java DSL i put the headers
>
> exchange.getIn().setHeader("name", client.getName());
> exchange.getIn().setHeader("itemList", itemList());
>
>
> But the testing email i receive, does not have the items list from the
> arraylist (the foreach loop is not working) and camel is not replacing
> ${headers.itemList.size}
>
> Dear George
>
> The items
>
> You request ${headers.itemList.size} items
>
>
> Any Ideas? How i pass objects like a pojo, a jpa entity, an arraylist to
> the
> velocity template and access to their properties?
>
> Thanks,
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Velocity-pass-ArrayList-tp5771027.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Is it safe to use ThreadLocal to implement route scope for dependency injection?

2015-08-27 Thread Raul Kripalani
Typically what you would do is store the object you want to propagate in an
Exchange property, eg. just before a threads() DSL.

On the other side of the concurrency threshold, you would unwrap the object
back into its thread-bound structure from the Exchange property.

If you have a look at the feature/camel-hystrix branch, I'm implementing
something similar to propagate the HystrixRequestContext, which is
otherwise thread-bound.

Raúl.
On 27 Aug 2015 21:16, "Jan Zankowski"  wrote:

> Right - I just found your code. The limitation you mention - async
> processors, threads(), multicast() - is exactly what the approach I
> describe is meant to overcome.
>
> When a situation like that happens, i.e. a new thread takes over, it gets a
> copy of the original exchange, and an ExchangeCreateEvent is fired in it,
> allowing a listener to set the copy of exchange on the new thread's
> ThreadLocal. This should provide continuity of route scope.
>
> This is what the author of the code I point to claims, and it seems to
> work. My main question is: is this guaranteed to work? I.e., if adjacent
> components A and B on the same route are executed by different threads, can
> I always be sure that the new thread (or threads) executing B will each
> copy the exchange and fire ExchangeCreatedEvent before executing B?
>
> On Thu, Aug 27, 2015 at 8:19 PM, Romain Manni-Bucau  >
> wrote:
>
> > this is what I used to implement an @ExchangeScoped but it has several
> > limitation, in particular when breaking the flow with .threads() or
> > .multicast(). All is explained on
> > http://camel.apache.org/threading-model.html .
> >
> > Using a camel interceptor would surely allow to pass the context through
> > the exchange and therefor avoid this ThreadLocal but this needs few more
> > setup and is less "magic".
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau  |  Blog
> >  | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn  | Tomitriber
> > 
> >
> > 2015-08-27 20:13 GMT+02:00 Jan Zankowski :
> >
> > > Just wanted to ping the thread in the hope someone will offer help.. I
> > > think the answer may also be useful to people in other situations who
> > > wonder how Camel works under the hood with regard to threads. Thanks!
> > >
> > > On Mon, Aug 24, 2015 at 12:47 PM, Jan Zankowski <
> jan.zankow...@gmail.com
> > >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > My goal is to implement DB multitenancy in a Camel application using
> > > > Hibernate and Spring. For this, I need to implement the following
> > > Hibernate
> > > > interface, which gets called on each read/write to the DB.
> > > >
> > > > public interface CurrentTenantIdentifierResolver {
> > > >   public String resolveCurrentTenantIdentifier();
> > > >   [...]
> > > > }
> > > >
> > > > Because the method doesn't take any parameters, it either needs to
> use
> > > (1)
> > > > some static context knowing which tenant the current route execution
> > > > belongs to, or (2) a dependency-injected manager holding such a
> > context.
> > > >
> > > > (1) points me to using ThreadLocal holding the current Exchange as it
> > > > travels down the route. The Exchange can have some custom field
> > > indicating
> > > > the tenant.
> > > > (2) requires using "route scope" - where each route execution gets
> its
> > > own
> > > > instance of context manager injected into
> > > CurrentTenantIdentifierResolver.
> > > > Implementing the route scope, however, seems to require the same as
> > (1) -
> > > > ThreadLocal referencing the Exchange.
> > > >
> > > > I found the following article (& Git repo) implementing "route scope"
> > > > exactly in this way:
> > > > https://blog.jyore.com/2015/01/spring-camel-route-bean-scoping/ It
> > > claims
> > > > to take advantage of the fact that if a new thread starts processing
> > the
> > > > Exchange as it travels down the route, for example after a
> > > > parallel-processing multicast, the new thread gets a copy of the
> > original
> > > > Exchange, and an ExchangeCreatedEvent is fired, allowing a listener
> to
> > > set
> > > > the ThreadLocal on the new thread.
> > > >
> > > > I was able to get this to work, though clearing of the ThreadLocal on
> > > > ExchangeCompletedEvent doesn't work as the author claims, because the
> > > event
> > > > is fired on a different thread (I checked).
> > > >
> > > > Such issues make me wonder if it's safe to use such a solution.
> > > >
> > > > I have the following questions in particular:
> > > > (a) Let's assume an Exchange E is travelling down a route with a
> > segment
> > > > ... -> A -> B -> ... If A and B are executed by different threads, is
> > it
> > > > guaranteed that the new thread (or threads) executing B will each
> copy
> > > the
> > > > exchange and fire ExchangeCreatedEvent before executing B?
> > > > (b) Why is ExchangeCompletedEvent sent by a different t

Re: Getting JMSConsumer to look for messages every N seconds

2015-08-26 Thread Raul Kripalani
Currently I think that we only support fixed schedules. So with the cron
scheduler you could achieve something like: start/resume the route on every
minute at 00 and 30 seconds, stop/suspend every minute at 10 and 40 seconds
time marks.

This would effectively keep your route running for 10 seconds every 30
seconds.

If you want something more sophisticated, like stopping it once the queue
is empty, you would need to extend what we offer OOTB with your own logic.

Maybe you want to stop the route when t be consumer has been inactive for 1
second or 500ms, or when queue size is 0 at the broker (checking via JMX).

Raúl.
On 26 Aug 2015 23:19, "gilboy"  wrote:

> Thanks for the feedback. So just to confirm if I have the following route
> and
> I want to consume a message every 30 seconds would I inject in to the route
> a RoutePolicy(e.g. SimpleScheduledRoutePolicy) where I specify the
> routeStartRepeatInterval(30 seconds). I feel like I am missing something.
> What shuts down the route etc
>
> from("jms:endpointDetails")
>.routeId("test")
>.routePolicy(policy)
>.to("mock:success");
>
> Thanks
> Joe
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Getting-JMSConsumer-to-look-for-messages-every-N-seconds-tp5770986p5770997.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Getting JMSConsumer to look for messages every N seconds

2015-08-26 Thread Raul Kripalani
Yes, you can use a Scheduled Route Policy [1] to schedule the activation
and deactivation of your route. That, with a JMS consumer, should do the
trick.

[1] https://camel.apache.org/scheduledroutepolicy.html

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Aug 26, 2015 at 11:18 AM, gilboy  wrote:

> Hi
>
> I have a use case where I want to take messages from a DLQ and place them
> back on to main/primary queue which feeds the application. I want to move
> the messages every 10 seconds. I have looked at the delayer EIP but I would
> prefer take them from the DLQ every 10 seconds rather than taking them as
> they become available and storing them in memory.
>
> Is there any way I can get my JMSConsumer to look for messages every 10
> seconds
>
> Thanks
> Joe
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Getting-JMSConsumer-to-look-for-messages-every-N-seconds-tp5770986.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: What language is jsonpath looking for?

2015-08-25 Thread Raul Kripalani
The JSON data format and the jsonpath language are different things in
Camel.

You should add the camel-jsonpath module to your classpath, or if you are
on OSGi and Karaf, simply install the feature with the same name.

Hope that helps,
Raúl.
On 25 Aug 2015 22:44, "shuston"  wrote:

> I am trying to run the following route. The purpose of this is to look in
> the
> body (json) and based on the header's name field, unmarshall to a POJO then
> continue. If there's a better way to accomplish this (there will need to be
> more types, of course) I am very happy to hear that too.
>
> 
>unmarshalTypeName="my.class.path.VerifyEmployeeRequest"/>
> 
>
> 
>   
>   
> 
>   $.header[?(@.name ==
> "VerifyEmployeeRequest")]
>   
> 
>   
>   
>   
> 
>
> At runtime I get this exception:
> Caused by: org.apache.camel.NoSuchLanguageException: No language could be
> found for: jsonpath
>
> What language is this looking for and how do I get it?
>
> Thank you,
> Steve Huston
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/What-language-is-jsonpath-looking-for-tp5770979.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: OSGI Service look up

2015-08-18 Thread Raul Kripalani
Are you using Spring or Blueprint in your Camel application? If yes, you
can use  elements to get a hold of the OSGi Service.

Otherwise, since you haven't indicated what 'ctx' is in your example, and
judging by your lookup notation, I will assume it is an InitialContext
plumbed against Aries JNDI.

In that case, there are several ways to achieve what you're after depending
on what you have in your Camel registry and how often you want to look up
the service (just once at initialization, with every Exchange, etc.).

If you specify your use case a little more, we'll be able to help you
better.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Aug 11, 2015 at 4:54 PM, akoufoudakis 
wrote:

> Dear all!
>
> I know that one can lookup for an OSGi service the following way:
> Runnable r = (Runnable) ctx.lookup("osgi:service/java.lang.Runnable");
> Can you do anything similar inside your camel route?
>
> Thank you in advance.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/OSGI-Service-look-up-tp5770588.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: spring osgix:cm-properties not reloading the properties

2015-08-15 Thread Raul Kripalani
Have a look at [1], section 9.1.2.1.

[1]
http://docs.spring.io/spring-osgi/docs/1.2.0-m2/reference/html/compendium.html

Raúl.
On 15 Aug 2015 09:29, "chaituu"  wrote:

> properties are getting not reloaded in case of spring dm.it works fine in
> case of blue print xml and properties are reloaded when changes happen and
> deploy the profile in jboss fuse.
>
> in blueprint cm:property-placeholder is having update-strategy attribute
> which does the properties reloaded where as in spring dm
> osgix:cm-properties does not have reload property .properties are not
> getting refreshed in spring.
>
> blueprint
> *
>
>  update-strategy="reload"/>
>
> spring
> **
>
>  
> 
> 
>
> http://www.osgi.org/xmlns/blueprint/v1.0.0";
>
> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0";
>
> xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0";>
>
>
>  update-strategy="reload"/>
>
>  xmlns="http://camel.apache.org/schema/blueprint"; >
>  location="blueprint:myConfig"/>
>
> 
>   
> 
> Hello from Fabric based Camel route!
> 
> 
> 
> 
>
> 
> **
> 
>
> http://www.springframework.org/schema/beans";
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xmlns:camel="http://camel.apache.org/schema/spring";
>xmlns:osgix="http://www.springframework.org/schema/osgi-compendium";
>xmlns:ctx="http://www.springframework.org/schema/context";
>xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
> http://www.springframework.org/schema/osgi-compendium
>
> http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
> http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd";>
>
>
>
>
>
>  xmlns="http://camel.apache.org/schema/spring"; >
>
>
>
>
> 
>   
> 
> Hello from Fabric based Camel route!
> 
> 
> 
> 
>
> 
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/spring-osgix-cm-properties-not-reloading-the-properties-tp5770739.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Construct Dynamic URI

2015-08-09 Thread Raul Kripalani
Yes, it's possible. But the to EIP is not dynamic. You need to use
 instead.

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Sun, Aug 9, 2015 at 10:52 PM, anish.somadevan  wrote:

> Am trying to construct a dynamic URI using a value from header
>
> When i use in  it is not recognizing the value as a header
>
> https://something.com/{$header.Provider}
>
> but when i use  i don't get any error, but the HTTP call is not
> being made.
>
> https://something.com{header.Provier}
>
> Am using Camel 10.2.3 jar due to some compatibility issues with my
> application. Is there a way i can construct dynamic URI and make HTTP
> calls?
>
> Please let me know if this is possible.
>
> Thanks,
> Anish
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Construct-Dynamic-URI-tp5770500.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Some Stupid Questions

2015-08-03 Thread Raul Kripalani
On 2 Aug 2015 13:05, "Felix Thomas"  wrote:

>  2) Threading :- If I have declared a Bean as above and if I use it in a
> SPLIT in Parallel processing mode using a Thread profile. Will Camel also
> create a Pool of the bean and pass it for each thread. i.e. if my Pool
size
> is 5 will  camel create 5 instance of the bean class and use it in the
> processing automatically.  I want to know if it will be thread safe for
> each bean object.

Camel will not build the bean, but it will request it to the registry. So
it's up to the registry to return a new instance or a singleton. In Spring,
you can configure this with the 'scope' attribute.

I suggest you give it a spin with printlns so you can understand when the
new instances are created.

By default, all registries (Spring, Blueprint, Simple Java) return
singletons.

>
> 3) Database component :-  If i am getting billions of data from a DB using
> a timer component consumer is there any feature that I can mark some
column
> with some flag stating it has been processed .
>
> I saw in the SQL Component there are some option like consumer.onConsume
> etc. but is there something similar in JDBC component .  Other approach is
> to move some records to a temporary table and use that but still some flag
> has to be done on the Original table which is being updated every moment.

I suggest you add a WHERE condition to filter out records that do not have
this flag, and use an onCompletion with onCompleteOnly, in sync mode and
BeforeConsumer, in order to set the flag on the record(s) before the route
is done processing.


Re: Camel XmlJson Question

2015-07-31 Thread Raul Kripalani
Hey,

You have examples of configuration with both Java DSL and the XML-based
DSLs in the documentation [1] [2].

And you can also check out the unit tests [3] if you want to see full
examples.

That is, assuming you are already familiar with Camel. If you are not, you
should start with the usual places instead of digging into camel-xmljson
directly.

[1] https://camel.apache.org/xmljson.html#XmlJson-BasicUsagewithJavaDSL
[2]
https://camel.apache.org/xmljson.html#XmlJson-BasicusagewithSpringorBlueprintDSL
[3]
https://github.com/apache/camel/tree/master/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson

Regards,
Raúl.

On Fri, Jul 31, 2015 at 10:47 AM, srinit  wrote:

> Hi Raul,
>
> I went through that page and unable get how I can use that for my case.
> I don't see any good example for xmljson under Examples section.
>
> - Thanks
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-XmlJson-Question-tp5770021p5770150.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


RE: Camel XmlJson Question

2015-07-31 Thread Raul Kripalani
Hi,

Have you tried using the camel-xmljson data format instead of custom code?

Take a look at the link provided above.

Raúl.
On 31 Jul 2015 08:18, "srinit"  wrote:

> I am trying to xml <==> json using following code
>
> @Override
> public void xml2json(String xml) throws JSONException {
> JSONObject xmlJSONObj = XML.toJSONObject(xml);
> String jsonPrettyPrintString = xmlJSONObj
> .toString(PRETTY_PRINT_INDENT_FACTOR);
> System.out.println(jsonPrettyPrintString);
>
> }
>
> @Override
> public void json2xml(String json) throws JSONException {
> JSONObject jsonObject = new JSONObject(json);
> String xml = XML.toString(jsonObject);
> System.out.println(xml);
> }
>
> For following SOAP message
>
> http://schemas.xmlsoap.org/soap/envelope/";>
> 
> http://service.ws.test..com/";>
> John
> 
> 
> 
>
>
> After xml2json() the output is like
>
> {"soap:Envelope": {
> "soap:Body": {"ns2:helloWorld": {
> "arg0": "John",
> "xmlns:ns2": "http://service.ws.test.x.com/";
> }},
> "xmlns:soap": "http://schemas.xmlsoap.org/soap/envelope/";
> }}
>
> And when convert this json with json2xml() the output is like this
>
> 
> 
> 
> John
> http://service.ws.test..com/
> 
> 
> http://schemas.xmlsoap.org/soap/envelope/
> 
>
> Which is wrong SOAP message, here the namespace information is wrongly
> taken.
> I tried to see, whether json library have something to customize the
> parsing
> and found nothing.
> any help?
>
> Thanks
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-XmlJson-Question-tp5770021p5770099.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: [DISCUSS] Looks like someone feels threatened... (TIBCO vs Open Source ESBs)

2015-04-23 Thread Raul Kripalani
Exactly. And what many fail to see is that closed source is – in many cases
– leveraging OSS under the hood. Sometimes the vendor will be nice and make
it evident (e.g. IBM WebSphere being quite transparent in their docs about
using Apache Aries, they also contribute, etc.).

But in other cases, the end user won't come to know because the licensing
model of the 3rd party libraries is non-viral and doesn't require the
vendor to either keep the original naming, nor acknowledge the usage.

I don't have any numbers to support this, but what I've gathered throughout
many years in the industry is that most proprietary software will be
powered (to varying degrees) by OSS without upfront disclosure. At the end
of the day, as a proprietary vendor, I guess you do need a good reason to
reinvent the wheel, and quite possibly that reason doesn't exist.

In fact, one extreme case that comes to mind was the old BEA WebLogic Event
Server which, if you looked at the lib/ directory of the WAR, just turned
out to be mostly Esper [1] with a fancy GUI and some usability-related
changes. And they sold this for hundreds of thousands of EUR / CPU. (Not
intending to start a flame war nor implying generalisation. Just mentioning
an extreme case I know.)

Actually, you know what? When I get some time I'm going to download TIBCO's
product and inspect their usage of 3rd party libs... From what I remember
back, they did use stuff like Xerces, Xalan, etc. which is pretty
commonplace anyway, but I'd be curious to find out if they use further OSS.

[1] http://www.espertech.com/esper/index.php

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Thu, Apr 23, 2015 at 6:25 AM, Claus Ibsen  wrote:

> Hi Raul
>
> Did you get a chance to continue working on this?
>
> I think for #3 its due to the openes of the source code that people
> dive in and help fix those vulnerabilities as well. And as you say we
> are very open and they get proper registerede with a CVE and listed in
> the public. And we do put out releases with the fixes fairly soon
> after its fixed.
>
> And there is not so many after all that is caused by Apache Camel itself.
>
> Yes if you use CXF, Spring, Jetty etc those libraries may have issues
> as well, but they are also reported in the open and fixed fast. And
> have communities as well, some very big like the spring community.
>
> And those are found and fixed. For the Open Source ESB you would have
> to take a look at
> - CXF
> - ActiveMQ
> - Spring
> - Jetty
> etc to get the "combined picture"
>
> http://cxf.apache.org/security-advisories.html
>
> You can find the Apache products
> http://www.cvedetails.com/product-list/vendor_id-45/Apache.html
>
> On Fri, Apr 17, 2015 at 12:13 PM, Raul Kripalani  wrote:
> > Just found this marketing landing page published on social networks. It's
> > made by TIBCO and attempts to highlight the downsides of Open Source
> ESBs.
> > You don't need to be a rocket scientist to gather what exact ESB they are
> > targeting (not us): just look at the images.
> >
> > http://www.tibco.com/integration/open-source-ESB-alternative
> >
> > Even though it's a clear exercise of FUD vs. OSS – as it provides no
> > quantitive measurements to their claims (whatever happened to the
> > scientific method...) – I was planning to write a rebuttal post in my
> blog,
> > but I haven't updated it in a long time and it needs a bit of love first.
> >
> > So I thought I'd just publish my thoughts – as I wanted to get it out
> ASAP
> > – and start a qualified discussion here...
> >
> > In particular I would like to dissect / take down their 4 "myths" about
> OSS
> > ESBs:
> >
> > *> *Myth # 1 - Open Source ESB Software Is Free**
> >
> > (Their statement: OSS ESBs are not Free.)
> >
> > Well, no software has zero Total Cost of Ownership. As long as the world
> is
> > *not* entirely controlled by androids, you will need humans to operate
> the
> > software, including TIBCO's. What we need to look at are the costs of
> > hiring those people and their learning curves.
> >
> > For Camel, any developer with Java, XML and a few other "commodity
> skills"
> > will do. And they can get started in days. Many people in this forum got
> > started in hours.
> >
> > For TIBCO, you need a specialised consultant because their stack is
> > proprietary. Or you need to train them, and TIBCO training is not cheap.
> I
> > have been 

Re: Seconds since 1970

2015-04-17 Thread Raul Kripalani
System.currentTimeMillis() / 1000. You will want to round up or round down
(use Math).

And please post only Camel-specific questions.

For general Java questions, Stack Overflow or Google are your best bets.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Apr 17, 2015 at 12:27 PM, Ângelo Costa 
wrote:

> Hi Guys,
>
> anyone know in camel how i can get current seconds since 1970? in Long
> format?
>
> Thanks in advance,
>
> Ângelo Costa
>


[DISCUSS] Looks like someone feels threatened... (TIBCO vs Open Source ESBs)

2015-04-17 Thread Raul Kripalani
Just found this marketing landing page published on social networks. It's
made by TIBCO and attempts to highlight the downsides of Open Source ESBs.
You don't need to be a rocket scientist to gather what exact ESB they are
targeting (not us): just look at the images.

http://www.tibco.com/integration/open-source-ESB-alternative

Even though it's a clear exercise of FUD vs. OSS – as it provides no
quantitive measurements to their claims (whatever happened to the
scientific method...) – I was planning to write a rebuttal post in my blog,
but I haven't updated it in a long time and it needs a bit of love first.

So I thought I'd just publish my thoughts – as I wanted to get it out ASAP
– and start a qualified discussion here...

In particular I would like to dissect / take down their 4 "myths" about OSS
ESBs:

*> *Myth # 1 - Open Source ESB Software Is Free**

(Their statement: OSS ESBs are not Free.)

Well, no software has zero Total Cost of Ownership. As long as the world is
*not* entirely controlled by androids, you will need humans to operate the
software, including TIBCO's. What we need to look at are the costs of
hiring those people and their learning curves.

For Camel, any developer with Java, XML and a few other "commodity skills"
will do. And they can get started in days. Many people in this forum got
started in hours.

For TIBCO, you need a specialised consultant because their stack is
proprietary. Or you need to train them, and TIBCO training is not cheap. I
have been a TIBCO consultant and I know this for a fact. Moreover,
specialised (already trained) TIBCO consultants are not cheap either (like
with most proprietary software – think SAP, Salesforce, etc.).

Furthermore, brand new customers need consultancy to get started – and that
is not cheap either.

*> *Myth #2 - Open Source ESB Communities Innovate Faster**

(Their statement: Proprietary ESB vendors innovate faster)

This is plainly wrong. Just take a look at the release notes of TIBCO
ActiveMatrix BusinessWorks. This [1] is the latest version, and there's a
dropdown at the top to browse through past versions.

To analyse this statement, we need to track two things at least: (1)
frequency of releases, (2) new features introduced per release.

About frequency of releases:

TIBCO ActiveMatrix release line 6.x: 9 months between minor releases, 4
months between micro releases.

[9 months]
6.1.0 (May 2014)--->6.2.0 (Nov 2014)
6.1.1 (Sep 2014)  6.2.1 (Mar 2015)
[4 months][4 months]

Camel (analysing past 2 minor releases): less than 6 months between minors,
less than 3 between micros. I noticed that 2.15.1 was released quite early,
so I included another datapoint for one more 2.14.x micro release.

  [< 6 months]
2.14.0 (18 Sep 2014)  ===>  2.15.0 (10 Mar 2015)
2.14.1 (16 Dec 2014)2.15.1 (01 Apr 2015)
[< 3 months]  [< 20 days (special circumstance
likely)]
2.14.2 (10 Mar 2014)
[< 3 months]

I know that analysing so few releases is not an indicative – ideally we
would analyse the entire release history – but I don't have time right now.
Nevertheless, the release policy of Camel is 6 months between majors and 3
months between micros (if I recall correctly).

Next, let's take a look at the innovation aspect:
* TIBCO AM BW 6.2.0 carries 22 new features [2], many of which have to do
with their IDE, not with core functionality.
* Camel 2.14.0 carried 38 new and noteworthy features, PLUS 15 new
components, 1 data format, 1 new EIP (Circuit Breaker), etc.

Judge for yourselves ;-)

*> *Myth #3 - Access to Source Allows Reviewing Code and Deploying Safely**

(Their statement: Access to source does not uncover vulnerabilities).

Well, all software has vulnerabilities and with Open Source you can
identify them yourself and fix them. With proprietary software, you rely
entirely on the vendor's turnaround time.

Moreover, we are very transparent about this and we publish our Security
Advisories here [3].

*> *Myth #4 - Open Source and SaaS Work Well Together**

They say: "Cloud-based open-source ESBs work just like other SaaS
applications: you typically don't have access to the code. How well will it
connect your on-premise applications with other SaaS services? You can't
know."

Well, that's just plain absurd. It amuses me that a closed-source vendor is
using the "you don't have access to the code" against an Open Source
product :D Makes zero sense, both marketing- and technical-wise.

With TIBCO, you don't have access to the source on-premises nor cloud-based
software. With the other vendor, you may not have access to the source of
their iPaaS but you know it's largely based on the on-premises software, to
which you have access (even though it's a "gated community" in the strict
sense...).

---

Discussion open! 1, 2, 3... GO!

[1] https://docs.tibco.com/products/tibco-activematrix-businessworks-6-2-1
[2]
https://docs.tibco.co

Re: MongoDB Consumer Endpoint: ReadPreference cannot be set?

2015-03-13 Thread Raul Kripalani
I added a unit test and merged your PR. Thanks for your contribution to
Camel, and looking forward to many more!

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Mar 13, 2015 at 3:09 PM, jpeschke  wrote:

> I created  a JIRA ticket  >
> and  a Pull Request on GitHub 
> for this.
>
> First time contributingto Camel, exciting :). I hope, I didn't break
> anything.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/MongoDB-Consumer-Endpoint-ReadPreference-cannot-be-set-tp5764015p5764100.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: MongoDB Consumer Endpoint: ReadPreference cannot be set?

2015-03-11 Thread Raul Kripalani
Hi Joerg,

Thanks for your feedback! Indeed this can probably be improved.

Could you please open a ticket in our Jira?

How would you feel about submitting a pull request?

Thanks!

Sent from my iPad

> On 11 Mar 2015, at 16:13, jpeschke  wrote:
>
> Hello,
> When trying to use the "readPreference" parameter in a mongodb consumer
> endpoint, an illegal argument exception will be thrown during
> initialisation:
>
> /operation, writeConcern, writeConcernRef, readPreference, dynamicity,
> invokeGetLastError options cannot appear on a consumer endpoint/
>
> I do not quiet understand this behaviour:
> In my case, I use a tailable cursor consumer that should "listen" for
> updates on a capped collection. These updates are immutable (they don't get
> changed once they have been inserted), so for performance optimization, it
> would make perfectly sense to perform those read operations on the secondary
> hosts in the replica set.
>
> The only reason I see for forbidding the definition of a different read
> preference here is that we need a write operation if persistent tail
> tracking is enabled and this should be performed on the primary. But as the
> MongoDB Java API would allow you to define a readPrefercne=primary only on
> the persistent tail tracking collection, this isn't a conflict, is it?
>
> Best regards,
> Joerg
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/MongoDB-Consumer-Endpoint-ReadPreference-cannot-be-set-tp5764015.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Trigger FTP Routes in sync

2015-02-24 Thread Raul Kripalani
Take a look at the Controlbus component to start/stop routes
programmatically. Normally with FTP consumers, you know when to start them
(when the timer fires) but the tricky part is to know when to stop them.
You'd probably want to stop them after a period of inactivity, e.g. after
60 seconds.

There's a number of ways you could achieve this, e.g. setting a fixed timer
every time a message is consumed, and resetting the timer every time a new
message comes in. Eventually the timer will fire after the period of
inactivity has elapsed, and you'd use the Controlbus component again to
stop the route.

Perhaps it would make sense to include an "inactivity auto-suspend" feature
in the File-based components.

Hope this helps,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Feb 24, 2015 at 8:35 AM, Svend-Ole Nielsen <
svend-ole.niel...@vehco.com> wrote:

> Hi all
>
> Is it possible to have some kind of route handling where you were to
> trigger one FTP download route after another in sync??
>
> ...
> 
> 
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
>
> Hopefully someone has a trick up their sleeve :)
>
> Regards,
> Svend
>


Re: Modifying a shipped TypeConverter

2015-01-28 Thread Raul Kripalani
Yes, we definitely need an option to pick up a custom ObjectMapper. Could
you file a JIRA and assign it to me, please?

However, the type converter is only used as a (very convenient) fallback.
If you provide a DBObject to your endpoint, no type conversions will be
triggered.

Therefore, for now, you can just implement a processor/bean to convert your
custom Object into a DBObject with a code similar to [1], but controlling
whichever options you want in the ObjectMapper.

[1]
https://github.com/raulk/camel-mongodb/blob/master/src/main/java/org/apache/camel/component/mongodb/converters/MongoDbBasicConverters.java#L67

Hope that helps,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Jan 20, 2015 at 3:58 PM, James Green 
wrote:

> Given MongoDB has an ISODate type natively, should the default ObjectMapper
> be changed within the component itself to not write timestamps as longs?
>
> I.e. should this be considered a bug..?
>
> On 20 January 2015 at 15:29, Jakub Korab 
> wrote:
>
> > I haven't tried this, so it's just conjecture, but you could try to
> > remove the offending type converter from the TypeConverterRegistry and
> > replace it with your own:
> >
> > |CamelContext context = ...|
> > |TypeConverterRegistry converterRegistry =
> > context.getTypeConverterRegistry();
> > ||converterRegistry.remove|||TypeConverter|(DBObject.class,
> Object.class);
> > converterRegistry.addTypeConverter||(DBObject.class, Object.class, new
> > FixedTypeConverter());|
> >
> > See:
> >
> >
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/TypeConverterRegistry.html#removeTypeConverter%28java.lang.Class,%20java.lang.Class%29
> >
> > Jakub
> >
> > On 20/01/15 14:50, James Green wrote:
> > > The mongodb component uses Jackson to marshal Object to DBObject. The
> > > trouble is that Date becomes long due to the default configuration of
> > > Jackson.
> > >
> > > Is it possible to change this by obtaining that Jackson instance and
> > > reconfiguring it?
> > >
> > > Or must be add a TypeConvertor for our specify type to the registry?
> > >
> > > Thanks,
> > >
> > > James
> > >
> >
> >
>


Re: camel xmljson add @ signs to the json output. how to remove the @ signs

2015-01-28 Thread Raul Kripalani
Hey guys,

It's me who developed this component, but in Camel we can only go as far as
the Jsonlib library goes. Jsonlib prefixes XML attributes with '@' when
converting them into JSON properties [1]. I think this is correct: without
some kind of differentiation, you wouldn't be able to cycle back from JSON
to XML accurately.

As Claus said, we could add a feature in our camel-xmljson data format to
remove the @ signs, but that would be post-processing and not very
performant.

Please feel free to submit a pull request + JIRA if you'd like this
functionality. The issue tracker is [2]. Make sure to select
'camel-xmljson' as the Component when you file the ticket.

[1]
http://json-lib.sourceforge.net/xref/net/sf/json/xml/XMLSerializer.html#1081
[2] https://issues.apache.org/jira/browse/CAMEL

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Jan 13, 2015 at 9:01 PM, Vinny  wrote:

> Do the component developers follow this list? I'd love to see a switch as
> well. Issue tracker for components ?
>
> On Wed Nov 26 2014 at 1:44:01 AM Claus Ibsen 
> wrote:
>
> > Hi
> >
> > Did you get in contact with the xmjson team about the issue and if
> > they are willing to add a flag to turn this on/off etc?
> >
> > On Tue, Nov 18, 2014 at 9:18 AM, Claus Ibsen 
> > wrote:
> > > Hi
> > >
> > > Ah great to know it was hardcoded. I would suggest to ask them to add
> > > an option so you can turn that off. As there are use cases where you
> > > only need a one way transformation.
> > >
> > > They could also consider different strategies how to control this
> > > mapping. So there is a default strategy that does as today. And then
> > > people can switch to different ones, such as one that simply dont
> > > include those signs. And another that allow end users to provide their
> > > own mapping code to have 100% control how they want to do that.
> > >
> > > An alternative is that we introduce an option in the Camel component
> > > but then it would need to process the output message and remove those
> > > @ signs. But its IMHO better to improve this in the xmljson library
> > > itself.
> > >
> > > On Mon, Nov 17, 2014 at 9:10 PM, salemi  wrote:
> > >> Hi Clause,
> > >>
> > >> I looked at their json-lib code and based on what I read they need to
> > have
> > >> the @ sign for the attributes and # for the text elements.
> > >> They need those "annotations" to be able to covert a json properly
> back
> > to
> > >> xml. The @ and # signs are hard coded in their code.
> > >>
> > >> Do you think I should asked to change the code?
> > >>
> > >> Ali
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> -
> > >> Alireza Salemi
> > >> --
> > >> View this message in context: http://camel.465427.n5.nabble.
> > com/camel-xmljson-add-signs-to-the-json-output-how-to-remove-the-signs-
> > tp5759013p5759220.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: XPATH woes

2014-11-13 Thread Raul Kripalani
Your Envelope element is declared in a default namespace. Your XPath
expression must use the namespace when referring to the element.

Cheers.
On 13 Nov 2014 22:32, "Gershaw, Geoffrey A." <
geoffrey.gers...@credit-suisse.com> wrote:

> Hi All,
>
> I'm trying to filter via xpath using the spring config. I'm running camel
> 2.12.3.
>
>
> An example msg
>
> http://removed " xmlns:bem="http:/removed " xmlns:price="
> http://removed"; messageId="xx" schemaVersion="1.0" instanceId="xx"
> publishMessageDtm="2014-11-13T22:27:07+00:00"
> publishMessageDtInMs="2014-11-13T22:27:07.835+00:00"
> publishingSystemCd="xx">
>
>
> This below filter always evaluates to false. Any ideas?
>
> 
>/Envelope/@schemaVersion='1.0'
>
>  
>
> Thanks
>
>
> Geoffrey A Gershaw
> CREDIT SUISSE
> Information Technology | Credit eTrading Development, KFVB 525
> 7033 Louis Stephens Drive | 27560 Research Triangle Park | United States
> Phone +1 919 994 6412
> geoffrey.gers...@credit-suisse.com geoffrey.gers...@credit-suisse.com> | www.credit-suisse.com<
> http://www.credit-suisse.com/>
>
>
>
>
>
> ===
> Please access the attached hyperlink for an important electronic
> communications disclaimer:
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>
> ===
>


Re: Confusing cxf log messages after upgrading to 2.14.0

2014-09-25 Thread Raul Kripalani
Yep, perhaps try setting it as a  in your bean...

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Thu, Sep 25, 2014 at 3:12 PM, Claus Ibsen  wrote:

> Hi
>
> Yeah INFO logging per message is a bad idea. Feel free to log a JIRA
> so we can tone it down. And also if you get that option set, then
> there is a bug in that code check.
>
> Maybe there is a case sensitive issue with DefaultXXX vs defaultXXX
>
>
> On Thu, Sep 25, 2014 at 2:56 PM, Preben.Asmussen  wrote:
> > After upgrade the CXF producer info logs like
> > CxfProducerINFO  CxfProducer cannot find the
> > operationName from message header, try to use the defaultOperationName
> >
> > This is due to change in in
> https://issues.apache.org/jira/browse/CAMEL-7503
> >
> https://fisheye6.atlassian.com/changelog/camel-git?cs=75dfe61edc1d6f9e2837056189dea5f7e20f1090
> >
> > The defaultOperationName is actually set on my endpoint like
> >
> cxf:bean:mybean?synchronous=true&DefaultOperationName=MyDefaultOperationName
> >
> > The Info log statement i kind of misleading you to think something is
> > broken.
> > IMHO the log statment should be debug or trace at best, or even better
> see
> > only log if the defaultOperationName is not present as a header or set
> as a
> > endpoint DefaultOperationName option.
> >
> >
> > Best,
> > Preben
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Confusing-cxf-log-messages-after-upgrading-to-2-14-0-tp5757014.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>


Re: camel-cxfrs and AsyncResponse

2014-08-26 Thread Raul Kripalani
Hey Michael,

Can you try setting the 'synchronous' property to 'true' in the
rsServer bean? This will force the component to take the sync
execution path and circumvent using Continuations.

You need to use a  block. I don't have any examples
handy and I cannot write source code now, but you'll find examples
online.

Thanks,
Raúl.

Sent from my iPad

> On 26 Aug 2014, at 17:05, Michael Bannii  wrote:
>
> It appears I already have SelectChannelConnector set up in my pom.xml and 
> still have the issue...
>
> I use  jetty-maven-plugin 8.1.15.v20140411 with CXF 2.7.11 and Camel v2.13.2.
> The processing chain appears to be:  jetty -> some filters -> cxf -> cxfrs -> 
> camel.
>
> Also when I set a breakpoint inside my processor I see that a whole HTTP 
> thread gets blocked by it (which is probably not what I want, and I want to 
> arrange a threadless wait when calling backend in my processor), and in stack 
> there is
>   CxfRsInvoker.performInvocation(Exchange, Object, Method, Object[]) line: 56
> and the continuation object there is an instance of 
> org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation.
>  So at least some Continuation is being used.
>
>
> -Original Message-
> From: Raul Kripalani [mailto:r...@evosent.com]
> Sent: 26 серпня 2014 р. 17:51
> To: users@camel.apache.org
> Subject: Re: camel-cxfrs and AsyncResponse
>
> I came across this issue recently and the culprit was the default 
> etc/jetty.xml configuration packaged with Apache ServiceMix, which by default 
> uses the BlockingChannelConnector, as explained in the inline XML comment.
>
> This connector does not support Jetty Continuations, therefore it is not 
> capable of handling an async response.
>
> You don't specify what runtime container you're using, but if you use Apache 
> ServiceMix or Apache Karaf with Pax Web you can be facing the same problem.
>
> If you swap the BlockingChannelConnector for a SelectChannelConnector, it 
> should work.
>
> Regards,
>
> *Raúl Kripalani*
> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source 
> Integration specialist http://about.me/raulkripalani | 
> http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>
> On Tue, Aug 26, 2014 at 3:21 PM, Michael Bannii 
> wrote:
>
>> Hi,
>>
>> I use camel-cxfrs with a JAX-RS2 resource java class having a method
>> declared in async way using AsyncResponse, like this:
>>
>>
>>> uri="cxfrs://bean://testRsServer?bindingStyle=SimpleConsumer" />
>>.a code here that finally does
>> exchange.getOut().setBody(response);
>>
>>
>>> serviceClass="foo.bar.TestResource">
>>
>>@Path("/") @Produces({MediaType.APPLICATION_JSON})
>>public class TestResource {
>>@POST @Path("/something")
>>public void addAccount(@Multipart(value = "myDomainObject")
>> final String myDomainObject, @Suspended final AsyncResponse ar) {
>>throw new RuntimeException("Camel does not call it anyway");
>>}
>>}
>>
>>
>> When I invoke the resource, Camel invokes the route, however no REST
>> response is sent back to client for some reason... Looks like Camel is
>> not calling AsyncResponse.resume()?
>>
>> If I change the resource declaration to sync-way like below, i.e. drop
>> AsyncResponse and change response type from void to MyResponse, then
>> REST response is sent back as expected.
>>
>>@POST @Path("/something")
>>public MyResponse addAccount(@Multipart(value =
>> "myDomainObject") final String myDomainObject) {
>>throw new RuntimeException("Camel does not call it anyway");
>>}
>>
>> Why is such behavior? Am I missing something?
>>
>>
>> --
>> Best regards
>>
>>


Re: camel-cxfrs and AsyncResponse

2014-08-26 Thread Raul Kripalani
I came across this issue recently and the culprit was the default
etc/jetty.xml configuration packaged with Apache ServiceMix, which by
default uses the BlockingChannelConnector, as explained in the inline XML
comment.

This connector does not support Jetty Continuations, therefore it is not
capable of handling an async response.

You don't specify what runtime container you're using, but if you use
Apache ServiceMix or Apache Karaf with Pax Web you can be facing the same
problem.

If you swap the BlockingChannelConnector for a SelectChannelConnector, it
should work.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Aug 26, 2014 at 3:21 PM, Michael Bannii 
wrote:

> Hi,
>
> I use camel-cxfrs with a JAX-RS2 resource java class having a method
> declared in async way using AsyncResponse, like this:
>
> 
>  uri="cxfrs://bean://testRsServer?bindingStyle=SimpleConsumer" />
> .a code here that finally does
> exchange.getOut().setBody(response);
> 
>
>  serviceClass="foo.bar.TestResource">
>
> @Path("/") @Produces({MediaType.APPLICATION_JSON})
> public class TestResource {
> @POST @Path("/something")
> public void addAccount(@Multipart(value = "myDomainObject") final
> String myDomainObject, @Suspended final AsyncResponse ar) {
> throw new RuntimeException("Camel does not call it anyway");
> }
> }
>
>
> When I invoke the resource, Camel invokes the route, however no REST
> response is sent back to client for some reason... Looks like Camel is not
> calling AsyncResponse.resume()?
>
> If I change the resource declaration to sync-way like below, i.e. drop
> AsyncResponse and change response type from void to MyResponse, then REST
> response is sent back as expected.
>
> @POST @Path("/something")
> public MyResponse addAccount(@Multipart(value = "myDomainObject")
> final String myDomainObject) {
> throw new RuntimeException("Camel does not call it anyway");
> }
>
> Why is such behavior? Am I missing something?
>
>
> --
> Best regards
>
>


Re: mongoDB uri

2014-08-26 Thread Raul Kripalani
Did you just need to change the MongoDB Database and the MongoDB
Collections?

I thought you also wanted to change the hostname and the port at runtime of
the Mongo server...

If that's not the case, you can even simplify your solution a lot! After
all, it seems that your dynamic router is always returning the same URI...

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Aug 26, 2014 at 2:03 PM, Andrei Stoica <
andrei.ionut.sto...@gmail.com> wrote:

> I managed to get it work this way:
>
> In the camel.xml I declared my bean:
>
> 
>
> my route:
>
> from("jms:mongoQueue")
> .bean(MongoConnection.class, "setConnectionBean")
> .process(new Processor() {
>
> @Override
> public void process(Exchange exchange) throws
> Exception {
>
>
> exchange.getIn().setHeader(MongoDbConstants.DATABASE, "dbname");
>
> exchange.getIn().setHeader(MongoDbConstants.COLLECTION, "collection");
>
> exchange.getIn().setHeader(MongoDbConstants.OPERATION_HEADER,
> "operation");
> exchange.getIn().setBody(query);
> }
> })
> .dynamicRouter(method(MongoConnection.class,
> "getConnection"))
>
> and the MongoConnection.class:
>
> @Autowired
> private Mongo mongo;
>
> public String getConnection(String body,
> @Header(Exchange.SLIP_ENDPOINT)
> String previous) throws Exception{
>
> if(previous == null)
> return
> "mongodb://myDb?database=none&collection=none&dynamicity=true";
> else
> return null;
> }
>
> public void setConnectionBean(MongoStep step) throws
> UnknownHostException{
>
> MongoClientURI uri = new MongoClientURI(getUri());
> mongo = new MongoClient(uri);
> }
>
> Now I can specify the uri in the runtime.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/mongoDB-uri-tp5755565p5755704.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: mongoDB uri

2014-08-26 Thread Raul Kripalani
Can you post the code showing...?

a) how you add the bean.
b) how you construct the endpoint URI from within the "MongoConnection"
class' dynamic router method.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk


On Tue, Aug 26, 2014 at 12:44 PM, Andrei Stoica <
andrei.ionut.sto...@gmail.com> wrote:

> I tried adding the bean in the existing camel context like this:
>
> from("jms:...")
> .process(new Processor() {
>
> @Override
> public void process(Exchange exchange) throws Exception {
> // add bean to context using getContext() method
> }
> )
> .dynamicRouter(method(MongoConnection.class)) // in the MongoConnection
> class I am using the bean added above
>
> When I run the code I get a warning that the bean is not found in the
> Registry.
>
> Am I doing it right? Should I add the bean to the registry somewhere else?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/mongoDB-uri-tp5755565p5755694.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: apache repository down?

2014-08-25 Thread Raul Kripalani
I was able to access the URLs you posted successfully, with a POM file
coming back.
Perhaps check your proxy settings and try a direct curl/wget...

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Mon, Aug 25, 2014 at 2:42 PM, Matt Raible  wrote:

> Hello all,
>
> I've been using Camel 2.14-SNAPSHOT in my project for the last couple
> months. Last week, and today, it seems that the apache repository has been
> down. Has anyone else experienced this as well?
>
> Downloading:
> https://repository.apache.org/content/repositories/snapshots/org/apache/camel/components/2.14-SNAPSHOT/components-2.14-20140823.052541-129.pom
> [INFO]
> 
> [INFO] BUILD FAILURE
> [INFO]
> 
> [INFO] Total time: 01:02 min
> [INFO] Finished at: 2014-08-25T07:41:12-07:00
> [INFO] Final Memory: 12M/245M
> [INFO]
> 
> [ERROR] Failed to execute goal on project palogic-services: Could not
> resolve dependencies for project
> com.hidinc.palogic:palogic-services:war:1.0-SNAPSHOT: Failed to collect
> dependencies at org.apache.camel:camel-csv:jar:2.14-SNAPSHOT: Failed to
> read artifact descriptor for org.apache.camel:camel-csv:jar:2.14-SNAPSHOT:
> Could not transfer artifact
> org.apache.camel:components:pom:2.14-20140823.052541-129 from/to
> apache.snapshots (
> https://repository.apache.org/content/repositories/snapshots/): Failed to
> transfer file:
> https://repository.apache.org/content/repositories/snapshots/org/apache/camel/components/2.14-SNAPSHOT/components-2.14-20140823.052541-129.pom.
> Return code is: 502 , ReasonPhrase:Proxy Error. -> [Help 1]
>
> Thanks,
>
> Matt


Re: mongoDB uri

2014-08-25 Thread Raul Kripalani
Hello Andrei,

This is an interesting use case.

Currently there is no easy way to support your scenario because the MongoDB
component requires a com.mongodb.Mongo bean in the registry, e.g.

mongodb:connectionBean?...

In your context:


   ...


However, many ideas come to mind. You can use a Dynamic Router / Recipient
List EIP to dynamically change the endpoint URI, along with Camel's Java
API to dynamically register beans in the registry [3].

So when you receive a message, a Processor or a bean could bind a new Mongo
object in your registry under a random UUID. You set the resulting UUID in
an Exchange property. Then you use that UUID to populate the endpoint URI,
e.g. mongodb:.

Once the operation is finished, you can unbind the bean from the registry
(Very important to do so! Otherwise you could easily end up with a memory
leak).

[1] https://camel.apache.org/dynamic-router.html
[2] https://camel.apache.org/recipient-list.html
[3]
http://camel.465427.n5.nabble.com/Programatically-adding-beans-to-a-registry-in-a-RouteBuilder-td5729358.html

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Mon, Aug 25, 2014 at 9:36 AM, Andrei Stoica <
andrei.ionut.sto...@gmail.com> wrote:

> Hello,
>
> My problem is that the connection URI might change and I need a way to edit
> it at runtime.
>
> When the application will be started, the user will be prompted with a
> screen to input the connection details. After he inputs them, I need a way
> to route messages to that URI.
>
> Any idea how I can do that?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/mongoDB-uri-tp5755565p5755625.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: AHC module not passing the request body

2014-08-20 Thread Raul Kripalani
dTypeConverter: public static java.lang.String
> org.apache.camel.converter.ObjectConverter.toString(java.lang.Integer) to
> convert [class java.lang.Integer=>class java.lang.String]
> [http-bio-8080-exec-13] DefaultTypeConverter   TRACE Converting
> java.lang.String -> java.lang.String with value:
> address=localhost:58100/api/servers
> [http-bio-8080-exec-13] DefaultTypeConverter   TRACE Converting
> java.lang.String -> java.lang.String with value: Microsoft-IIS/8.0
> [http-bio-8080-exec-13] DefaultTypeConverter   TRACE Converting
> java.lang.String -> java.lang.String with value: no-cache
> [http-bio-8080-exec-13] DefaultTypeConverter   TRACE Converting
> java.lang.String -> java.lang.String with value: */*
> [http-bio-8080-exec-13] DefaultHttpBinding DEBUG Streaming
> response in chunked mode with buffer size 8192
> [http-bio-8080-exec-13] IOHelper   TRACE Copying
> InputStream: java.io.ByteArrayInputStream@28ce41cc -> OutputStream:
> org.apache.catalina.connector.CoyoteOutputStream@227db754 with buffer:
> 2134
> and flush on each write true
> [http-bio-8080-exec-13] DefaultUnitOfWork  TRACE UnitOfWork
> done for ExchangeId: ID-DEVSERVER-56006-1408531950289-0-15 with
> Exchange[Message: [Body is instance of java.io.InputStream]]
> [http-bio-8080-exec-13] DefaultUnitOfWork  TRACE Invoking
> synchronization.onComplete: OnCompletion[CachedOutputStream] with
> Exchange[Message: [Body is instance of java.io.InputStream]]
> [http-bio-8080-exec-13] EventHelperTRACE Notification
> of event is disabled: ID-DEVSERVER-56006-1408531950289-0-15 exchange
> completed: Exchange[Message: [Body is instance of java.io.InputStream]]
>
>
>
>
> On 20 August 2014 11:01, Raul Kripalani  wrote:
>
> > You can enable logging in the AHC library by setting the appropriate log
> > categories to DEBUG or TRACE level in your log stack configuration.
> >
> > This will show what AHC is actually sending to the backend.
> >
> > If you are using AHC 1.8.x, the logging category to enable is
> > com.ning.http.
> >
> > It could happen that the payload is being sent, but along with some
> > additional HTTP request headers which may confuse the backend
> > (Content-Type, Content-Length, etc.).
> >
> > Regards,
> >
> > *Raúl Kripalani*
> > Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> > Integration specialist
> > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> > http://blog.raulkr.net | twitter: @raulvk
> >
> > On Wed, Aug 20, 2014 at 9:15 AM, Jaume Sancho  wrote:
> >
> > > Hi Claus,
> > >
> > > It does sound a lot like that, but unfortunately that didn't work
> either.
> > >
> > > from("servlet:///tinyproxy")
> > > .streamCaching()
> > > //.log("${body}")
> > > .to("ahc:
> > >
> > >
> >
> http://localhost/api/servers?bridgeEndpoint=true&throwExceptionOnFailure=false
> > > ");
> > >
> > > When the log is enabled I do actually see the body in the console
> output,
> > > but it's still not received the by the server at other end.
> > > I also tried removing the "log" call, in case it could have been
> > consuming
> > > the stream, but same result.
> > >
> > > Any other suggestions?
> > >
> > >
> > > Thanks very much, I really appreciate you taking the time to answer
> such
> > > beginner questions.
> > >
> > > Jaume
> > >
> > >
> > >
> > >
> > > On 19 August 2014 19:02, Claus Ibsen  wrote:
> > >
> > > > Hi
> > > >
> > > > Sounds a bit like this
> > > > http://camel.apache.org/why-is-my-message-body-empty.html
> > > >
> > > > On Tue, Aug 19, 2014 at 6:11 PM, Jaume Sancho  wrote:
> > > > > Hi,
> > > > >
> > > > > I am in the process of creating a Camel-based proxy that takes in
> > > > requests
> > > > > on a Tomcat Servlet, does some internal processing, and ultimately
> > > > returns
> > > > > the responses that you would expect when accessing the targeted
> > server
> > > > > itself.
> > > > >
> > > > > In its simplest implementation this works just fine for GET and
> > DELETE
> > > > > requests.
> > > > >
> > > > > from("servlet:///tinyproxy")
> > > > > .log("${body}")
> > > > > .to("ahc:
> > > > >
> > > >
> > >
> >
> http://localhost/api/servers?bridgeEndpoint=true&throwExceptionOnFailure=false
> > > > > ");
> > > > >
> > > > > However, when I try to do the same with an AHC component, the body*
> > of
> > > > POST
> > > > > and PUT requests is not being received at the other end.
> > > > >
> > > > > If I change the module to http4, the body of the request is
> received,
> > > and
> > > > > the appropriate response is forwarded back to the sender.
> > > > >
> > > > > from("servlet:///tinyproxy2")
> > > > > .log("${body}")
> > > > >
> > > >
> > >
> >
> .to("http4:localhost/api/servers?bridgeEndpoint=true&throwExceptionOnFailure=false");
> > > > >
> > > > > The log message does actually print the body as it is provided by
> the
> > > > > original request, so that should confirm that the setup of
> > Camel/Tomcat
> > > > > should be OK.
> > > > >
> > > > > *Here are some very simple examples of request bodies that fail to
> be
> > > > > passed through when using AHC.
> > > > >
> > > > > JSON: (using single quotes to avoid parsing issues with Camel)
> > > > > {'HostName':'DEVSERVER'}
> > > > >
> > > > > XML:
> > > > > http://www.w3.org/2001/XMLSchema-instance";
> > > > xmlns="
> > > > > http://schemas.datacontract.org/2004/07/HttpTests.Models";>
> > > > > DEVServer
> > > > > 
> > > > >
> > > > > This is occurring with the version 2.13.2 of all components:
> > > camel-core,
> > > > > camel-servletlistener, camel-http4, camel-ahc
> > > > > I'm sending the http requests with Curl.
> > > > >
> > > > > Could I be missing something entirely obvious?
> > > > >
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Jaume
> > > >
> > > >
> > > >
> > > > --
> > > > 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: AHC module not passing the request body

2014-08-20 Thread Raul Kripalani
You can enable logging in the AHC library by setting the appropriate log
categories to DEBUG or TRACE level in your log stack configuration.

This will show what AHC is actually sending to the backend.

If you are using AHC 1.8.x, the logging category to enable is com.ning.http.

It could happen that the payload is being sent, but along with some
additional HTTP request headers which may confuse the backend
(Content-Type, Content-Length, etc.).

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Aug 20, 2014 at 9:15 AM, Jaume Sancho  wrote:

> Hi Claus,
>
> It does sound a lot like that, but unfortunately that didn't work either.
>
> from("servlet:///tinyproxy")
> .streamCaching()
> //.log("${body}")
> .to("ahc:
>
> http://localhost/api/servers?bridgeEndpoint=true&throwExceptionOnFailure=false
> ");
>
> When the log is enabled I do actually see the body in the console output,
> but it's still not received the by the server at other end.
> I also tried removing the "log" call, in case it could have been consuming
> the stream, but same result.
>
> Any other suggestions?
>
>
> Thanks very much, I really appreciate you taking the time to answer such
> beginner questions.
>
> Jaume
>
>
>
>
> On 19 August 2014 19:02, Claus Ibsen  wrote:
>
> > Hi
> >
> > Sounds a bit like this
> > http://camel.apache.org/why-is-my-message-body-empty.html
> >
> > On Tue, Aug 19, 2014 at 6:11 PM, Jaume Sancho  wrote:
> > > Hi,
> > >
> > > I am in the process of creating a Camel-based proxy that takes in
> > requests
> > > on a Tomcat Servlet, does some internal processing, and ultimately
> > returns
> > > the responses that you would expect when accessing the targeted server
> > > itself.
> > >
> > > In its simplest implementation this works just fine for GET and DELETE
> > > requests.
> > >
> > > from("servlet:///tinyproxy")
> > > .log("${body}")
> > > .to("ahc:
> > >
> >
> http://localhost/api/servers?bridgeEndpoint=true&throwExceptionOnFailure=false
> > > ");
> > >
> > > However, when I try to do the same with an AHC component, the body* of
> > POST
> > > and PUT requests is not being received at the other end.
> > >
> > > If I change the module to http4, the body of the request is received,
> and
> > > the appropriate response is forwarded back to the sender.
> > >
> > > from("servlet:///tinyproxy2")
> > > .log("${body}")
> > >
> >
> .to("http4:localhost/api/servers?bridgeEndpoint=true&throwExceptionOnFailure=false");
> > >
> > > The log message does actually print the body as it is provided by the
> > > original request, so that should confirm that the setup of Camel/Tomcat
> > > should be OK.
> > >
> > > *Here are some very simple examples of request bodies that fail to be
> > > passed through when using AHC.
> > >
> > > JSON: (using single quotes to avoid parsing issues with Camel)
> > > {'HostName':'DEVSERVER'}
> > >
> > > XML:
> > > http://www.w3.org/2001/XMLSchema-instance";
> > xmlns="
> > > http://schemas.datacontract.org/2004/07/HttpTests.Models";>
> > > DEVServer
> > > 
> > >
> > > This is occurring with the version 2.13.2 of all components:
> camel-core,
> > > camel-servletlistener, camel-http4, camel-ahc
> > > I'm sending the http requests with Curl.
> > >
> > > Could I be missing something entirely obvious?
> > >
> > >
> > > Thanks,
> > >
> > > Jaume
> >
> >
> >
> > --
> > 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: Article Java Magazin July 2014 on Apache Integration stack

2014-06-06 Thread Raul Kripalani
Hi Neil and Communities,

Good news! An (almost) 1:1 translation in English is available. Please
contact me directly if you'd like a copy.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Jun 4, 2014 at 11:05 PM, Neil Franken 
wrote:

> My German is really basic... is there a copy in Engrish?
>
> Kind Regards
> Neil Franken
> Head Of IT
> Insolvency Management Services (iMS) formerly NCRM
>
>
> 
>
> This e-mail, including any attachments sent with it, is confidential and
> for the sole use of the intended recipient(s). This confidentiality is not
> waived or lost if you receive it and you are not the intended recipient(s),
> or if it is transmitted/ received in error.
>
> Any unauthorised use, alteration, disclosure, distribution or review of
> this e-mail is prohibited. It may be subject to a statutory duty of
> confidentiality if it relates to health service matters.
>
> If you are not the intended recipient(s), or if you have received this
> e-mail in error, you are asked to immediately notify the sender by
> telephone or by return e-mail. You should also delete this e-mail message
> and destroy any hard copies produced.
>
> ****
>
>
> -Original Message-
> From: Raul Kripalani [mailto:r...@evosent.com]
> Sent: Wednesday, 4 June 2014 9:07 PM
> To: us...@activemq.apache.org; users@camel.apache.org;
> us...@servicemix.apache.org
> Subject: Re: Article Java Magazin July 2014 on Apache Integration stack
>
> If you'd like a complimentary copy of the article, feel free to contact me
> directly.
>
> *Raúl Kripalani*
> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> Integration specialist http://about.me/raulkripalani |
> http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>
> On Tue, Jun 3, 2014 at 10:20 AM, Raul Kripalani  wrote:
>
> > Communities,
> >
> > Quick announcement to let you know that we have published an article
> > on Apache Camel, Apache ServiceMix powering a best-practice,
> > geographically-federated SOA solution in the July 2014 issue of the
> > Java Magazin (edited by JAXenter.de).
> >
> > The Apache ServiceMix brand has been featured on the cover too!
> >
> > The article explains concepts and introduces an example scenario based
> > on a worldwide retailer with service orchestration requirements. It
> > includes code samples and sexy diagrams ;-)
> >
> > Here's the link:
> https://jaxenter.de/Java-Magazin/Java-Magazin-714-173689.
> >
> > If you get to read it and have any questions, feel free to reach out!
> >
> > Regards,
> >
> > *Raúl Kripalani*
> > Apache Camel PMC Member & Committer | Enterprise Architect, Open
> > Source Integration specialist http://about.me/raulkripalani |
> > http://www.linkedin.com/in/raulkripalani
> > http://blog.raulkr.net | twitter: @raulvk
> >
>


Re: Article Java Magazin July 2014 on Apache Integration stack

2014-06-04 Thread Raul Kripalani
If you'd like a complimentary copy of the article, feel free to contact me
directly.

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Jun 3, 2014 at 10:20 AM, Raul Kripalani  wrote:

> Communities,
>
> Quick announcement to let you know that we have published an article on
> Apache Camel, Apache ServiceMix powering a best-practice,
> geographically-federated SOA solution in the July 2014 issue of the Java
> Magazin (edited by JAXenter.de).
>
> The Apache ServiceMix brand has been featured on the cover too!
>
> The article explains concepts and introduces an example scenario based on
> a worldwide retailer with service orchestration requirements. It includes
> code samples and sexy diagrams ;-)
>
> Here's the link: https://jaxenter.de/Java-Magazin/Java-Magazin-714-173689.
>
> If you get to read it and have any questions, feel free to reach out!
>
> Regards,
>
> *Raúl Kripalani*
> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>


Article Java Magazin July 2014 on Apache Integration stack

2014-06-03 Thread Raul Kripalani
Communities,

Quick announcement to let you know that we have published an article on
Apache Camel, Apache ServiceMix powering a best-practice,
geographically-federated SOA solution in the July 2014 issue of the Java
Magazin (edited by JAXenter.de).

The Apache ServiceMix brand has been featured on the cover too!

The article explains concepts and introduces an example scenario based on a
worldwide retailer with service orchestration requirements. It includes
code samples and sexy diagrams ;-)

Here's the link: https://jaxenter.de/Java-Magazin/Java-Magazin-714-173689.

If you get to read it and have any questions, feel free to reach out!

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk


Re: Basic direct-vm scenario produces error

2014-04-21 Thread Raul Kripalani
Check the endpoint URIs on the producer and consumer side. There seems to
be a mismatch - perhaps it's a copy paste error?
On 22 Apr 2014 00:50, "John Dubchak"  wrote:

> Hi,
>
> I am trying to route a JMS message using an xpath expression. The
> expression and message conversion seem to work fine but I am getting an
> error that one of the direct-vm endpoints are not found.
>
> Here is the structure of the router:
>
> DataFormat jaxb = new JaxbDataFormat(...);
>
> from(getInboundReceiver())
> .unmarshal(jaxb)
> .choice()
> .when(xpath(eventTypeOf("abc:inbound:file-receive")))
>  .log("Dispatching event ${id} to receive handler")
>  .to("direct-vm:abc_InboundFileReceive")
>  .endChoice()
> .when(xpath(eventTypeOf("abc:inbound:file-validate")))
>  .log("Dispatching event ${id} to validation handler")
>  .to("direct-vm:abc_InboundFileValidate")
>  .endChoice()
> .when(xpath(eventTypeOf("abc:inbound:file-process")))
>  .log("Dispatching event ${id} to processing handler")
>  .process(applyProcessor)
>  .to("direct-vm:abc_InboundFileProcess")
>  .endChoice()
>  .otherwise()
>  .log("Processing ${id} did not match expressions.");
>
> In the abc_InboundFileValidate route I have:
>
> from("direct-vm:cdw_InboundFileValidate")
> 
>
> However, I have this error in the log file:
>
> DefaultErrorHandler  | 108 - org.apache.camel.camel-core -
> 2.12.3 | Failed delivery for (MessageId: 
> queue_abc.events_ID_host_name-65483-1398122729446-4_1_-1_1_1
> on ExchangeId: ID-host_name-65482-1398122729423-2-1). Exhausted after
> delivery attempt: 1 caught: org.apache.camel.component.directvm.
> DirectVmConsumerNotAvailableException: No consumers available on
> endpoint: Endpoint[direct-vm://abc_InboundFileValidate].
> Exchange[JmsMessage[JmsMessageID: ID:host_name-65483-
> 1398122729446-4:1:-1:1:1]]
>
> I know I'm probably doing something incorrectly, but I can't seem to
> figure it out.  Any help is appreciated.
>
> Thanks,
> John
>


Re: Does Camel MongoDB use cursors on findAll ?

2014-04-18 Thread Raul Kripalani
There are unit tests that showcase this functionality of the component:

https://github.com/apache/camel/blob/e7563a7611667fb9b449d8a7f8c3fa7e3a0524bd/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbFindOperationTest.java#L90

I think we could enhance it anyway to enable returning the DBCursor
directly to the route, so you can then handle the result in any manner you
want, e.g. writing it to an OutputStream or whatever.

I've created [1] to track this new feature.

[1] https://issues.apache.org/jira/browse/CAMEL-7378

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Apr 18, 2014 at 5:30 AM, Ephemeris Lappis <
ephemeris.lap...@gmail.com> wrote:

> Hello.
>
> I have tried different options; like batch size; to evaluate some
> scenario to optimize some cases.
> But for cases with a really big volume of data, retrieving them all in
> memory always leads to an error.
>
> Our current case should be something as simple as :
> A first route :
> - receive a soap request from a web client with some kind of filter form
> to select data
> - push the xml request to an active queue, and send back a simple soap
> response
> A main route :
> - get back the xml request from the queue
> - make a json body to set the query from the xml request (10 of 15 lines
> of groovy for example)
> - set a header to select the needed collection's attributes
> - call mongo findAll
> - marshal the result to csv
> - write the result into a file.
> - send a mail to the caller to inform the job is done.
>
> This may be done with a very simple blueprint with very few lines and no
> complexity at all.
>
> Do you mean that the only way to process a big volume of Mongo data is
> to set up a more "smart" algorithm like :
> - build a first request to count the data.
> - loop  over the data set reading batch parts using "skip" and "page size"
> - write the paged results appending them to the file.
> - etc ?
>
> Have you an example of paging process ?
>
> Thanks for you help.
>
> Ephemeris Lappis
>
> Le 18/04/2014 02:52, Raul Kripalani [via Camel] a écrit :
> > Hi,
> >
> > We use Mongo cursors to read from the DB. But a DBCursor is not
> > something we can return to the route because not all technologies
> > support Streams, Cursors, Chunking, etc. For example, how would you go
> > about returning a DBCursor to a JMS endpoint?
> >
> > That's why we offer the skipping and limiting option so you can
> > perform pagination in such scenarios. You can also specify a batch
> > size. Take a look at the component page for further details.
> >
> > Hope that helps!
> > Raúl.
> >
> > > On 17 Apr 2014, at 15:41, Ephemeris Lappis <[hidden email]
> > > wrote:
> > >
> > > Hello.
> > >
> > > After some tests, it seems that the Camel MongoDB "findAll"
> > operation tries
> > > to load all the matching queried data into memory before process
> > them. With
> > > collections whose content is about tens millions of documents, this
> > > naturally leads to OutOfMemoryErrors...
> > >
> > > Does this component may use cursors to read the input data and
> > stream them ?
> > >
> > > An idea ?
> > >
> > > Thanks in advance.
> > >
> > > Regards.
> > >
> > >
> > >
> > > --
> > > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Does-Camel-MongoDB-use-cursors-on-findAll-tp5750352.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> >
> > 
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://camel.465427.n5.nabble.com/Does-Camel-MongoDB-use-cursors-on-findAll-tp5750352p5750355.html
> >
> > To unsubscribe from Does Camel MongoDB use cursors on findAll ?, click
> > here
> > <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5750352&code=ZXBoZW1lcmlzLmxhcHBpc0BnbWFpbC5jb218NTc1MDM1Mnw0OTQyMjM2NDI=
> >.
> > NAML
> > <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Does-Camel-MongoDB-use-cursors-on-findAll-tp5750352p5750357.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Does Camel MongoDB use cursors on findAll ?

2014-04-17 Thread Raul Kripalani
Hi,

We use Mongo cursors to read from the DB. But a DBCursor is not
something we can return to the route because not all technologies
support Streams, Cursors, Chunking, etc. For example, how would you go
about returning a DBCursor to a JMS endpoint?

That's why we offer the skipping and limiting option so you can
perform pagination in such scenarios. You can also specify a batch
size. Take a look at the component page for further details.

Hope that helps!
Raúl.

> On 17 Apr 2014, at 15:41, Ephemeris Lappis  wrote:
>
> Hello.
>
> After some tests, it seems that the Camel MongoDB "findAll" operation tries
> to load all the matching queried data into memory before process them. With
> collections whose content is about tens millions of documents, this
> naturally leads to OutOfMemoryErrors...
>
> Does this component may use cursors to read the input data and stream them ?
>
> An idea ?
>
> Thanks in advance.
>
> Regards.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Does-Camel-MongoDB-use-cursors-on-findAll-tp5750352.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JDBC component and jboss ds.xml file

2014-04-12 Thread Raul Kripalani
This will help you:
http://stackoverflow.com/questions/9183321/how-to-use-jndi-datasource-provided-by-tomcat-in-spring.

Raúl.

> On 12 Apr 2014, at 06:43, moj0002  wrote:
>
> I have my data source defined in a jboss ds file (myDB2Database-ds.xml) that
> goes either in the jboss deploy directory or ds directory
>
> 
> 
>   
>  myDataSource
>  jdbc:db2://;
>  com.ibm.db2.jcc.DB2Driver
> ... more properties here
>  
> 
>
> In my spring application context I define my route
>
>
> 
>
>http://camel.apache.org/schema/spring";>
>
>
>
>
>
>
> My sqlBean is just a simple
>
> public class SqlBean
> {
>   public String toSql()
>  {
> return "select current timestamp from sysibm.sysdummy1";
>}
> }
>
> I can't figure out how to reference the jndi data source (myDataSource)
> defined in the ds.xml file
> 
> is not working.
>
> How do I get the data source registered so I can get a handle to it?
>
> Looks like osgi uses  but I am not running in an OSGI container,
> just plain JBOSS 5.2 J2EE.
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/JDBC-component-and-jboss-ds-xml-file-tp5750137.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Succesful delivery acknowledgements..

2014-04-04 Thread Raul Kripalani
Hello

XA transactions are your friend in this scenario.

Beware that the whole goal of leveraging a Message Broker is to decouple
the producer from the consumer. In fact, when the producer sends the
message, there may be a consumer there may be not, but if you've set the
JMS delivery mode appropriately, the broker guarantees to attempt deliver
the message once the consumer is online again.

You should think of producer-broker and broker-consumer as transactional
boundaries where a handover of responsibilities is occurring. The producer
and consumer never interact directly.

So you have two options:

* Leverage XA transactions and delegate the responsibility of delivery to
the broker (thus honouring the philosophy of async messaging).
* Implement a custom mechanism for the consumer to send an ACK to the
consumer, perhaps using JMS Reply To.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Apr 4, 2014 at 3:33 PM, npa  wrote:

> I have been trying to come up with a camel route that would read from an
> activemq and write to Oracle AQ.
>
> However, when a message is written to Oracle-aq(all I care is succesfull
> delivery of the msg to Oracle aq), I have to write a successful message to
> another Active mq queue("something like message with id 41 has been sent to
> OracleAQ")
>
> Is there any "Auto-acknowledge" type of feature in camel that can be useful
> here?
>
> This is the basic route that i have that routes from active mq to oracle
> aq.
>
> 
> 
> 
> header1Value
> 
> 
> 
>
> Would it be better to use a transaction and have below 2. steps in the same
> transaction, so that the second happens after only if the first happened
> successfully.
>
> 1. Writing a message to Oracleaq from active mq
> 2. If (1.) happens successfully, then write a message to activemq2
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Succesful-delivery-acknowledgements-tp5749806.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: DataFormat Versus TypeConverters

2014-04-02 Thread Raul Kripalani
Sorry for the delay, I missed the original post from February.

This seems to me like a question on customising the Jackson bindings. Have
you tried using the @JsonValue annotation?

Have a look at [1].

[1]
http://stackoverflow.com/questions/13386930/why-doesnt-jsonunwrapped-work-for-lists

HTH,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Apr 2, 2014 at 6:46 AM, Raghu  wrote:

> Hi Yagyesh,
>
> Were you able to crack this?
> Even I have same problem and still not able to get any solution for this.
>
> If you done, can you share the code with me please?
>
> Thanks,
> Raghu
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/DataFormat-Versus-TypeConverters-tp5747307p5749650.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Looking for ideas to reduce code volume and duplication

2014-04-02 Thread Raul Kripalani
Try this technique. Nothing fancy, just a plain old Java static helper
method. It relies on Camel being able to configure exception handlers if
placed at the end of the route definition, which I think is possible.
Please give it a spin and report back to the community!

public class RouteExceptionHandlerEnhancer {
   public static void enhance(RouteDefinition def) {
  def.onException(Exception.class).useOriginalMessage().handled(true)
 // catch exceptions
   .setHeader(Exchange.FAILURE_ROUTE_ID,
property(Exchange.FAILURE_ROUTE_ID))// set route that errored
   .setHeader(Exchange.EXCEPTION_CAUGHT,
simple("${exception.stacktrace}"))
// Store reason for error
   .to(ExchangePattern.InOnly, endpointAMQ(config.
queueCaseAutomationDead()))
  .end();
   }
}


public class MyRoute extends RouteBuilder() {

@Override
public void configure() throws Exception {

   RouteDefinition route =
  from("direct:myendpoint")
  .log("Hello ${body")
  .to("activemq:queue:foo");

   RouteExceptionHandlerEnhancer.enhance(route);

}

}

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Tue, Apr 1, 2014 at 3:51 PM, kraythe .  wrote:

> Greetings:
>
> I have dozens of routes currently in our system and they have one of two
> variants of the following code:
>
> .onException(Exception.class).useOriginalMessage().handled(true) //
> catch exceptions
> .setHeader(Exchange.FAILURE_ROUTE_ID, property(Exchange.FAILURE_ROUTE_ID))
> // set route that errored
> .setHeader(Exchange.EXCEPTION_CAUGHT, simple("${exception.stacktrace}")) //
> Store reason for error
> .to(ExchangePattern.InOnly,
> endpointAMQ(config.queueCaseAutomationDead())).end() // to DLQ
>
> The problem is I am getting more than annoyed at having to copy paste this
> all over the place but since there are a couple of variants, I cant declare
> a global handler. Making a direct is all well and good but doesnt really
> buy me much as I still have half the handler on every route.
>
> Any ideas how I could reduce code volume here ?
>
> *Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
> *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
> *
>


Re: Issues with cxfrs using json

2014-03-31 Thread Raul Kripalani
It depends on what you're exposing the endpoint for.

If the REST endpoint is a gateway to a business process / service
orchestration / aggregation / scatter-gather / etc. (replace with any kind
of EIP or combination of EIPs), speaking to 10+ systems over different
protocols (SOAP, plain HTTP, JMS, TCP, FTP, File, Mail, AWS SQS, etc.) or
bridging different technologies (MongoDB, JDBC, Salesforce, Facebook,
Twitter, etc.), then it clearly makes sense to use Camel. It is integration
work and that's what Camel is built for.

If your REST endpoint is simply a micro-service with business logic, you
may as well use plain JAX-RS as you propose and inject a ProducerTemplate
if you want to leverage Camel in an ad-hoc manner.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Mon, Mar 31, 2014 at 4:24 PM, akcameluser wrote:

> Hi
>
> Just a brief comment. I wonder why people would expose a REST service
> through Camel Route? camel-http (jetty) would do the Job of exposing an
> HTTP
> endpoint. You will have to do the serialization and deserialization of JSON
> yourself, but much simpler way of exposing the endpoint. If you are looking
> for REST service with an elaborate REST API then go for another technology
> like Javax-rs(jersey) or Spring REST. Anyway this is my opinion and I might
> be wrong.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Issues-with-cxfrs-using-json-tp5749474p5749568.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Issues with cxfrs using json

2014-03-31 Thread Raul Kripalani
Exactly. Currently you are telling Camel that you want a String. That's why
you're not getting a POJO.

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Mon, Mar 31, 2014 at 9:36 AM, Sergey Beryozkin wrote:

> Hi,
> If you need CXF help converting the data into POJO then add
> DeltaRequestPOJO into the signature, instead of String/InputStream.
> This will work assuming a JAX-RS JSON provider is registered with the
> endpoint.
> Otherwise, if you prefer it done at the Camel level, then I guess you will
> need to set up Camel Data Format...
>
> Cheers, Sergey
>
> On 31/03/14 07:22, bijoy wrote:
>
>> Hi Sergey,
>>
>> Adding String and InputStream in the method signature making json data
>> available to exchange body but camel is not able to convert the json into
>> pojo. I'm using SimpleConsumer binding. I guess the problem is with
>> binding,
>> any idea?
>>
>> *camel-config.xml*
>> 
>> > uri="cxfrs://bean://restServer?bindingStyle=SimpleConsumer"/>
>> 
>> 
>> 
>>
>> *ValidateProcessor.java*
>> public void process(Exchange exchange) throws Exception {
>> String message = exchange.getIn().getBody(String.class);
>> System.out.println("JSON Message:"+message); //*proper json is displayed>*
>> DeltaRequestPOJO deltaReq =
>> exchange.getIn().getBody(DeltaRequestPOJO.class);
>> if (!deltaReq.getOrderId().isEmpty() && !deltaReq.getTimeStamp().
>> isEmpty())
>> // *getting null pointer here*
>> {
>> //some logic
>> }
>>
>> *DeltaRequestPOJO.java*
>> @XmlRootElement(name = "createDeltaRequest")
>> public class DeltaRequestPOJO {
>>
>> String orderId;
>> String timeStamp;
>>  // then getters and setters
>>
>> *RestServices.java*
>> @POST
>>  @Consumes("application/json")
>>  @Produces("application/json")
>>  @Path("/delta")
>>  public Response createDelta(String jsonData) {
>>  return null;
>>  }
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.
>> com/Issues-with-cxfrs-using-json-tp5749474p5749552.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>


Re: Issues with cxfrs using json

2014-03-28 Thread Raul Kripalani
Hello,

Could you add a Log endpoint with the showAll=true option?
We need to see what the incoming request looks like. Particularly the
Content-Type header.

Also please paste your JAX-RS resource class. Are you setting the
@Consumes annotation?

Another point: getBody(Class) also returns null when the type
conversion couldn't be made. This could happen if you have classpath
issues (e.g. the class definition duplicated).

Raúl.

Sent from my iPad

> On 28 Mar 2014, at 08:20, bijoy  wrote:
>
> Hi,
>
> I'm trying to expose a REST webservice which takes json as input and also
> provide response as json. I wanted to package the application as war and to
> deploy on external jetty container. I'm facing two problem implementing
> this.
>
> 1. The json object which comes along with REST request is not being mapped
> to Exchange body and while accessing the exchange body I'm getting
> NullPointerException. But sending json object as response is working fine.
> 2. To use JSONProvider I had to include following dependency...
> 
> org.apache.cxf
> cxf-bundle-jaxrs
> ${cxf.version}
> 
> But adding above dependency is running internal jetty container(on random
> port) on top of external jetty container(running on 8080) instance. I tried
> to exclude jetty-* artifacts from the dependency but getting exception while
> deploying the app. It seems the modules are inter-dependent so can't be
> excluded.
>
> Any guidance to solve the issues is much appreciated.
>
> *camel-config.xml*
> 
>  
>
>  
>
>
> 
>
>  
>
>  class="org.apache.cxf.jaxrs.provider.json.JSONProvider"/>
> 
>
>  streamCache="true">
> 
>uri="cxfrs://bean://restServer?bindingStyle=SimpleConsumer"/>
>   
> 
> 
>
> *RequestProcessor.java*
> public void process(Exchange exchange) throws Exception {
> RequestPOJO req = exchange.getIn().getBody(RequestPOJO.class); *//getting
> NullPointerException here*
> }
>
> *RequestPOJO.java*
> @XmlRootElement(name = "createRequest")
> public class RequestPOJO {
>
>String orderId;
>String timeStamp;
>public String getOrderId() {
>return reRatingOrderId;
>}
>public void setOrderId(String orderId) {
>this.orderId = orderId;
>}
>public String getTimeStamp() {
>return timeStamp;
>}
>public void setTimeStamp(String timestamp) {
>this.timeStamp = timestamp;
>}
>
> *web.xml*
> 
>  contextConfigLocation
>  classpath:camel-config.xml
>  
>
>  
>
> org.springframework.web.context.ContextLoaderListener
>  
>
>
>  
>CXFServlet
>org.apache.cxf.transport.servlet.CXFServlet
>1
>  
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Issues-with-cxfrs-using-json-tp5749474.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Updating state in a route.

2014-03-19 Thread Raul Kripalani
Sounds reasonable to me.
To prepare the system for HA, you can broadcast the state on a JMS
topic to which all nodes subscribe to. Contrary to making the route
itself check every two minutes, this method allows you to run the
checking logic in a single place inside the cluster, in an HA
scenario.
The only handicap is what happens when a node initializes and receives
messages before having received its first "heartbeat" from the
checker. Perhaps you'll need to implement a a handshake or bootstrap
mechanism when a node explicitly asks the state checker to broadcast
the last state.

Or better even, you could use AMQ Last Image subscription policy. This
will work pretty well.

Regards,
Raúl.

> On 19 Mar 2014, at 02:52, Corey Nolet  wrote:
>
> I am working on a throttling system for my ingest that will check to see if
> my upstream JMS broker is backed up to a particular threshold and, if it is
> backed up, begin to route messages to disk instead of sending them to the
> database.
>
> I'm wondering the best way to implement this using the correct EIP
> paradigms. I'll need to periodically (maybe every 2 minutes) check on the
> state of the broker and I was thinking of implementing a quartz route that
> would check the state and send a message into my main ingest routes with a
> special header (like throttle=true/false).
>
> I was thinking my main ingest routes can maintain their own state and
> further set some type of header like "shouldThrottle" on each of their
> messages so that I can use content based routing to determine where the
> messages should go:
>
> (header.get(shouldThrottle) == true) ? to('disk') : to('database')
>
> Does this seem like a reasonable solution or am I going about this the
> wrong way? I know EIP is all about trying to keep state in the streams
> instead of the processors. I'm not sure if there's a better solution than
> having the "state checker" send a message to the main ingest processors so
> they can set their own state.
>
>
> Thanks much!


Re: Accessing an osgi service interface from another bundle

2014-03-13 Thread Raul Kripalani
If Spring DM is able to resolve the OSGi reference correctly,
'mappingservice' becomes a local bean in the Spring Context of the second
bundle.

This means that you can inject it around like any other bean.

For example:





... provided that com.ab.mypgm has a setter for property "service", e.g.
public void setService(MappingInterface service).

Or you could use it from Camel:

   .to("bean:mappingservice?method=blabla").

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Thu, Mar 13, 2014 at 1:22 PM, vs_mahesh  wrote:

> Hi ,
>
> I have created 2 bundles
> 1)osgi service bundle
> *whose camel-context.xml i*s
>
>   class="com.outotec.uom.mapping.MappingInterfaceImpl">
>
> 
>
>  interface="com.outotec.uom.mapping.MappingInterface" ref="incidentService"
> />
>
> pom.xml includes maven bundle plugin with export option
>
>
>   
> org.apache.felix
> maven-bundle-plugin
> 2.3.4
> true
> 
>
> 
> 
>com.outotec.uom.mapping.MappingInterfaceImpl
> 
> 
>
>   com.outotec.uom.mapping*
> 
> *,
> 
>  *
>
> 
>
> auto-detect
>   
>
> 
> 
>   
>
> 2)from the second bundle am trying to acess the interface in the first osgi
> bundle
>
> the camel-context.xml contains a reference to the service
>
>   
>
> I have a bean which needs to access the interface from the first bundle
>
> class="com.ab.mypgm"
>  init-method="init" destroy-method="destroy">
>>
>
>  exposed as a service  from the bean class of the second bundle ?
>
> The pom file for the second file contains the following bundle plugin
> config
>  
> org.apache.felix
> maven-bundle-plugin
> 2.3.4
> true
> 
>
> 
> *,
> com.outotec.uom.mapping,
> 
> 
> 
>   
>
> Thanks,
> Mahesh
>
>
>
>
> -
> Thanks And regards,
> Mahesh
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Accessing-an-osgi-service-interface-from-another-bundle-tp5748769.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel CXF RS

2014-03-05 Thread Raul Kripalani
Unfortunately that tutorial only showcases Camel as a client, but not as a
service provider.

If you want to build a JAX-RS service, I suggest you use the new
SimpleBinding to make sure that your @HeaderParams, @PathParams,
@QueryParams, etc. are injected as Camel headers, and that your request
payload is injected as the Camel IN message body.

This will rid you of manually processing a MessageContentsList object and
tightly coupling your route implementation to the order of parameters in
the JAX-RS method signature.

More info in our camel-cxfrs Wiki page.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Mar 5, 2014 at 10:14 AM, David Parker  wrote:

> Or try this very good tutorial project
> https://github.com/santoshjoshi/camel-cxfrs-example
>
>
> On Tue, Mar 4, 2014 at 10:22 PM, Charlie Mordant  >wrote:
>
> > Hi,
> >
> > You can dig starting from here:
> >
> >
> https://github.com/Tcharl/net.osgiliath.hello/blob/master/net.osgiliath.hello.routes/src/main/java/net/osgiliath/hello/routes/HelloRoute.java
> > .
> >
> > REGARDS,
> >
> >
> > 2014-03-04 19:16 GMT+01:00 CamelTester :
> >
> > > Hi,
> > > Can anyone give an complete camel CXF RS example?
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > > http://camel.465427.n5.nabble.com/Camel-CXF-RS-tp5748301.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
> >
> >
> > --
> > Cordialement,
> >
> > Charlie Mordant
> >
>


Re: Unable to resolve endpoint for cxf rest service

2014-02-19 Thread Raul Kripalani
Hello,

You have camel-core and camel-spring version 2.10 mixed up with camel-cxf
version 2.12. The class definitions are different, that's why they can't
find each other.

Try upgrading camel-core and camel-spring to 2.12.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Feb 19, 2014 at 9:26 AM, amilabanuka  wrote:

> I\m creating a project wich exposes rest web service.
>
> here is my camel route
> http://camel.apache.org/schema/spring";>
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> and the cxf end point is as follows
>address="http://localhost:8080/sims/control";
>   serviceClass=""
>   loggingFeatureEnabled="true">
>
> 
> 
> 
>
> 
>
>
> when installing in karaf following exception is thrown
>
> karaf@root> Exception in thread "SpringOsgiExtenderThread-6"
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> route3: Route[[From[cxfrs:bean:restServer]] -> [Log[...
> because of Failed to resolve endpoint: cxfrs://bean:restServer due to:
> Cannot auto create component: cxfrs
> at
>
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1280)
> at
>
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
> at
>
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:280)
> at
>
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
> at
>
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
> at
>
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
> at
>
> org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
> at
>
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
> at
>
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
> at
>
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
> at
>
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create
> route route3: Route[[From[cxfrs:bean:restServer]] ->
> [Log[... because of Failed to resolve endpoint:
> cxfrs://bean:restServer due to: Cannot auto create component: cxfrs
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:176)
> at
>
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:712)
> at
>
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1749)
> at
>
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1542)
> at
>
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1427)
> at
>
> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
> at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
> at
>
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1395)
> at
>
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)
> at
>
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
> ... 10 more
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
> resolve endpoint: cxfrs://bean:restServer due to: Cannot auto create
> component: cxfrs
> at
>
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:469)
> at
>
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:50)
> at
>
> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:186)
> at
>
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
> at
>
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
>  

Re: Java Route Not Finishing

2014-02-13 Thread Raul Kripalani
If the incoming message via the MQTT consumer was InOut (i.e.
request-reply), it's likely that the JMS producer is sending the message as
InOut. This means that the producer is waiting for a reply.
Try setting the 'exchangePattern' option on the JMS endpoint to 'InOnly' to
instruct the producer that it must not wait for a reply, i.e.:

.to("jms:topic:zaq.avila.receive?exchangePattern=InOnly");


Let us know if this fixed your issue.

Thanks,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Thu, Feb 13, 2014 at 6:56 PM, Zadko  wrote:

> It turns out that the MQTT component only supports consuming from that
> endpoint. I figured out that I can consume a message as an MQTT message if
> I
> send the message as a JMS. Like follows:
>
> from("mqtt:test?subscribeTopicName=zaq.avila.send")
> .process(new RestProcessor())
> .to("jms:topic:zaq.avila.receive");
>
> The MQTT subscriber receives the payload of the JMS message as the body of
> the mqtt message. It works very well. I'm not sure what the shorthand of
> approaching it this way are. If there are any, please let me know.
>
> Thank you for addressing my question
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Java-Route-Not-Finishing-tp5747047p5747273.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel MongoDB Bug related to Type Conversion

2014-01-16 Thread Raul Kripalani
Hello,

Yes, as far as I remember the Type Converter Registry memorises what
converters were successful in converting from a given source to a
destination type, with the goal of speeding up the resolution of future
type conversion attempts. Probably this converter is getting blacklisted
due to the exception.

I'll take a look into it.

In the meantime, may I suggest that you validate the JSON defensively,
before dispatching to the MongoDB endpoint? e.g. a processor/bean with some
code like [1] will do. Alas, if the JSON is correct you could have incurred
in the cost of deserialization twice, but it's a fair workaround for now.

[1]
http://stackoverflow.com/questions/10226897/how-to-validate-json-with-jackson-json

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk


Re: Distributed AggregationRepository

2014-01-09 Thread Raul Kripalani
Hi Claus,

On Thu, Jan 9, 2014 at 8:42 AM, Claus Ibsen  wrote:

> Hmm I am not aware of such.
>
> camel-levedb is using same principle as the leveldb store in AMQ
> http://activemq.apache.org/leveldb-store.html
>
> And allows concurrent and distributed reads/writes to the shared
> store. eg use a shared LAN for the file.
>

LevelDb doesn't, per-se, as expressed on their page [1]:

"Only a single process (possibly multi-threaded) can access a particular
database at a time."

To my understanding, the "Replicated LevelDB Store" developed in ActiveMQ
is simply that: a mechanism to replicate a given DB to remote nodes. But it
doesn't mean that different clients/nodes are opening to the same DB all at
once. That's not even possible with LevelDB because it is an embedded DB,
not exposed on the network directly. You'd have to implement your own layer
to provide this connectivity, or use something like multilevel [2].

[1] https://code.google.com/p/leveldb/
[2] https://github.com/juliangruber/multilevel

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk


Re: Distributed AggregationRepository

2014-01-08 Thread Raul Kripalani
Careful, HawtDB is deprecated, as advertised in the camel-hawtdb component
page. Unfortunately, the warning doesn't render in a shaded box any longer
(due to some recent Confluence migration), so it's easy to miss it. Sorry
about that.

LevelDB is recommended instead, but the technology has two limitation: it
runs embedded and only one physical process can open the data files
simultaneously. In other words, it does not support distributed access OOTB.

The old-school advice would be to use the JDBC Aggregation Repository along
with either a SQL DB or a NoSQL DB from whom JDBC support exists. For
example, there are some experimental projects providing JDBC drivers for
MongoDB, or OrientDB has some support for JDBC too.

Alternatively, we would be extremely happy if you contributed a new NoSQL
Aggregation Repository. I can see much benefit in incorporating a MongoDB
Aggregation Repository to the camel-mongodb component which uses the native
Java driver.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Jan 8, 2014 at 3:14 PM, Tom Fornoville wrote:

> Hi camel-users,
>
> Since we're going to run our system distributed (multiple containers in
> Fuse Fabric) we need an alternative to the default
> MemoryAggregationRepository.
>
> Although we found it awkward that the Hazelcast component only offers an
> IdempotentRepository and no AggregationRepository we found an
> implementation here: https://github.com/smecsia/camel-hazelcast. We tried
> that but sometimes we get strange TimeoutExceptions and we're not
> experienced enough with Hazelcast to determine the root-cause.
>
> Some extra searching on the Camel site led me to HawtDB (
> http://camel.apache.org/hawtdb.html).
> So I now have 3 questions:
> 1) does HawtDB work out-of-the-box in a distributed environment (provided
> that you can place the file on a shared location), and can it recover
> wihtout extra manual steps?
>
> 2) can you place multiple repositories in a single file or do you need a
> separate file per repository (we have 5 aggregators on our system, each one
> needing its own repository)
>
> 3) are there any other proven and documented implementations of
> AggregationRepository that work in distributed environments?
>
> Thanks in advance,
> Tom
>


Re: DSL Logging not outputting to the logs

2013-12-02 Thread Raul Kripalani
Are you getting any other log statements printed out to your 'out' console
appender?

Given that you've set the root log level to DEBUG in your log4j
configuration, you should be seeing a lot of log noise from Camel.

If you don't, your container may not be picking up your log4j configuration
file.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist | http://about.me/raulkripalani |
http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Sun, Dec 1, 2013 at 5:04 PM, mckinnonrob  wrote:

> Claus Ibsen-2 wrote
> > Are you sure the route pickup any messages to route? The log DSL will
> > only log if there is messages.
>
> Yes I am sure. In my route the body is ultimately being placed on a queue,
> CAMEL_FINAL, and all the messages are showing up there fine.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/DSL-Logging-not-outputting-to-the-logs-tp5744093p5744137.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: a camel based solution that can read message headers without de-queuing a message from the MQ

2013-11-20 Thread Raul Kripalani
You can use JMS Message Selectors with Queue Browsers.
So if you're looking for messages with a particular value in a particular
header, you can create a Message Selector for that.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Wed, Nov 20, 2013 at 1:50 PM, Claus Ibsen  wrote:

> No the JMS browse API does not dequeue the messages.
> But the browse API cannot access by random index, and it can be
> "heavy" to use if you want to browse large queues.
>
>
> On Wed, Nov 20, 2013 at 2:30 PM, LoginJones  wrote:
> > Doesn't using browse dequeue the message?
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/a-camel-based-solution-that-can-read-message-headers-without-de-queuing-a-message-from-the-MQ-tp5736556p5743574.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: xpath filter question

2013-11-16 Thread Raul Kripalani
In the future, you can use the .logNamespaces() option of the XPath
expression to ask Camel to dump to your log files the namespaces that are
discovered in your incoming XML payload.

BTW - the work your processor is doing is simply to convert the payload to
a String. You can achieve this by using the .convertBodyTo(String.class)
DSL. But I suspect that you don't need it at all, as you yourself are
figuring out...

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Nov 15, 2013 at 2:59 PM, John Dubchak  wrote:

> Hi Reji,
>
> Thanks for the response.  I added an .otherwise().log("xpath predicate
> failed...") and found out that I was running into an issue with namespaces.
>  Once I addressed the namespace issue, I was able to send a notification
> and have it work through the route correctly.
>
> Here is what I ended up with:
>
> DataFormat jaxb = new JaxbDataFormat("com.example.
> services.schemas.notification");
> Namespaces ns = new Namespaces("tns", "http://www.example.com/
> services/notifications");
>
> from("activemq:cdw.Notifications")
> .log("Recieved notification ${id}: ")
>   .choice()
> .when(ns.xpath("/tns:notification/tns:type = 'email'"))
> .process(new Processor() {
> @Override
> public void process(Exchange exchange) throws Exception {
> String body = exchange.getIn().getBody(String.class);
> exchange.getOut().setBody(body);
> }
> })
> .unmarshal(jaxb).bean(notifier, "send")
> .otherwise().log("No match for message: ${id}").stop();
>
> I'm not entirely positive that I require the processor before
> unmarshaling, however it works and I may end up removing that and testing
> it again.  But, it was a namespace issue in the XML and xpath wasn't
> matching as a result.
>
> John
>
>
> On 11/14/13 7:04 PM, Reji Mathews wrote:
>
>> John
>>
>> What is the error?  Anything in log?  And to which component are u
>> sending the message after removing the processor
>>
>> Reji
>>
>> ravindra.godb...@cognizant.com wrote:
>>
>>  Can you share the sample xml message ? Does it have namespace in it ?
>>> 
>>> From: John Dubchak [j...@johndubchak.com]
>>> Sent: Friday, November 15, 2013 1:42 AM
>>> To: users@camel.apache.org
>>> Subject: xpath filter question
>>>
>>> Hi,
>>>
>>> I am trying to create a JavaDSL route that filters an incoming XML from
>>> an ActiveMQ queue.  The message is being delivered correctly and I can
>>> print it out if I short-circuit it with a processor that dumps the
>>> message.  However, removing the processor, I cannot seem to get the
>>> correct xpath expression to match on a particular value:
>>>
>>> from("activemq:cdw.Notifications")
>>>.filter()
>>> .xpath("/parent_node[child_node = 'value of text']")
>>>
>>> Any insight into what I've messed up?
>>>
>>> Thanks,
>>> John
>>>
>>>
>>>
>>>
>>>
>>> This e-mail and any files transmitted with it are for the sole use of
>>> the intended recipient(s) and may contain confidential and privileged
>>> information. If you are not the intended recipient(s), please reply to the
>>> sender and destroy all copies of the original message. Any unauthorized
>>> review, use, disclosure, dissemination, forwarding, printing or copying of
>>> this email, and/or any action taken in reliance on the contents of this
>>> e-mail is strictly prohibited and may be unlawful.
>>>
>>
>


Re: xmljson convert XML from file to JSON straight into MongoDB issue

2013-11-14 Thread Raul Kripalani
Do you see any exceptions?

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Thu, Nov 14, 2013 at 2:51 PM, eholsinger <
eric.holsin...@metronaviation.com> wrote:

> Hi,
>
> Found this link on the web and thought I'd try it, seems straightforward
> enough, but I haven't gotten it to work yet:
> http://www.andreagirardi.it/blog/route-a-message-to-mongodb/
>
>
> What i include in this post is:
> -my full camel-context.xml
> -the XML directly from the file i'm trying to push into mongo with the
> route
> described
> -the JSON from a xmljson file > file route that does work
>
> Any insight would be appreciated.
>
> Thx, Eric
>
>
>
> *My camel-context.xml file:*
> 
>
>
> 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://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd";>
>
>
>xmlns="http://camel.apache.org/schema/spring";>
>
>
> 
>  skipWhitespace="true" trimSpaces="true" skipNamespaces="true"
> removeNamespacePrefixes="true"/>
> 
>
>
> 
>   
>   
>   
> uri="file:/C:/temp/jsonfiles?fileName=${file:name.noext}_${date:now:MMdd_HHmmss}.json"
> />
> 
>
>
>
> 
>   
>   
>   
> uri="mongodb:myDb?database=test&collection=aixm&operation=save" />
> 
>
>   
>
>
> 
> 
> 
>
>
> 
>
>
> *The XML from the file:*
> this is a test
>
> messagevalue3value2value1
>
> *The JSON from the file > file route that does work:*
> {"root":{"aps":["this is a
> testmessage"],"key3":"value3","key2":"value2","key1":"value1"}}
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/xmljson-convert-XML-from-file-to-JSON-straight-into-MongoDB-issue-tp5743285.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: MongoDB exchange Out Body is null, using Apache Camel

2013-11-09 Thread Raul Kripalani
If you're using Camel >= 2.10.3 or 2.11, enable the writeResultAsHeader
endpoint option.

In the future, please use the users@ forum for such queries. And please
remember to always indicate what version of Camel you're running on.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Nov 8, 2013 at 7:11 PM, bipin.sutariya wrote:

> I am trying to save some data in MongoDB using apache Camel. Following is
> my
> code
>
> from("direct:saveData")
> .process(dataSaveRequestProcessor)
> .streamCaching()
>
> .to("mongodb:emailDB?database=myDB&collection=myData&operation=save&writeConcern=safe&writeResultAsHeader=true")
>.process(dataSaveResponseProcessor);
>
> Now issue is in MongoDB record is saved, but it is not returned back to my
> Response Processor. I need _id that is generated in MongoDB to pass to
> another Route.
>
>
> Following is System.out in Response Processor
>
> ===> OUT BODY : null
> ===> OUT BODY HEADER: {}
> ===> IN BODY : { "serverUsed" : "/127.0.0.1:27017" , "n" : 0 ,
> "connectionId" : 22 , "err" :  null  , "ok" : 1.0}
> ===> IN BODY HEADER : {CamelMongoWriteResult={ "serverUsed" :
> "/127.0.0.1:27017" , "n" : 0 , "connectionId" : 22 , "err" :  null  ,"ok"
> :
> 1.0}, CamelMongoDbLastError={ "serverUsed" : "/127.0.0.1:27017" , "n" : 0
> ,
> "connectionId" : 22 , "err" : null , "ok" : 1.0}}
>
>
> Can anybody pointed out where I am making mistake. Why there is not _id in
> exchange.getIN().getBody()
>
> Thank you in Advance
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/MongoDB-exchange-Out-Body-is-null-using-Apache-Camel-tp5742888.html
> Sent from the Camel Development mailing list archive at Nabble.com.


Re: SJMS failure with stale reply queue

2013-11-09 Thread Raul Kripalani
Yes, exactly. JIRA: https://issues.apache.org/jira/browse/CAMEL-6950.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Sat, Nov 9, 2013 at 8:20 AM, Claus Ibsen  wrote:

> Hi
>
> It does sounds like camel-sjms lacks the re-connect functionality that
> camel-jms has by the spring's default message listener container.
>
>
>
> On Fri, Nov 8, 2013 at 2:22 PM, Harald Wellmann 
> wrote:
> > Here's a slightly different scenario demonstrating the issue with SJMS,
> > this time not involving stale temp queues:
> >
> > 1) Start ActiveMQ Broker
> > 2) Start JBoss with Camel/SJMS consumer application
> > 3) Run one-shot producer application (i.e. simple program which sends one
> > message and then exits).
> > 4) Everything working fine.
> > 5) Stop broker -> Error messages in JBoss console from stale connections.
> > 6) Restart broker
> > 7) Re-run producer -> Nothing happens. SJMS does not reconnect.
> >
> > Replacing SJMS by JMS, the communication is reestablished automatically
> > after broker restart. While the broker is down, camel-jms periodically
> > tries to reconnect without success.
> >
> > So it seems camel-sjms is missing the reconnection feature, or am I
> missing
> > a configuration option?
> >
> > Regards,
> > Harald
> >
> >
> > 2013/11/8 Harald Wellmann 
> >
> >> The real problem is not that the temp queue is gone, the fatal thing is
> >> that SJMS stops working after one attempt to send to a missing queue.
> >>
> >> I've tried to debug the situation, and it seems that SJMS creates
> sessions
> >> in advance from connections obtained from JBoss, but JBoss closes each
> >> connection when an exception occurs, and SJMS doesn't seem to notice
> that
> >> it's session is invalid.
> >>
> >> Regards,
> >> Harald
> >>
> >>
> >>
> >> 2013/11/8 Raul Kripalani 
> >>
> >>> I don't think the situation can be avoided – if anything, it can be
> >>> contained via AMQ broker configuration.
> >>>
> >>> Take a look at [1]. Should be a similar situation.
> >>>
> >>> [1]
> >>>
> >>>
> http://stackoverflow.com/questions/6432672/activemq-how-to-handle-broker-failovers-while-using-temporary-queues
> >>>
> >>> Regards,
> >>>
> >>> *Raúl Kripalani*
> >>> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> >>> Integration specialist
> >>> http://about.me/raulkripalani |
> http://www.linkedin.com/in/raulkripalani
> >>> http://blog.raulkr.net | twitter: @raulvk
> >>>
> >>> On Fri, Nov 8, 2013 at 11:54 AM, Harald Wellmann <
> hwellmann...@gmail.com
> >>> >wrote:
> >>>
> >>> > That might help in some cases, but I don't see how it solves the
> >>> problem,
> >>> > when the producer dies before the message TTL is over.
> >>> >
> >>> > Regards,
> >>> > Harald
> >>> >
> >>> >
> >>> > 2013/11/8 Raul Kripalani 
> >>> >
> >>> > > If these are request-reply interactions, producers should set a
> Time
> >>> To
> >>> > > Live when sending a message to the queue. The broker will then
> expire
> >>> > stale
> >>> > > messages automatically and they won't be delivered to the consumer,
> >>> thus
> >>> > > reducing the risk of the consumer sending out unexpected replies
> like
> >>> > this
> >>> > > one.
> >>> > >
> >>> > > Regards,
> >>> > >
> >>> > > *Raúl Kripalani*
> >>> > > Apache Camel PMC Member & Committer | Enterprise Architect, Open
> >>> Source
> >>> > > Integration specialist
> >>> > > http://about.me/raulkripalani |
> >>> http://www.linkedin.com/in/raulkripalani
> >>> > > http://blog.raulkr.net | twitter: @raulvk
> >>> > >
> >>> > >
> >>> > > On Fri, Nov 8, 2013 at 11:17 AM, Harald Wellmann <
> >>> hwellmann...@gmail.com
> >>> > > >wrote:
> >

  1   2   3   4   >