AmbiguousMethodCallException but both methods are the same!

2015-04-30 Thread apara
I have a route that looks like this:

camel:route
camel:from uri=direct://handle.event /

camel:to
uri=log:com.mediaplatform.CAMEL-IN-beforeEventLogger?level=DEBUGamp;showAll=trueamp;multiline=true
/

camel:to uri=direct://eventDataLogger/

camel:to
uri=log:com.mediaplatform.CAMEL-IN-beforeDuplicateEventChecker?level=DEBUGamp;showAll=trueamp;multiline=true
/

camel:to uri=direct://duplicateEventChecker /

camel:to
uri=log:com.mediaplatform.CAMEL-IN-beforeDateTransform?level=DEBUGamp;showAll=trueamp;multiline=true
/


camel:to uri=direct://dateTransformation/
camel:to uri=direct://userAgentParser /
camel:to uri=direct://pageToIdEventAssociation/
camel:to uri=direct://bufferedEventInsertAugmentation/
camel:to uri=direct://playerStartUpEventAugmentation/
camel:to uri=direct://loadStartToPreviousLoadstartAssociation
/
camel:to uri=direct://insertPlaySuccessAfterTimeupdate /
camel:to
uri=direct://bufferedEventToPreviousLoadStartAssociation /
camel:to uri=direct://mongoDBPersistence/
/camel:route

All the endpoints are proxies to spring bean.  All proxies implement the
same interface:

public interface Handler {
FutureEventData asyncHandle(EventData data) throws HandlerException;
EventData syncHandle(EventData data) throws HandlerException;
}


When the route is invoked with syncHandle method, everything works fine. 
However, when I invoke the route with asyncHandle() I see that at first, the
bodyType in the exchange if of type:

org.apache.camel.component.bean.BeanInvocation

