Re: Need an Example to pass XMLTYPE output to Oracle stored procedure. facing issue with my code

2017-02-12 Thread Vitalii Tymchyshyn
It looks like you object is not valid anymore after original connection is
closed. Try using transaction that covers both calls - this would retain
connection open.

сб, 11 лют. 2017 о 02:43 kumarburla  пише:

> Hi Team,
>
> I am using sql-stored component and to execute stored procedure in Oracle
> DB. One of my OUT parameters in SQLXML.
>
> When i am getting output in body, i am getting type as oracle.xdb.XMLType.
> I
> am passing this output to another procedure but i am getting error while
> doing so. Below is my code
>
> /Step 1 : Call to Oracle Stored procedure
> 
> 
> 
> Step 2 : 
> ${body.[PR]}
> 
> 
> Step 3:
> ${body}
>  uri="sql-stored:SP_Test1(SQLXML ${header.test1})?dataSource=ds1}"
> /> /
>
>
> After executing the above steps below is my stack trace.
>
> 2017-02-10 16:40:24,601 | INFO  |  324
> {PATIENTRECORDS=oracle.xdb.XMLType@7941dbe3}
> 2017-02-10 16:40:24,662 | INFO  |  123  oracle.xdb.XMLType@7941dbe3
> 2017-02-10 16:40:24,662 | INFO  |  after 324  oracle.xdb.XMLType@7941dbe3
> 2017-02-10 16:40:25,024 | INFO  |
> org.springframework.dao.RecoverableDataAccessException:
> CallableStatementCallback; SQL [{call SP_Test1(?)}]; Closed Connection;
> nested exception is java.sql.SQLRecoverableException: Closed Connection
> at
>
> org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:98)
> at
>
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
> at
>
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
> at
> org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1094)
> at
> org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1130)
> at
>
> org.springframework.jdbc.object.StoredProcedure.execute(StoredProcedure.java:142)
> at
>
> org.apache.camel.component.sql.stored.TemplateStoredProcedure.execute(TemplateStoredProcedure.java:74)
> at
>
> org.apache.camel.component.sql.stored.CallableStatementWrapper.populateStatement(CallableStatementWrapper.java:104)
> at
>
> org.apache.camel.component.sql.stored.SqlStoredProducer$1.execute(SqlStoredProducer.java:69)
> at
>
> org.apache.camel.component.sql.stored.CallableStatementWrapper.call(CallableStatementWrapper.java:55)
> at
>
> org.apache.camel.component.sql.stored.SqlStoredProducer.process(SqlStoredProducer.java:43)
> at
>
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
>
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:173)
> at
>
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:341)
> at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:168)
> at
>
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> at
>
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
> at
> org.apache.camel.processor.TryProcessor.process(TryProcessor.java:113)
> at
> org.apache.camel.processor.TryProcessor.process(TryProcessor.java:84)
> at
>
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> at
>
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> at
>
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> at
>
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:192)
> at
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
> at java.util.TimerThread.mainLoop(Timer.java:555)
> at java.util.TimerThread.run(Timer.java:505)
> Caused by: java.sql.SQLRecoverableException: Closed Connection
> at
>
> oracle.jdbc.driver.PhysicalConnection.prepareCall(PhysicalConnection.java:4178)
> at
>
> oracle.jdbc.driver.PhysicalConnection.prepareCall(PhysicalConnection.java:4134)
> at
> oracle.jdbc.oracore.OracleTypeADT.initMetadata12(OracleTypeADT.java:551)
> at
> oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:507)
> at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:469)
> at
> oracle.sql.OpaqueDescriptor.initPickler(OpaqueDescriptor.java:258)
> at oracle.sql.OpaqueDescriptor.(OpaqueDescriptor.java:59)
> at
> oracle.sql.OpaqueDescriptor.createDescriptor(OpaqueDescriptor.java:177)
> at 

Re: remap 'http' to use the camel http4 component by default

2017-02-02 Thread Vitalii Tymchyshyn
Hi.

Just create a bean in registry with name http and proper component type.
E.g. if you are using spring, define a spring bean.

On Thu, Feb 2, 2017, 7:02 AM jack patwork  wrote:

> Hi,
>
> Is it possible to remap the 'http4' component to use the 'http' component
> id. I'm asking because I have distributed application where a bunch of http
> urls are being passed in as parameters and camel is mapping them to the
> http component.
>
> During performance testing it's revealed that we can get a significant gain
> by switching to the httpclient 4.x. I'm wondering if there is a central
> place where camel could be reconfigured, instead of finding all the
> affected routes and ensuring a mapping between protocol and component-id is
> in place.
>
> Thanks in advance!
>
> Jack
>


Re: Special characters in URL's

2017-01-03 Thread Vitalii Tymchyshyn
There are two things to consider:
1) Server never receives anything after #. It's a purely client-side
feature to navigate inside the page. It's never sent to server.
2) uri in the logs below is camel endpoint uri, not http one.Path looks
correct to me, but please see (1).

Best regards, Vitalii Tymchyshyn

On Tue, Jan 3, 2017, 5:32 AM diogopedreira <
diogo.emanuel.pedre...@celfocus.com> wrote:

> Yes, I don't want the URL to be encoded. I'm using jetty.
>
> Please find below an example of my routes configuration and startup log.
>
> from("jetty:http://0.0.0.0:8080/xpto/#/accounts)
>
> .to("
> http://localhost/xpto/QK7SYGTE2#/screens/170375275/?bridgeEndpoint=true=false
> ");
>
>
> 2017-01-02 18:46:25.402 DEBUG 13824 --- [   main]
> org.apache.camel.impl.DefaultComponent   : Creating endpoint
> uri=[jetty://http://0.0.0.0:8080/xpto/%23/accounts],
> path=[http://0.0.0.0:8080/xpto/#/accounts]
> 2017-01-02 18:46:25.403 DEBUG 13824 --- [   main]
> o.a.camel.spring.SpringCamelContext  :
> jetty://http://0.0.0.0:8080/xpto/%23/accounts converted to endpoint:
> Endpoint[jetty:http://0.0.0.0:8080/xpto/%23/accounts] by component:
> org.apache.camel.component.jetty9.JettyHttpComponent9@272afff9
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Special-characters-in-URL-s-tp5792076p5792088.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Non-blocking HTTP based Microservices

2016-12-22 Thread Vitalii Tymchyshyn
As I've said, camel has tons of non-blocking endpoints. This is the list,
but I am not sure if its complete:
http://camel.apache.org/asynchronous-routing-engine.html

Чт, 22 груд. 2016 14:04 користувач linktech  пише:

> It does look like: http://camel.apache.org/asynchronous-processing.html
> may
> be what I am looking for. Will any consumer that is non-blocking work or
> just Jetty?
>
> Thanks,
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Non-blocking-HTTP-based-Microservices-tp5791879p5791890.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Non-blocking HTTP based Microservices

2016-12-22 Thread Vitalii Tymchyshyn
In camel it works in a bit different way, actually easier than in IoC
scenarios.
As soon as all endpoints in your route are non-blocking, the whole route
should be non-blocking to.

Чт, 22 груд. 2016 13:35 користувач linktech  пише:

> I am looking for the same REST HTTP functionality in Camel as outline in
> this
> great article on Spring Integration:
> https://dzone.com/articles/non-blocking-rest-services-with-spring. Need to
> be able to return the REST response (deferred) to the HTTP stack and
> release
> the request thread.  When the deferred request is notified via callback
> that
> data in ready the HTTP stack would send response back to client.
>
> I think it would require the REST support to return a different Response
> type (DeferredResponse) based on ListenableFuture that is recognized by
> HTTP
> implementation or some layer above so that we have true non-blocking.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Non-blocking-HTTP-based-Microservices-tp5791879p5791886.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Non-blocking HTTP based Microservices

2016-12-22 Thread Vitalii Tymchyshyn
For custom logic you can return a CompletableFuture from your @Handler or
implement AsyncProcessor.

As of existing endpoints, many support non-blocking operations in both
server and client modes, e.g. netty4-http, servlet, http client, cxf (just
from my head, there are more).

Best regards, Vitalii Tymchyshyn

22 груд. 2016 р. 12:52 "linktech" <kl...@acm.org> пише:


Looking for Camel capability and examples for REST consumers & producers
using non-blocking HTTP Libs to support non-blocking HTTP request/responses.
I did see the some support for producer templates but not on consumers or
REST DSL. I see where Spring has support for ListenableFuture &
DeferredResult for consumer interfaces. Is there a Camel equivalent? This
would significantly reduce the need for non-blocking platforms such as
Node.js.

Thanks,



--
View this message in context: http://camel.465427.n5.nabble.
com/Camel-Non-blocking-HTTP-based-Microservices-tp5791879.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: 'host' configuration param not used by servlet

2016-11-10 Thread Vitalii Tymchyshyn
In Tomcat you can add
https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html

Ср, 2 лист. 2016 о 13:51 Jonas Koperdraat  пише:

> Hi Zoran,
>
> I've checked and the proxy sets the 'X-Forwarded-Host' header and this
> contains the 'correct' host. The 'Host' header is also present on the
> request and this contains the hostname of the actual machine the servlet is
> running on. I'm not sure if we have the option to set it, but seeing as we
> already have the desired hostname available in de 'X-Forwarded-Host' option
> I'm not going to investigate that further ;-)
>
> But I guess our servlet container, which indeed is Tomcat, doesn't take the
> X-Forwarded-Host header into consideration when constructing the requestUrl
> parameter of the SerlvetRequest. So we'll have to manually insert the
> desired hostname into the request url.
>
> Kind regards,
>
> Jonas
>
> Op wo 2 nov. 2016 om 16:33 schreef Zoran Regvart :
>
> > Hi Jonas,
> >
> > On Wed, Nov 2, 2016 at 4:25 PM, Jonas Koperdraat
> >  wrote:
> > > I don't know whether that header is being sent by the proxy. Should
> that
> > > impact the behavior I am seeing (e.g. should does that influence the
> > result
> > > of getRequestURL)?
> >
> > It does on some Servlet engines / middlewares, it might not in your
> > case, especially if you're using Tomcat.
> >
> > Another header that you might want to investigate is the `Host`
> > header, it's used for virtual hosts, and you might have an option to
> > set it in your proxy (on the request sent to the backend).
> >
> > zoran
> > --
> > Zoran Regvart
> > zregv...@redhat.com
> >
>


Re: Avro component example

2016-10-16 Thread Vitalii Tymchyshyn
Unfortunately, I can't share work code, but you can check examples from
test code:
https://github.com/apache/camel/blob/52a739feb9da8acd29067304c7c8356bbc5ef4dd/components/camel-avro/src/test/resources/org/apache/camel/dataformat/avro/springDataFormat.xml

Сб, 15 жовт. 2016 о 04:20 owain <owain@integration.technology> пише:

> Have you a simple example you could share?
>
> Sent from my iPhone
>
> > On 15 Oct 2016, at 03:11, Vitalii Tymchyshyn [via Camel] <
> ml-node+s465427n5788829...@n5.nabble.com> wrote:
> >
> > We are using avro quite succesfully.
> >
> > Чт, 13 жовт. 2016 07:25 користувач owain <[hidden email]>
> > пише:
> >
> > > Hi,
> > >
> > > Has anyone had any success converting a body (pojo) to an avro message
> via
> > > the avro component.  I have generated the avro serialiser for the avro
> > > message bit I am struggling with the documentation and questions
> online.  I
> > > am planning to send the avro message to some other routes via kakfa and
> > > avro
> > > seems like a good choice to reduce the coupling of the subsequent
> routes
> > > (services) on the domain model.
> > >
> > > I am using Blueprint.
> > >
> > > Thanks,
> > >
> > > O.
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> http://camel.465427.n5.nabble.com/Avro-component-example-tp5788728.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/Avro-component-example-tp5788728p5788829.html
> > To unsubscribe from Avro component example, click here.
> > NAML
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Avro-component-example-tp5788728p5788833.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Avro component example

2016-10-14 Thread Vitalii Tymchyshyn
We are using avro quite succesfully.

Чт, 13 жовт. 2016 07:25 користувач owain 
пише:

> Hi,
>
> Has anyone had any success converting a body (pojo) to an avro message via
> the avro component.  I have generated the avro serialiser for the avro
> message bit I am struggling with the documentation and questions online.  I
> am planning to send the avro message to some other routes via kakfa and
> avro
> seems like a good choice to reduce the coupling of the subsequent routes
> (services) on the domain model.
>
> I am using Blueprint.
>
> Thanks,
>
> O.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Avro-component-example-tp5788728.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Looping in routes using Direct Component - Performance impact?

2016-10-14 Thread Vitalii Tymchyshyn
I think you would get into a recusion this way and end up with stack
overflow.
You should try http://camel.apache.org/dynamic-router.html

Best regards, Vitalii Tymchyshyn

13 жовт. 2016 р. 18:31 "Goyal, Arpit" <arpit.go...@sap.com> пише:

> Hi,
>
> We currently are on 2.16.3 version and can't use the loop function (part
> of 2.17). So we have the following routes based on which we create sort of
> loop with switch case. Now we are worried about the performance (when we
> see stacktrace of camel processing)
>
> Route 1:  from("direct:s1).to("read one page of data").process("process
> one page").to("direct:s2");
>
> Route 2:  from("direct:s2").toD("go to external source").when("are more
> pages left").to("direct:s1").otherwise().process("end processing");
>
> Now if there are thousands of pages, it is possible that this loop creates
> lot of objects in memory & can create performance issue? Is there a way for
> Camel to be told, before going to route 1 again, forget all the past? Is
> disabling HISTORY would solve that?
>
> Regards,
> Arpit.
>


Re: Limit Concurrent Access

2016-10-03 Thread Vitalii Tymchyshyn
I am not sure that Debraj was talking about incoming calls. And I was also
looking for a way to limit number of concurrent exchanges being sent to
given endpoint.
In the Async scenario even thread pool can't help because one can make
unlimited number of exchanges with one thread.
And Throttler does not account for concurrent request amount, so it can't
be used to limit concurrency level. I am actually thinking on extending
Thtottler.
To be specific, my usecase is batch processing where I need to make some
web service calls with Netty. Currently without the limitation it can open
up to few hundred concurrent sockets that unnesessary overloads the server.
I'd like to set a limit of e.g. 20 concurrent calls with others waiting
(similar to database connection pool).
Netty4 component has limits to set, but it starts to fail when limit is
reached instead of waiting. It would be very useful to have a generic
module to help in such cases.

Best regards, Vitalii Tymchyshyn


Нд, 2 жовт. 2016 11:27 користувач Brad Johnson <brad.john...@mediadriver.com>
пише:

> Ah, so you aren't really concerned about the incoming calls, per se, it's
> the number of outgoing calls.  And to limit that you want to limit the
> incoming calls?  Are the incoming calls sending data in that can be
> processed asynchronously or are they returning chunks of data to the
> caller?
>
> On Sat, Oct 1, 2016 at 2:45 PM, Debraj Manna <subharaj.ma...@gmail.com>
> wrote:
>
> > Thanks Brad for replying.
> >
> > In our use case we are doing lot of crunching, DB and external REST
> > service calls? There is a limit on external REST service calls we can
> > make. I can restrict the call to external services using a thread
> > pool. But I was thinking if it is possible to limit when receiving the
> > request, so that we can fail fast rather than limit while making the
> > external call. If request is crossing the limit sending error to the
> > caller is fine.
> >
> >
> >
> > On 10/1/16, Brad Johnson <brad.john...@mediadriver.com> wrote:
> > > The first question I'd have is "are you sure you have a problem with
> the
> > > number of incoming requests?"  One of the biggest problems I find in
> the
> > > field is premature optimization. If you have a fairly good
> > characterization
> > > of the problem, the number of requests anticipated, the length of time
> to
> > > process the incoming request, etc. you can set up JMeter to stress test
> > > your application.  That will let you change configuration options in
> > Camel
> > > and see if the response is more in line with what you are expecting.
> > >
> > > What exactly are you trying to accomplish by limiting concurrent
> > requests?
> > > What do you want to happen if there are too many requests? Are these
> > > request/responses that you are getting and sending data back after some
> > > length operations or are you mostly receiving data to be processed and
> > then
> > > sending an "OK" response back.  In the case of the latter you can put
> the
> > > incoming data on a SEDA queue and immediately return an "OK".  Is it
> that
> > > the incoming request is resulting in a lot of number crunching,
> database
> > > calls, or other operations that take too long and the number of
> requests
> > > are bogging things down before sending a response back to the user?
> > >
> > > Camel has a wide range of components that can provide RESTful APIs.
> They
> > > are all going to be a little different in their behavior.  For example,
> > the
> > > Netty component is going to use NIO under the covers to handle incoming
> > > data.
> > > http://camel.apache.org/rest-dsl.html
> > >
> > > If you use Jetty you can look at the min and max settings on the thread
> > > pool. Jetty also has continuations which frees up the incoming request
> > > threads and uses a callback mechanism to send the response back when it
> > is
> > > finished.
> > > http://camel.apache.org/jetty.html
> > >
> > > But really, a bit more detail and code about the use case and what it
> is
> > > you're trying to do would be helpful.  Do you want the request to send
> an
> > > error to the client if there are too many incoming requests? Why is the
> > > number of concurrent requests a concern?  Is the incoming data large
> > chunks
> > > of data that are gobbling up memory or is the processing expensive or
> > ???.
> > >
> > > On Sat, Oct 1, 2016 at 9:43 AM, Debraj Manna <subha

Re: XSLT URI with network share

2016-10-01 Thread Vitalii Tymchyshyn
You may need to change '\' to '/' proprly encode windows path as URI. This
may require to use a lot of /, e.g. file:, but I dont remember exact
number.

Best regards, Vitalii Tymchyshyn

Пт, 30 вер. 2016 17:02 користувач David Hoffer <dhoff...@gmail.com> пише:

> I have a Camel xslt uri defined as:
>
> 
> uri="xslt:file://{{gangplank.home}}/config/xslt/EphemerisIngestRequest.xsl"/>
>
> which works fine if {{gangplank.home}} is a local path.  However now
> gangplank.home points to a network share so it looks something like
> \\jmsshares\Utility\gangplank
>
> Now camel fails to resolve with:
>
> INFO|5848/0|Service Gangplank Server|16-09-30 20:55:39|Caused by:
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> to_ephemerisIngest at: >>>
>
> To[xslt:file://\\jmsshares\Utility\gangplank/config/xslt/EphemerisIngestRequest.xsl]
> <<< in route:
> Route(to_ephemerisIngest)[[From[file://\\jmsshares\Utility\g... because of
> Failed to resolve endpoint:
>
> xslt://file://%5C%5Cjmsshares%5CUtility%5Cgangplank/config/xslt/EphemerisIngestRequest.xsl
> due to: java.io.FileNotFoundException:
> \jmsshares\Utility\gangplank\config\xslt\EphemerisIngestRequest.xsl (The
> system cannot find the path specified)
>
> How can I specify an xslt URI that is on a network share?
>
> Also I see the FileNotFoundException message that it has removed one of the
> leading \ characters but not sure if that's an issue.  Also I see that it
> URL encodes the path so \ becomes %5C but here too not sure if relevant.
>
> -Dave
>


Re: Camel for ETL batch jobs

2016-09-29 Thread Vitalii Tymchyshyn
We are using Spring batch and employing Camel for complex transformations.
Spring batch has Camel integration.

Best regards, Vitalii Tymchyshyn

Чт, 29 вер. 2016 04:40 користувач contactreji <contactr...@gmail.com> пише:

> Hi Friends
>
> Has anyone attempted to write some etl batch jobs using Apache Camel? With
> multiple source data joins as stuff? Will it be sane to even attempt it
> with
> Apache Camel. I know apache camel is built for a different purpose though
> ;-)
>
> 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-for-ETL-batch-jobs-tp5788183.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Convert Flat File to XML using a XSD Schema

2016-09-22 Thread Vitalii Tymchyshyn
Try camel-beanio.

Ср, 21 вер. 2016 10:04 користувач Daniel P22  пише:

> Hi, I want to know if is possible convert a Flat File to XML using a XSD
> Schema.I'm a Biztalk Developer, and I want something similar like Flat File
> Disassembler.The Flat File Dissamsembler tool, takes a Flat File and
> transforms to XML, based on a XSD Schema. In the Schema are defined the
> positional flat of the file.I read about bindy a jaxb, but a dont find
> anything usefulThanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Convert-Flat-File-to-XML-using-a-XSD-Schema-tp5787902.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unmarshal fixed length Binary data

2016-09-04 Thread Vitalii Tymchyshyn
Unfortunatelly beanio do not support binary. It may work if your binary is
a valud UTF-8 (or othet charset) though. E.g. we are parsing copybook with
it.

Пт, 2 вер. 2016 10:55 користувач Brad Johnson 
пише:

> I second Beanio. I've used it for fixed length multi-line records and it is
> fabulous.
>
> On Fri, Sep 2, 2016 at 9:28 AM, Quinn Stevenson <
> qu...@pronoia-solutions.com
> > wrote:
>
> > Have you looked at the BeanIO DataFormat? (http://camel.apache.org/
> > beanio.html )
> >
> > > On Sep 2, 2016, at 7:35 AM, kaustubhkane 
> wrote:
> > >
> > > Hi,
> > >
> > > We have a fixed length Binary data.
> > >
> > > I am looking at the Bindy Data Format and found that it supports
> > > unmarshalling of Fixed Length records.
> > >
> > > I looked at the implementation/code of this Bindy Fixed Lenght records
> in
> > > the Camel Source code (BindyFixedLengthDataFormat.java and
> > > BindyFixedLengthFactory.java)
> > >
> > > I looked at the function createModel in BindyFixedLengthDataFormat.java
> > and
> > > found that it assumes one record equivalent to one line (i.e. each
> record
> > > will be in a separate line). Which means at the completion of record
> > there
> > > will be a newline character in the file so that next record starts
> from a
> > > new line.
> > >
> > > For this reason, it seems to me that Bindy Data Format will not be able
> > to
> > > unmarshal fixed lenght binary data. In Binary mode files there are no
> > lines
> > > and rows. You don't read in lines in case of binary data/files. That
> only
> > > works with text files.
> > >
> > > Could someone please provide details on what Data Format can be used to
> > > unmarshal Fixed lenght binary data??
> > >
> > > I am looking at an appropriate data format to which I can provide a
> model
> > > and using that model it will read the data and create a POJO for me.
> Just
> > > like what Bindy does.
> > >
> > > Regards,
> > > Kaustubh Kane
> > >
> > >
> > >
> > > --
> > > View this message in context: http://camel.465427.n5.nabble.
> > com/Unmarshal-fixed-length-Binary-data-tp5787125.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> >
>


Re: Camel SEDA timeout: Update it at runtime

2016-08-17 Thread Vitalii Tymchyshyn
You can try using dynamic to (
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html) to set timeout
option from header.

Best regards, Vitalii Tymchyshyn

Ср, 17 серп. 2016 10:45 користувач dcparga <dcpa...@gmail.com> пише:

> Hi all,
>
> I'm trying to implement a seda route to handle rest calls asynchronously.
> The point is, that I would like to handle different timeouts per call,
> which
> leads the problem to be able to change the timeout of the seda route using
> a
> parameter on the HTTP header. As far as I know, the timeout it's only set
> when the route is created, and the purpose of these APIs are for a high
> performance service, it's not a solution to stop and start the route for
> every single call, so, my ideal approach would be to be able to change the
> timeout dynamically accessing to the endpoint through the context.
>
> If I'm missing something, or there is an existing solution for this
> problem,
> please let me know and excuse me.
>
> Thank you
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-SEDA-timeout-Update-it-at-runtime-tp5786538.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Disabling concurrency in camel route

2016-08-17 Thread Vitalii Tymchyshyn
You would need a combination.

Ср, 17 серп. 2016 09:41 користувач robina  пише:

> Thanks for the reply Vitalii,
>
> Would setting synchronous=true on its own ensure that only one message is
> processed by the route at any given time? Or is it the combination of the
> maxPoolSize of 1 and synchronous=true setting?
>
> Regards,
> Rob
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Disabling-concurrency-in-camel-route-tp5786531p5786533.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Disabling concurrency in camel route

2016-08-17 Thread Vitalii Tymchyshyn
You should also do "synchronous=true". Otherwise you may experience
reordering on any asynchronous producer.
Another option is to use http://camel.apache.org/resequencer.html when you
want the sequence restored.

Best regards, Vitalii Tymchyshyn

Ср, 17 серп. 2016 о 09:28 robina <rashcr...@fomltd.com> пише:

> Hi,
>
> I've encountered a scenario in a camel route involving (I believe)
> concurrency:
>
> My route has a netty4 tcp consumer, which then uses a multicast to pass the
> message through a number of xsl transformers which then output to ActiveMQ
> endpoints.
>
> I've observed that when I receive a large XML message, followed almost
> immediately (approx. 1 millisecond) by a smaller XML message, the smaller
> message passes through the route before the large message (obviously to do
> with the cost of the transformation process).  The order of the messages is
> important, so I'd like to control this behaviour.
>
> I'm trying to ensure that only one message is processed by the route at any
> given time, so would the solution be as simple as setting maxPoolSize=1 on
> the netty4 consumer?
>
> I'm having a hard time understanding the threading/concurrency model in
> camel, so can anyone help me with a good description somewhere of the
> lifecycle of a message through a camel route?
>
> Thank you in advance,
> Rob
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Disabling-concurrency-in-camel-route-tp5786531.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Context Metrics

2016-08-16 Thread Vitalii Tymchyshyn
Just a note. If you are in same JVM and has CamelContext objects ready, you
can always access stats data
with org.apache.camel.CamelContext#getManagedCamelContext. You don't need
JMX to do this.

Best regards, Vitalii Tymchyshyn

Пн, 15 серп. 2016 о 11:30 Rajith Muditha Attapattu <rajit...@gmail.com>
пише:

> Hey All,
>
> I'm aware of the hawt.io plugin that connects to a Camel Context and
> pulls info via JMX.
>
> For performance reasons, we are looking at how an application (that
> contains one or more Camel Context) wants to push route metrics to an
> external source. We have several of those apps, which is why
> connecting to all of them via a hawtio console want scale well.
>
> Whats the best way to gather the metrics at the application level?
>
> (After which it will be sent to an external source like elastic search)
>
>
> 1. Access the info from JMX (programatically)
>
>
> 2. Implement some sort of Listener interface to get notified.
>
>
> I prefer the latter, but the former is fine as well.
>
> --
> Regards,
>
> Rajith Muditha Attapattu
>


Re: Jackson annotations ignored

2016-08-14 Thread Vitalii Tymchyshyn
Are you sure it's proper Jackson version? Jackson vs Jackson2 have
different packages, but same annotation names.

Best regards, Vitalii Tymchyshyn

Нд, 14 серп. 2016 12:30 користувач cedr.f <cedric.falle...@lampiris.be>
пише:

> Hello,
>
> I'm using camel 2.16.3 in karaf 4.0.3, and there is a strange behaviour
> when
> camel marshals my object into json with jackson.
> All my annotations (@JsonIgnore, @JsonAnyGetter, ...) are ignored when
> running through camel/karaf.
> However, if i run a simple unit test with the same dependencies and try to
> marshal my object to json with ObjectMapper, the output is ok ! I'm quite
> sure though that they use the same library (fasterxml 2.6.3) as i go
> through
> the same classes when debugging both the unit test and my program.
>
> Any idea how this could be ? My camel config is really straight-forward,
> nothing fancy here...
>
> restConfiguration()
> .bindingMode(RestBindingMode.json)
>
> This doesn't help either :
> .marshal().json(JsonLibrary.Jackson)
>
> The json is ok but it doesn't introspect my annotations.
>
> Kind Regards,
> Cédric.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Jackson-annotations-ignored-tp5786355.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Any issues having Camel Processor doing all the Works

2016-08-12 Thread Vitalii Tymchyshyn
Look at it as data flow vs IoC. It's much easier to split data flow to
parallelize of externalize some part. Especially since Camel is able to do
this in non-blocking way. I am able to process few hundred simultanious
requests in few threads without adaptation of the beans to non-blocking or
concurrent calls, just by using camel.

Best regards, Vitalii Tymchyshyn

Пт, 12 серп. 2016 05:13 користувач JamesG <ehc...@hotmail.com> пише:

> Hi,
>
> Instead of doing the routing using DSL, web service calling with CXF
> component, enriching, intercepting, etc , why not just have a Processor and
> put all the java codes there? For a Camel beginner, this seems pretty much
> easier to get the things done (definitely for those with java background),
> but I am not sure how effective or correct this approach is.
>
> Below is a sample scenario:
> 1)  Call a web service to retrieve some result.
> 2)  Based on the result, decide whether to proceed calling another service.
>
> If I would to achieve the above through Processor, it's merely few lines of
> codes.
> But if I'm using DSL to do it, the work is going to be more (cxf endpoint,
> enrich, when, simple).
>
> Appreciate any advises and comments.
>
>
> Thanks in advance.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Any-issues-having-Camel-Processor-doing-all-the-Works-tp5786330.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Read file one after other in sequence

2016-08-09 Thread Vitalii Tymchyshyn
Well, don't use seda as it's asynchronous. Use direct instead.

Best regards, Vitalii Tymchyshyn

Вт, 9 серп. 2016 о 13:02 ganga_camel <ganga...@gmail.com> пише:

> Hi,
>
> My requirement is to split the large file into smaller files and then
> process one file at a time.
>
> However, the camel file component takes the lock on all the split files and
> starts processing. This is consuming all of the CPU and Memory usage goes
> high and at one point I get OutofMemoryException.
>
> My route looks like
>
> from("file:data/ReadyForProcess?delete=true")
> .routeId("FetchFilesForProcessing")
> .to("seda:RemoveDeletes")
> .end();
>
> I wanted to know if there is a way I can configure my route to obtain lock
> on one file at a time and process one file after other.
>
> Any suggestions is highly appreciated...
>
> Thanks,
> Ganga
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Read-file-one-after-other-in-sequence-tp5786216.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: camel sql insert ouput

2016-08-09 Thread Vitalii Tymchyshyn
Recently I started using  as a poor man's function block. It creates
a subexchange, thus preserving parent exchange intact. It has next features:
* preserves parent exchange
* allows to specify "parameter" to be passed into the inner block. It's
very useful when you have a composite structure as a body and want to use
some of it's properties to perform, say, a web service call.

The biggest limitation is a way to pass result. Unfortunatelly aggregation
strategy do not have access to parent exchange. But one can use properties
that are copied from parent to subexchange to get reference to some parent
exchange objects.

It would be great to have something special for this case as using split is
a bit confusing and has certain overhead.

Best regards, Vitalii Tymchyshyn

9 серп. 2016 р. 10:32 дп "Claus Ibsen" <claus.ib...@gmail.com> пише:

You likely need to upgrade Camel as in newer versions the body is
preserved for SQL INSERT statements in camel-sql.

However attachments is not preserved, I logged a ticket about that.
https://issues.apache.org/jira/browse/CAMEL-10228

On Tue, Aug 9, 2016 at 3:41 PM, Ronny Aerts <ronny.ae...@intris.be> wrote:
> Hello Claus,
>
> I use version 2.15.6 of camel.
>
> --
> Kind regards,
> Ronny Aerts – Intris nv – Wapenstilstandlaan 47, 2600 Berchem, Belgium
> R Integration Architect
> Prince II certified – ITIL certified
> Tel: +32-3-326.50.75
>
> -Original Message-
> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
> Sent: dinsdag 9 augustus 2016 15:38
> To: users@camel.apache.org
> Subject: Re: camel sql insert ouput
>
> What Camel version and which camel component do you use for SQL?
>
> On Tue, Aug 9, 2016 at 3:13 PM, Ronny Aerts <ronny.ae...@intris.be> wrote:
>> Hallo camel community,
>>
>> I'm doing a normal sql insert into an sql server database and it seems
that after the insert, my exchange in body and all my attachments are gone.
Is this normal behavior? In a certain case I really need to keep my
attachments.
>>
>> --
>> vriendelijke groeten,
>> Ronny Aerts<mailto:ronny.ae...@intris.be> - Intris nv -
>> Wapenstilstandlaan 47, 2600 Berchem, België R Integration Architect
>> Prince II<http://nl.wikipedia.org/wiki/PRINCE2> certified -
>> ITIL<http://nl.wikipedia.org/wiki/Information_Technology_Infrastructur
>> e_Library> certified
>> Tel: +32-3-326.50.75
>>
>> Intris nv
>> Wapenstilstandlaan 47
>> B-2600 Berchem  Tel.  +32 3 326 50 75
>> Fax  +32 3 326 42 23
>> www.intris.be<http://www.intris.be/>[http://www.intris.be/mail/
AEO_Sticker_108pxRGB.jpg] <http://www.intris.be>
>>
>> DISCLAIMER
>> This is an e-mail from Intris. The information contained in this
communication is intended solely for use by the individual or entity to
whom it is addressed.
>> Use of this communication by others is prohibited. If the e-mail message
was sent to you by mistake, please notify supp...@intris.be<mailto:suppo
r...@intris.be>, destroy it without reading, using, copying or disclosing its
contents to any other person.
>> We accept no liability for damage related to data and/or documents which
are communicated by electronic mail.
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
> Intris nv
> Wapenstilstandlaan 47
> B-2600 Berchem  Tel.  +32 3 326 50 75
> Fax  +32 3 326 42 23
> www.intris.be<http://www.intris.be/>[http://www.intris.be/mail/
AEO_Sticker_108pxRGB.jpg] <http://www.intris.be>
>
> DISCLAIMER
> This is an e-mail from Intris. The information contained in this
communication is intended solely for use by the individual or entity to
whom it is addressed.
> Use of this communication by others is prohibited. If the e-mail message
was sent to you by mistake, please notify supp...@intris.be<mailto:suppo
r...@intris.be>, destroy it without reading, using, copying or disclosing its
contents to any other person.
> We accept no liability for damage related to data and/or documents which
are communicated by electronic mail.



--
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Dynamic bean name injection

2016-08-08 Thread Vitalii Tymchyshyn
Well, the valid options are listed here:
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

Нд, 7 серп. 2016 о 14:21 souciance  пише:

> Hi Matt,
>
> I was unsure if you could inject the id from a header like the example you
> show. I'll give it a try and if it works then that would a be great
> solution
> and would reduce quit a lot of code. Thanks for the help.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Dynamic-bean-name-injection-tp5786108p5786128.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Default Exception handler and Dead Letter Channel mix

2016-08-08 Thread Vitalii Tymchyshyn
Why can't you use a global onException?
In the docs I see the limitation only for Java DSL. For XML DSL there is no
-specific settings, so I assume  one should be picked
up.

Best regards, Vitalii Tymchyshyn

Пн, 8 серп. 2016 о 12:08 javi.noguera <javi.nogu...@gmail.com> пише:

> Hi,
>
> I'm using Camel 2.17 and what I'm looking is when there is an uncaught
> exception in any route after a redelivery go to a route to do some
> processing (inserts into a db, call a service, etc) and finally not handle
> the exception so the caller fails.
>
> I though about using a Dead Letter channel and send it to a route but after
> the route ends it marks the exception as handled so if the exception was
> thrown for example in a Splitter with stopOnException=true it keeps going.
>
> Then I tried to use the Default Exception Handler but it does not allow me
> to send a message before failing.
>
> I can not use a generic onException with handled in false since I'm loading
> the routes dynamically from XML and apparently there is no way to add it:
> http://camel.apache.org/loading-routes-from-xml-files.html
>
> I was thinking about extending the DefaultExceptionHandler so it can have a
> mixed functionality(go to a dead letter queue and not handle the exception)
> but I'm not sure how can do that since the handled policy seems to have
> been
> moved away the from the RedeliveryErrorHandler itself to the
> OnExceptionDefinition.
>
>
> Any ideas on how to do that or if there is another better way? Am I missing
> anything?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Default-Exception-handler-and-Dead-Letter-Channel-mix-tp5786163.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Netty4-http

2016-08-03 Thread Vitalii Tymchyshyn
They are populated. I read Content-Type and Access successfully.

3 серп. 2016 р. 16:20 "Vinny"  пише:

> Hello All,
> Am I correct i assuming that the normal Camel HTTP headers are not
> populated when we use the netty4-http component? To access things like the
> query string we need to do it using Netty tools like QueryStringDecoder on
> the FullHttpRequest object.  Just wanted to make sure I didn't configure
> something incorrectly.
> Thanks,
> Vincent
>


Re: Camel Spring Bean error Handling

2016-07-26 Thread Vitalii Tymchyshyn
Then it's up to you to check the connectivity in some @PostConstruct method.

Вт, 26 лип. 2016 00:14 користувач fxthomas  пише:

> hi,
>
> I am not using any specific camel componenet to access DB. just plain old
> JDBC after getting the datasource which is injected in the bean.
>
> My main issue to track the DB connection issues which is happening in my
> custom code when the issue goes more than a limit suspend all the routes
> running in the camelcontext.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Spring-Bean-error-Handling-tp5785414p5785450.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Dynamic routing after Resequencing messages

2016-07-25 Thread Vitalii Tymchyshyn
Do you want to do this once? In this case the easiest is just to put a
@RoutingSlip bean that will switch its state after first message.

Пн, 25 лип. 2016 03:29 користувач sheikhisham 
пише:

> I want to reorder a sequence of messages and dynamically route the messages
> according to their order after resequencing. Say, first message after
> resequencing should be routed to A, and others to route B.
>
> I was able to reorder messages using resequencer, but how do I dynamically
> route the first message alone to a particular route after resequencing? Any
> help would be much appreciated.
>
> from(CAMEL_DIRECT_REORGANISE_MSGS)
> .resequence(header("priority")).batch().timeout(resequencerTimeout
> *
> 1000).size(3).reverse()
> .to("direct:A");
>
> In above route, all messages out of resequencer flows to RouteA, but I want
> first message alone to flow to RouteA and the rest to RouteB.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Dynamic-routing-after-Resequencing-messages-tp5785415.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Spring Bean error Handling

2016-07-25 Thread Vitalii Tymchyshyn
I doubt DataSource checks the connection on startup. Which camel component
are you using to access database?

Best regards, Vitalii Tymchyshyn

Пн, 25 лип. 2016 03:08 користувач fxthomas <felix.tho...@gmail.com> пише:

> Hello,
>
>My question is not Camel specific but more Spring bean handling issue.
> My issue is that even if there is an error in bean initialization the camel
> route starts . I want the camel context only started if there was no errors
> in Bean initialization . Some of beans are custom but some are third party
> for example DC connection & JMS connection. Exampe below Datasource .
> Incase
> there is a connection failure on startup is see exception thrown in logs
> but
> the camel context is started . I want to avoid this.
>
>  class="org.apache.commons.dbcp.BasicDataSource">
>  value="oracle.jdbc.driver.OracleDriver"
> />
>  value="jdbc:oracle:thin:@localhost:1521:xe"
> />
> 
> 
> 
>
>
> I saw in spring there are ApllicationEevents handling but i dont see
> specific to bean handling . Is there a good way to handle this.
>
>
>
>
> Thx,
> Fx
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Spring-Bean-error-Handling-tp5785414.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: FTP Consumer Issue - File operation failed: 227

2016-07-24 Thread Vitalii Tymchyshyn
Well, it looks like your FTP server is overloaded.

Best regards, Vitalii Tymchyshyn

Нд, 24 лип. 2016 07:16 користувач Michele <michele.mazzi...@finconsgroup.com>
пише:

> Hi everyone,
>
> I have these routes (Read several file from FTP folder and process each of
> them)
>
> 
> uri="ftp://username@host
> ?password=x=changed=true&=true"
> />
>
> 
>
> 
>
>
>
> 
>
> After several successful processing, I see in log this exception:
> org.apache.camel.component.file.GenericFileOperationFailedException: File
> operation failed: 227 Entering Passive Mode Too many open files (Attacched
> log file log.txt <http://camel.465427.n5.nabble.com/file/n5785356/log.txt>
> )
>
> Any idea?
>
> Thanks in advance
>
> Best Regards
>
> Michele
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/FTP-Consumer-Issue-File-operation-failed-227-tp5785356.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Suggestions on how to cluster Camel?

2016-07-22 Thread Vitalii Tymchyshyn
We are using Apache Zookeeper for cluster coordination. While camel has
zookeeper module, we made our own class to overcome bundled module
limitations.

Best regards, Vitalii Tymchyshyn

Пт, 22 лип. 2016 14:39 користувач David Hoffer <dhoff...@gmail.com> пише:

> We have a standalone Camel app (runs as daemon with no container) that we
> need to cluster and I'm looking for options on how to do this.
>
> Our Camel app handles file routing.  All inputs are files so exchanges deal
> with byte arrays and the file name.  Destinations are either file folders
> or web-services where we attach the file and call the service to publish.
> Also currently we use JMX to remote manage and monitor.
>
> So how best to cluster this?  Technically what is most important in the
> cluster feature set is fail-over so we can guarantee high availability but
> it would be nice to get load balancing too.
>
> Our app gets its input via local disk folders (which we can convert to
> network shares (e.g. vnx)) or via external SFTP endpoints.  The app has
> about 100 of these folders/sftp endpoints.  So when clustered all the
> routes would be using the network shares instead of local folders.
>
> I'm assuming that file and sftp endpoints should handle this well as they
> already use a file lock to prevent contention. However we would have to
> have a solution for stale file locks for clustered nodes that failed.  How
> would the other nodes know they can delete the locks for failed nodes (but
> only for failed nodes)?
>
> Also since we would now be processing routes concurrently we would have to
> determine if the receiving webservice endpoints can handle concurrent
> connections.  Ideally I'd like to be able to control/tune the concurrent
> nature of each route (across the cluster) so that if needed we could
> limit/stop concurrent processing of a route but still always have fail-over
> cluster node support.
>
> Then there is the JMX issue, right now we have apps to manage and monitor
> route traffic but somehow this would have to be aggregated across all nodes
> in the cluster.
>
> Are there any techniques or frameworks that could help us implement this?
> Any suggestions on approaches that work and what doesn't work?
>
> Thanks,
> -Dave
>