2015-04-30 01:05:31,396 kinesis-consumer DEBUG [Camel
(handler-b7cd7848-9cc8-11e4-89d3-123b93f75cba) thread #8 -
CamelInvocationHandler] com.mediaplatform.CAMEL-IN-beforeEventLogger
[CamelLogger.java:170] Exchange[
, Id: ID-apara-i-standardset-com-65381-143038386-0-12
, ExchangePattern: InOut
, Properties: {CamelCreatedTimestamp=Thu Apr 30 01:05:31 PDT 2015,
CamelMessageHistory=[DefaultMessageHistory[routeId=route2, node=to2]],
CamelToEndpoint=log://com.mediaplatform.CAMEL-IN-beforeEventLogger?level=DEBUGmultiline=trueshowAll=true}
, Headers:
{breadcrumbId=ID-apara-i-standardset-com-65381-143038386-0-10}
, BodyType: org.apache.camel.component.bean.BeanInvocation
, Body: BeanInvocation public abstract java.util.concurrent.Future
com.mediaplatform.cdc.consumer.process.handler.Handler.asyncHandle(com.mediaplatform.cdc.event.EventData)
throws
com.mediaplatform.cdc.consumer.process.handler.exception.HandlerException
with [EventDataImpl{id='null', partitionKey='constant',
vd=VariableDataImpl{} {T=pl, ts=2015-04-29T15:56:07.463Z, ua=Mozilla/5.0
(Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/41.0.2272.104 Safari/537.36,
eid=82da185c-7a55-49a3-9eb6-948fac23d0ee, av=5.0 (Macintosh; Intel Mac OS X
10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104
Safari/537.36}}]]
, Out: null: 
]

So, the first end-point is invoked correctly.  However, after the first
endpoint, the body type becomes:

java.util.concurrent.FutureTask

2015-04-30 01:05:31,408 kinesis-consumer DEBUG [Camel
(handler-b7cd7848-9cc8-11e4-89d3-123b93f75cba) thread #8 -
CamelInvocationHandler]
com.mediaplatform.CAMEL-IN-beforeDuplicateEventChecker
[CamelLogger.java:170] Exchange[
, Id: ID-apara-i-standardset-com-65381-143038386-0-12
, ExchangePattern: InOut
, Properties: {CamelCreatedTimestamp=Thu Apr 30 01:05:31 PDT 2015,
CamelMessageHistory=[DefaultMessageHistory[routeId=route2, node=to2],
DefaultMessageHistory[routeId=route2, node=to3],
DefaultMessageHistory[routeId=route2, node=to4]],
CamelToEndpoint=log://com.mediaplatform.CAMEL-IN-beforeDuplicateEventChecker?level=DEBUGmultiline=trueshowAll=true}
, Headers:
{breadcrumbId=ID-apara-i-standardset-com-65381-143038386-0-10}
, BodyType: java.util.concurrent.FutureTask
, Body: java.util.concurrent.FutureTask@27a9fba8
, Out: null: 
]

The next route is fuzzy matched via chooseBestPossibleMethodInfo, because
we lost the bean invocation (which was exact).  During the fuzzy match, I
get the following exception because somehow camel finds two functions which
are the SAME to qualify:

org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
method invocations possible: [public final
com.mediaplatform.cdc.event.EventData
com.sun.proxy.$Proxy93.syncHandle(com.mediaplatform.cdc.event.EventData)
throws
com.mediaplatform.cdc.consumer.process.handler.exception.HandlerException,
public final com.mediaplatform.cdc.event.EventData
com.sun.proxy.$Proxy93.syncHandle(com.mediaplatform.cdc.event.EventData)
throws
com.mediaplatform.cdc.consumer.process.handler.exception.HandlerException].
Exchange[Message: EventDataImpl{id='null', partitionKey='constant',
vd=VariableDataImpl{} {T=qos, ts=2015-04-29T15:56:07.463Z,
plid=3730a0cd-3a19-41b0-be4a-dd5463e11254,

Re: org.apache.camel.ExchangeTimedOutException: The OUT message was not received within: 30000 millis

2015-04-30 Thread yogu13
Hi,

Taking a shot to explain what is happening here...
From what i understand using vm option with an to endpoint would only add
the messages to the SEDA queue (maintained internally), I am not sure if you
have any other route which picks up these messages to process and hence it
ends up throwing a timeout exception. 

I kinda envision this as multiple messages bubbling through the route
instead of a single message shooting through it one at a time. - what
makes you think only one message is processed ?

Regards,
-Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/org-apache-camel-ExchangeTimedOutException-The-OUT-message-was-not-received-within-3-millis-tp5766508p5766541.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: HTTP operation failed invoking statusCode: 500

2015-04-30 Thread ercan.canlier
Hi,
Could you please propose me a working example for message format= PAYLOAD?
I implement the app in the same way but real web service does not work.
Thanks
Best regards.
Ercan



--
View this message in context: 
http://camel.465427.n5.nabble.com/HTTP-operation-failed-invoking-statusCode-500-tp5766085p5766544.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Error in the URI of the InOptionalOut echange pattern?

2015-04-30 Thread Victor NOËL

Hi,

According to the WSDL recommendation 
(http://www.w3.org/TR/wsdl20-additional-meps/#in-opt-out), the 
InOptionalOut pattern has the URI

http://www.w3.org/ns/wsdl/in-opt-out
and not
http://www.w3.org/ns/wsdl/in-optional-out

It's not extremely important, but I was wondering if it was on purpose 
or if it was an error…


Victor


FTP Camel Component not picking up files if scheduler is set to about 30 seconds

2015-04-30 Thread gargankur007
Hi 
We have multiple routes in our application and every FTP endpoint is
configured to poll in 30 seconds.
However the routes are not able to pick up new files posted over there.

Has anybody faced any problem like this before?




--
View this message in context: 
http://camel.465427.n5.nabble.com/FTP-Camel-Component-not-picking-up-files-if-scheduler-is-set-to-about-30-seconds-tp5766548.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AmbiguousMethodCallException but both methods are the same!

2015-04-30 Thread apara
So, I think I figured out what happens.  Only the initial invocation on the
proxy is a Method Invocation.  So, that un-ambiguously up-calls the
implemented method.  However, after the initial invocation, the result is
put into the Exchange, and the exchange continues to carry NOT the
MethodInvocation, but just the result of previous invocation.

From here on, method matching starts to see who can handle the result. 
Since, there are two functions syncHandle and asyncHandle they both can
handle the conversion from a FutureT, to a T, which I assume is handled by
invoking future.get().  

The error message contains exactly the SAME method twice.  However, it
should have contained different matching signatures.  That would have helped
much in troubleshooting this issue.

I helped Camel up-call the proper function by implementing a:

FutureEventData asyncHandle(FutureEventData data) throws
HandlerException;


Where I simply turn around and execute:

@Override
public FutureEventData asyncHandle(final FutureEventData data)
throws HandlerException {
return
asyncHandle(
get(
data
)
);
}


So, now, one of the method exactly matches the content of the Exchange's
body and invocation occurs without an error.

Just takes a good night of sleep.

-AP_




--
View this message in context: 
http://camel.465427.n5.nabble.com/AmbiguousMethodCallException-but-both-methods-are-the-same-tp5766545p5766552.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel connects to queue instead of topic when using AMQP 1.0

2015-04-30 Thread Mark Kusec
Hi all, I have run into an interesting issue, and I'm not sure whether it is 
due to user error or a bug.  I'm using Spring XML DSL to setup a subscription 
to a topic.  But instead of getting a subscription to a topic, I'm actually 
getting a consumer on a queue of the same name.  

This only happens if I use AMQP 1.0 (camel-amqp).  If I change to OpenWire, I 
get a subscription to a topic as I expect.  The following illustrates how I 
tested this:

In servlet.xml, I have created two connections to the same instance of 
ActiveMQ, one of which uses AMQP and one not:

bean id=amqpConnection 
class=org.apache.camel.component.jms.JmsComponent 
property name=connectionFactory
  bean class=org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl 
factory-method=createFromURL
constructor-arg index=0 type=java.lang.String 
value=amqp://localhost:5672 /
   /bean
/property
/bean

bean id=tcpConnection 
class=org.apache.camel.component.jms.JmsComponent 
property name=connectionFactory
  bean class=org.apache.activemq.ActiveMQConnectionFactory
property name=brokerURL 
value=tcp://localhost:61616 / 
  /bean
/property
/bean

My routes look like this.  I think they should both connect to the same topic.  
But in the ActiveMQ hawtio, I can see that  AMQP-ROUTE is a consumer of a 
Queue named TEST, while TCP-ROUTE is a subscriber to a Topic named TEST.

  route id=AMQP-ROUTE
from 
uri=amqpConnection:topic://TEST?clientId=TestWithAMQPamp;durableSubscriptionName=TestDurSysAMQP
 /
to uri=file:///foo/
 /route
 
 route id=TCP-ROUTE
   from 
uri=tcpConnection:topic://TEST?clientId=TestWithTCPamp;durableSubscriptionName=TestDurSysTCP
 /
   to uri=file:///bar/
 /route

Did I do something wrong in specifying the Connection Factory or anything else? 
 Is there a deficiency in Qpid or camel-amqp?  Help! 

P.S. Is there any other/better way to specify an AMQP 1.0 JMS connection 
factory in Spring?  I searched all over the web, but did not find any other 
examples.

Thanks,
Mark


Re: Manipulating JSON from inputStream

2015-04-30 Thread erd
Hi,
Sorry for going AWOL for a while... anyways, I'm in the process of doing
essentially what Mark suggested. I ended up splitting the large file, using
Jackson and JAXB to unmarshal the entries into a TreeMap, translating the
TreeMap into my own defined POJO, and marshaling back into JSON. Another
curveball I am running into is a second level of nesting in some of the
data. I'm fixing that by making a class to define the types of each element
within the properties.



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


Recommendation for Static Code Analysis (SCA) tool to use with Camel

2015-04-30 Thread Nuge
Seeking suggestions on Static Code Analysis (SCA) tool to use with Camel. 
Not only for Java code, but also for XML based DSL.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Recommendation-for-Static-Code-Analysis-SCA-tool-to-use-with-Camel-tp5766554.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to create case insensitive URI route with netty4-http?

2015-04-30 Thread hzariv
You are right. I turn on debug logging and I see what is happening. I have
the following producer and consumer endpoints. Camel matches on the Consumer
endpoint correctly (case insensitive) but the producer URL is created like:
http://myapp.com:80/ws/svc/Shopping/shopping?callname=... (path is now
/Shopping/shopping which is invalid) when I use /shopping on the request the
producer URL is correct.
How do I fix this?

Consumer:
camelContext.getEndpoint(netty4-http:http://0.0.0.0:8080/Shopping;);
Producer:
camelContext.getEndpoint(String.format(netty4-http:http://%s:80/ws/svc/Shopping?throwExceptionOnFailure=false;,
myapp.com));

Hers is the DEBUG log:

11087 [Camel (camel-1) thread #0 - NettyEventExecutorGroup] INFO  -
ID-D-SJC-00531208-50165-1430420447613-0-2  (route2)
from(http://0.0.0.0:8080/Shopping) -- choice  Pattern:InOut,
Headers:{Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,
Accept-Encoding=gzip, deflate, Accept-Language=en-US,en;q=0.5, appid=,
breadcrumbId=ID-D-SJC-00531208-50165-1430420447613-0-1,
Cache-Control=max-age=0, callname=FindProducts, CamelHttpMethod=GET,
CamelHttpPath=/shopping,
CamelHttpQuery=callname=FindProductsresponseencoding=XMLappid=version=829QueryKeywords=MC723LLMaxEntries=2ProductSort=TitleIncludeSelector=DomainHistogramSortOrder=Ascending,
CamelHttpRawQuery=callname=FindProductsresponseencoding=XMLappid=version=829QueryKeywords=MC723LLMaxEntries=2ProductSort=TitleIncludeSelector=DomainHistogramSortOrder=Ascending,
CamelHttpUri=/shopping, CamelHttpUrl=http://0.0.0.0:8080/shopping,
CamelNettyChannelHandlerContext=io.netty.channel.DefaultChannelHandlerContext@3042dc22,
CamelNettyLocalAddress=/127.0.0.1:8080,
CamelNettyRemoteAddress=/127.0.0.1:50489, Connection=keep-alive,
Content-Length=0, Host=localhost:8080, If-Modified-Since=Thu, 30 Apr 2015
18:59:27 GMT, IncludeSelector=DomainHistogram, MaxEntries=2,
ProductSort=Title, QueryKeywords=MC723LL, responseencoding=XML,
SortOrder=Ascending, User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0)
Gecko/20100101 Firefox/37.0, version=829},
BodyType:org.apache.camel.component.netty4.http.NettyChannelBufferStreamCache,
Body:[Body is instance of org.apache.camel.StreamCache]
11128 [Camel (camel-1) thread #0 - NettyEventExecutorGroup] INFO  -
ID-D-SJC-00531208-50165-1430420447613-0-2  (route2) choice --
http://myapp.com:80/ws/svc/Shopping  Pattern:InOut,
Headers:{Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,
Accept-Encoding=gzip, deflate, Accept-Language=en-US,en;q=0.5, appid=,
breadcrumbId=ID-D-SJC-00531208-50165-1430420447613-0-1,
Cache-Control=max-age=0, callname=FindProducts, CamelHttpMethod=GET,
CamelHttpPath=/shopping,
CamelHttpQuery=callname=FindProductsresponseencoding=XMLappid=version=829QueryKeywords=MC723LLMaxEntries=2ProductSort=TitleIncludeSelector=DomainHistogramSortOrder=Ascending,
CamelHttpRawQuery=callname=FindProductsresponseencoding=XMLappid=version=829QueryKeywords=MC723LLMaxEntries=2ProductSort=TitleIncludeSelector=DomainHistogramSortOrder=Ascending,
CamelHttpUri=/shopping, CamelHttpUrl=http://0.0.0.0:8080/shopping,
CamelNettyChannelHandlerContext=io.netty.channel.DefaultChannelHandlerContext@3042dc22,
CamelNettyLocalAddress=/127.0.0.1:8080,
CamelNettyRemoteAddress=/127.0.0.1:50489, Connection=keep-alive,
Content-Length=0, Host=localhost:8080, If-Modified-Since=Thu, 30 Apr 2015
18:59:27 GMT, IncludeSelector=DomainHistogram, MaxEntries=2,
ProductSort=Title, QueryKeywords=MC723LL, responseencoding=XML,
SortOrder=Ascending, User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0)
Gecko/20100101 Firefox/37.0, version=829},
BodyType:org.apache.camel.component.netty4.http.NettyChannelBufferStreamCache,
Body:[Body is instance of org.apache.camel.StreamCache]
11129 [Camel (camel-1) thread #0 - NettyEventExecutorGroup] DEBUG - 
Endpoint[http://myapp.com:80/ws/svc/Shopping] Exchange[Message: [Body is
instance of org.apache.camel.StreamCache]]
11138 [Camel (camel-1) thread #0 - NettyEventExecutorGroup] DEBUG - Created
new TCP client bootstrap connecting to myapp.com:80 with options:
Bootstrap(group: NioEventLoopGroup, channelFactory: NioSocketChannel.class,
options: {SO_KEEPALIVE=true, TCP_NODELAY=true, SO_REUSEADDR=true,
CONNECT_TIMEOUT_MILLIS=1}, handler:
org.apache.camel.component.netty4.http.HttpClientInitializerFactory@765b53f)
11167 [Camel (camel-1) thread #0 - NettyEventExecutorGroup] DEBUG - Creating
connector to address: myapp.com:80
11169 [Camel (camel-1) thread #0 - NettyEventExecutorGroup] DEBUG - Channel:
[id: 0xae58aab0, /10.244.161.38:50490 = myapp.com/10.14.90.11:80] writing
body: DefaultFullHttpRequest(decodeResult: success, version: HTTP/1.1,
content: UnpooledUnsafeDirectByteBuf(ridx: 0, widx: 0, cap: 0))
GET http://myapp.com:80/ws/svc/Shopping/shopping?callname=FindProducts.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-create-case-insensitive-URI-route-with-netty4-http-tp5766517p5766558.html

Re: FTP Camel Component not picking up files if scheduler is set to about 30 seconds

2015-04-30 Thread Claus Ibsen
Hi

Its hard to tell but when using ftp then it can be active vs passive
mode. Invalid credentials. The login has been locked. The port number
is not reachable etc. Firewall blocking etc. And then unix vs windows
path separators etc.

Can you see anything on the FTP server from its logs. And can you
manually connect to the server using a ftp client.


On Thu, Apr 30, 2015 at 3:14 PM, gargankur007 gargankur...@gmail.com wrote:
 Hi
 We have multiple routes in our application and every FTP endpoint is
 configured to poll in 30 seconds.
 However the routes are not able to pick up new files posted over there.

 Has anybody faced any problem like this before?




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/FTP-Camel-Component-not-picking-up-files-if-scheduler-is-set-to-about-30-seconds-tp5766548.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: Comparison of Apache Camel and IBM Integration Bus v9.0

2015-04-30 Thread jamie3
Here is the second post in the series.

http://beertechcode.blogspot.ca/2015/05/the-3-foot-view-of-apache-camel-and.html




--
View this message in context: 
http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171p5766563.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Camel connects to queue instead of topic when using AMQP 1.0

2015-04-30 Thread Mark Kusec
Following up my own question with an answer:  

I found a solution by following the clues at 
https://issues.apache.org/jira/browse/QPID-4991.  I gather that ActiveMQ 
doesn't internally map AMQP topics to JMS topics unless the destinationName 
begins with the prefix topic://.  If this prefix is absent then ActiveMQ maps 
your AMQP topic to a JMS queue of the same name.  Since the Qpid JMS connection 
factory doesn't add this prefix by default, Camel ends up connecting to queues 
when it thinks it is connecting to topics.  The solution is to explicitly tell 
the Qpid connection factory to add the prefix that ActiveMQ wants to every 
topic name.  The following worked for me:

bean id=amqpConnection 
class=org.apache.camel.component.jms.JmsComponent 
property name=connectionFactory
  bean class=org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl 
factory-method=createFromURL
constructor-arg index=0 type=java.lang.String 
value=amqp://localhost:5672 /
property name=topicPrefix value=topic:// /  !-- only 
necessary when connecting to ActiveMQ over AMQP 1.0 --
   /bean
/property
/bean

I hope this is of assistance to others.


-Original Message-
From: Mark Kusec 
Sent: Thursday, April 30, 2015 10:31 AM
To: users@camel.apache.org
Subject: Camel connects to queue instead of topic when using AMQP 1.0

Hi all, I have run into an interesting issue, and I'm not sure whether it is 
due to user error or a bug.  I'm using Spring XML DSL to setup a subscription 
to a topic.  But instead of getting a subscription to a topic, I'm actually 
getting a consumer on a queue of the same name.  

This only happens if I use AMQP 1.0 (camel-amqp).  If I change to OpenWire, I 
get a subscription to a topic as I expect.  The following illustrates how I 
tested this:

In servlet.xml, I have created two connections to the same instance of 
ActiveMQ, one of which uses AMQP and one not:

bean id=amqpConnection 
class=org.apache.camel.component.jms.JmsComponent 
property name=connectionFactory
  bean class=org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl 
factory-method=createFromURL
constructor-arg index=0 type=java.lang.String 
value=amqp://localhost:5672 /
   /bean
/property
/bean

bean id=tcpConnection 
class=org.apache.camel.component.jms.JmsComponent 
property name=connectionFactory
  bean class=org.apache.activemq.ActiveMQConnectionFactory
property name=brokerURL 
value=tcp://localhost:61616 / 
  /bean
/property
/bean

My routes look like this.  I think they should both connect to the same topic.  
But in the ActiveMQ hawtio, I can see that  AMQP-ROUTE is a consumer of a 
Queue named TEST, while TCP-ROUTE is a subscriber to a Topic named TEST.

  route id=AMQP-ROUTE
from 
uri=amqpConnection:topic://TEST?clientId=TestWithAMQPamp;durableSubscriptionName=TestDurSysAMQP
 /
to uri=file:///foo/
 /route
 
 route id=TCP-ROUTE
   from 
uri=tcpConnection:topic://TEST?clientId=TestWithTCPamp;durableSubscriptionName=TestDurSysTCP
 /
   to uri=file:///bar/
 /route

Did I do something wrong in specifying the Connection Factory or anything else? 
 Is there a deficiency in Qpid or camel-amqp?  Help! 

P.S. Is there any other/better way to specify an AMQP 1.0 JMS connection 
factory in Spring?  I searched all over the web, but did not find any other 
examples.

Thanks,
Mark


Re: CSV and SQL Component for Batch Processing

2015-04-30 Thread Christian Müller
Add a processor in between and remove the entries you don't need.

Best,
Christian

Christian
-

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642

On Wed, Apr 29, 2015 at 11:36 AM, imranrazakhan imranrazak...@gmail.com
wrote:

 Hi,

 I am doing batch insertion into db from CSV file like

 from(file:mycsv)
 .unmarshal().csv()
.to(sql:insert into mytable (value1, value2) Values (#,
 #)?batch=true)
.end();

 It works fine if CSV columns and Table columns are same, but my CSV has 10
 column and Table has 7.

 Is there any way to skip last 3 columns from CSV before insertion?

 I can use bindy component but i am looking for option in CSV

 Regards,



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/CSV-and-SQL-Component-for-Batch-Processing-tp5766475.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Unable to setup route with limit of 30 queue size and 5 processing threads

2015-04-30 Thread apara
I think I am getting closer.  I replaced my exports back to direct:// and
re-implemented asyncHandle method by using my own pool:

...
private final ExecutorService
executor =
Executors.newFixedThreadPool(20);

...

@Override
public FutureEventData asyncHandle(final EventData data) throws
HandlerException {
return
executor
.submit(
new CallableEventData() {
@Override
public EventData call() throws Exception {
return
handle(data);
}
}
);
}

Is this correct?  I was hoping to somehow being able to manage the pool from
Camel...

-AP_



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-setup-route-with-limit-of-30-queue-size-and-5-processing-threads-tp5766520p5766538.html
Sent from the Camel - Users mailing list archive at Nabble.com.