Re: calling a spring bean inside an OSGI based project

2016-01-06 Thread Meissa Sakho
Henryk,
I did not want to use Spring.
I just needed to call the Spring JdbcTemplate in my OSGI pure blueprint
beans.
The Spring JdbcTemplate provides database abstraction that we don't have
with others camel component (sql,jpa,jdbc).
Using Spring DM solves my problem, but that's not want I prefer.
So if you know a way to call a Spring Bean (JdbcTemplate) inside an pure
OSGI bean, i'll pay you a beer :-)
Thanks,
Meissa

2016-01-05 16:28 GMT+01:00 Henryk Konsek :

> To use Spring, you have to stick to Spring DM configuration. Which is not
> maintained anymore. So using Spring in OSGi creates more problem than it
> solves.
>
> If you want to use Spring I recommend dropping OSGi on the behalf of the
> Spring Boot running as fat jar or WAR.
>
> Cheers!
>
> wt., 5.01.2016 o 11:54 użytkownik Meissa Sakho 
> napisał:
>
> > Hi Greg,
> > I've already reviewed this links above.
> > You can't define a spring bean inside yous OSGI configuration. It won't
> > work.
> > Let me first explain to you why I need to do it.
> > I need to use the Spring JdbcTemplate component because to leverage the
> > stored procedure abstraction.
> > I do that because either the JPA component,sql or jdbc component do not
> > provide this feature.
> > I've found another workaround so far.
> > But if you know a working solution for that (calling a spring bean from a
> > blueprint), let me know.
> > Thans,
> > Meissa
> >
> > 2016-01-04 17:35 GMT+01:00 Greg Autric :
> >
> > > hi Meissa,
> > >
> > >
> > > Blueprint configuration uses "almost" the same syntax and behavior than
> > > Spring XML.
> > > IMHO, I dislike use a mix of spring conf and blueprint conf.
> > > Your spring configuration should work w/ few modifications into your
> > > blueprint [1].
> > >
> > > [1]
> > >
> >
> http://fuseesb.blogspot.fr/2014/10/what-is-differences-between-camel.html
> > >
> > > an other useful link :
> > > http://camel.apache.org/using-osgi-blueprint-with-camel.html
> > >
> > > Greg AUTRIC
> > > JBoss Middleware Consultant
> > >
> > > email   : gautric __at__ redhat __dot__ com
> > > twitter : @gautric_io
> > >
> > > Red Hat Global Services
> > > Red Hat France SARLsit: http://www.redhat.fr
> > > Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
> > > Sent from webmail
> > >
> > > - Mail original -
> > > De: "Meissa Sakho" 
> > > À: users@camel.apache.org
> > > Envoyé: Mardi 22 Décembre 2015 12:37:29
> > > Objet: calling a spring bean inside an OSGI based project
> > >
> > > Hi all,
> > > I have created a restfull web service based on apache cxf with camel.
> > > My endpoint is defined inside my blueprint configuration file like
> below:
> > >
> > > 
> > >
> > > 
> > >
> > > 
> > >
> > > 
> > >
> > > 
> > >
> > > > > "com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
> > >
> > > 
> > >
> > > 
> > >
> > > 
> > >
> > > 
> > >
> > >   
> > >
> > > 
> > >
> > > 
> > >
> > >  
> > >
> > >
> > > I would like to Inject the Spring JdbcTemplate that I've defined in my
> > > Spring configuration file to my BookingService business class.
> > >
> > > My question is :
> > >
> > > How can I a load and inject a Spring bean inside a OSGI based Bean?
> > >
> > > Thank you in advance,
> > >
> > > Meissa
> > >
> >
> --
> Henryk Konsek
> http://about.me/hekonsek
>


Re: Camel raising Exception for continuous MQTT Publishing

2016-01-06 Thread koonsang
I encountered the same problem with the latest Camel 2.16.1.

This happened when the network connection is lost when I unplugged the LAN
cable.  After a few minutes I plugged in the LAN cable again and the program
tried to publish some messages to MQTT broker when the Exception is
encountered.  The program enters into infinite loop with the same exception.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-raising-Exception-for-continuous-MQTT-Publishing-tp5747286p5775862.html
Sent from the Camel - Users mailing list archive at Nabble.com.


File Component - Implementing onCompletionExceptionHandler for older versions

2016-01-06 Thread calyan.bandi
Hi,

Below is the warning that is received due to an exception at any time during
processing of a file. This basically does a rollback of the entire file and
it starts to read again. 

WARN thread #0 - [GenericFileOnCompletion] Rollback file strategy:
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@41a7d9e7
for file: G

I am trying to override the class GenericFileOnCompletion and handle the
methods onComplete() and onFailure() and few other methods provided in it. I
am not sure how i can attach my class to the file end point in the route as
i see no option provided for camel version 2.13.2.

I can see in the documentation that a new file consumer option
"onCompletionExceptionHandler" is provided to handle any thrown exceptions
but this is in the newer version of camel (2.16.2). 

I also believe that an option should be provided for the file component
which would say either true or false i.e., if an exception occur during
processing, a rollback should happen or it shouldn't. By having this option
end users can simply control the behaviour on the URI itself...something
like below.



Thanks,
Kalyan





--
View this message in context: 
http://camel.465427.n5.nabble.com/File-Component-Implementing-onCompletionExceptionHandler-for-older-versions-tp5775863.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JPA consumer reconnection

2016-01-06 Thread Patrick Valsecchi
I've tried several connection pools with no success. The problem is that
JPA is keeping the connection, I guess.

I've solved my problem by switching to the hibernate Camel component and
reconnection works fine with C3P0.

On Tue, Jan 5, 2016 at 10:06 PM, SaurabhNayar 
wrote:

> That's not good from c3p0. You can try a different connection pool
> altogether.
>
> Apache DBCP is compatible with Hibernate
> http://commons.apache.org/proper/commons-dbcp/
>
> Here are some more details on Hibernate connection pooling:
> http://www.informit.com/articles/article.aspx?p=353736&seqNum=4
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JPA-consumer-reconnection-tp5775721p5775856.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: entity manager is injected as null in a camel bean but jpa: endpoint works fine

2016-01-06 Thread amitmahesh


So effectively you are suggesting to always use jpa: uri in the camel route
for all my database access part, and to avoid injecting entity manager in a
camel bean. Means I will have to keep multiple intermediate data processing
beans in camel route to generate/consume entity beans data.



--
View this message in context: 
http://camel.465427.n5.nabble.com/entity-manager-is-injected-as-null-in-a-camel-bean-but-jpa-endpoint-works-fine-tp5775308p5775867.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Shiro Security

2016-01-06 Thread fxthomas
It should work . Or else try with a processor 



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


Producer Template // Count mismatch

2016-01-06 Thread contactreji
Hi 

I have a code like this

package com.processors

import org.apache.camel.Endpoint
import org.apache.camel.Exchange
import org.apache.camel.ExchangePattern
import org.apache.camel.Processor
import org.apache.camel.impl.DefaultCamelContext

/**
 * Created by Z001NLH on 12/30/2015.
 */
class BatchOutRecordsImpl implements Processor{

//Static variables section
static def BATCH_GROUP_KEY = "FRTB_I"
static def DESTINATION_CAMEL_ENDPOINT =
"seda:AllocationAmountPerShipment" //This should be a valid camel endpoint
//static def DESTINATION_CAMEL_ENDPOINT = "vm:batchedRecords" //This
should be a valid camel endpoint
@Override
void process(Exchange exchange) throws Exception {


def records=(List>)
exchange.getIn().getBody()
def camelContext = exchange.getContext()
def producerTemplate = camelContext.createProducerTemplate()
def batch= new ArrayList>()
def previousBatchKey=null
def isLastIteration=false
def counter=1
//Looping through resultset
for(HashMap record in records)
{
isLastIteration=false
if(counter==records.size()) {
isLastIteration = true
}
def batchKey=record.get(BATCH_GROUP_KEY)

try{
   
previousBatchKey=batch.get(batch.size()-1).get(BATCH_GROUP_KEY)
}catch(java.lang.ArrayIndexOutOfBoundsException e)
{
println("Batch was Empty / Cleared stage")
previousBatchKey=batchKey
}
if(batchKey==previousBatchKey) {
batch.add(record)
}
if(isLastIteration||(batchKey!=previousBatchKey)) {

//Sending for processing
*producerTemplate.sendBody(DESTINATION_CAMEL_ENDPOINT,
ExchangePattern.InOnly, batch)*
//wiretapping records to folder dumped records
def freightID=batch.get(batch.size()-1).get("FRTB_I")
   * producerTemplate.sendBodyAndHeader("vm:batchedRecords",
ExchangePattern.InOnly,
batch.toString(),"CamelFileName",freightID.toString())*

batch.clear()
if(isLastIteration==false) {
batch.add(record)
}
}
counter++
}
}
}

I have highlighted 2 producer templates.. Unfortunately I am trying to send
the same body from both templates. But on the other end, the numbers
mismatch. One producer template received 2098 records and other one received
2089.

Any clue of why this happens? The body contains List>


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/Producer-Template-Count-mismatch-tp5775891.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel processor // Handling ArrayList of maps

2016-01-06 Thread contactreji
Hi guys

I have a processor which is working on a dataset containing Arraylist of
Hashmaps which comes in the exchange body. 

I get following exception. Any clue of why is this happening? I am not even
modifying the datastructure :-(
Its strange as each time I execute the program, the error happens with
different records. Its very random.

*[Camel (camel-1) thread #1 - vm://AllocationAmountPerShipment] ERROR
org.apache.camel.processor.DefaultErrorHandler - Failed delivery for
(MessageId: ID-FWLYGZ1-59683-1452089290442-0-9086 on ExchangeId:
ID-FWLYGZ1-59683-1452089290442-0-9707). Exhausted after delivery attempt: 1
caught: java.util.ConcurrentModificationException

Message History
---
RouteId  ProcessorId  Processor 
  
Elapsed (ms)
[route3] [route3]
[vm://AllocationAmountPerShipment?concurrentConsumers=1   
] [28]
[route3] [process2  ] [ref:allocationAmountPerShipment  

] [ 0]

Exchange
---
Exchange[
Id  ID-FWLYGZ1-59683-1452089290442-0-9707
ExchangePattern InOnly
Headers {breadcrumbId=ID-FWLYGZ1-59683-1452089290442-0-9086,
CamelRedelivered=false, CamelRedeliveryCounter=0}
BodyTypejava.util.ArrayList
Body[{FRTB_I=442484055  

, PROF_TYPE_C=LD  , CARR_N=RUAN TRANSPORTATION PRIMARY (  , SCAC_C=LABR,
VEND_I=4941410, *



My code snipped for the processor is as follows

*
package com.processors;

import org.apache.camel.*;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.DefaultProducerTemplate;

import java.util.List;
import java.util.Map;

/**
 * Created by Z001NLH on 1/6/2016.
 */
public class AllocationAmountPerShipmentImpl2 implements Processor{


@Override
public void process(Exchange exchange) throws Exception {
  

List> shipmentsUnderSameFRTB_I =
(List>) exchange.getIn().getBody();
   
double total = 0.00;
double individualShipmentWeight;
double allocationAmountPerShipment;
double TotalAmount = 0.00;
int i = 0, j = 0;
Map record = null;

if (shipmentsUnderSameFRTB_I.size() < 1) {
System.out.println("NULL RECORD SET");
}
else {
System.out.println("Dataset =
"+shipmentsUnderSameFRTB_I.toString());
for (i = 0; i < shipmentsUnderSameFRTB_I.size(); i++) {
//System.out.println("i is now "+i+" and size is
"+shipmentsUnderSameFRTB_I.size());
total = total +
Float.parseFloat(shipmentsUnderSameFRTB_I.get(i).get("SHIP_TOT_WT_Q").toString());
System.out.println("Total is now --" + total);
}
for (j = 0; j < shipmentsUnderSameFRTB_I.size(); j++) {
System.out.println("j is now " + j + " and size is " +
shipmentsUnderSameFRTB_I.size());
record = shipmentsUnderSameFRTB_I.get(j);
individualShipmentWeight =
Float.parseFloat(record.get("SHIP_TOT_WT_Q").toString());
TotalAmount =
Double.parseDouble(record.get("APRO_A").toString());
System.out.println("Total Freight Weight =" + total);
System.out.println("Individual Shipment Weight =" +
individualShipmentWeight);
System.out.println("Total Amount =" + TotalAmount);
allocationAmountPerShipment =
calculateAMPerShipment(individualShipmentWeight, total, TotalAmount);
System.out.println("Allocation Amount for Item is " +
allocationAmountPerShipment + " and total is " + TotalAmount + " FRTB_I is "
+ record.get("FRTB_I"));
}
}
}

static double calculateAMPerShipment(double SHIP_TOT_WT_Q,double total,
double TotalFRGTAmount){
return (SHIP_TOT_WT_Q/total)*TotalFRGTAmount;
}
}*




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-processor-Handling-ArrayList-of-maps-tp5775893.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Twitter WebSocket Blueprint example - cert issue in DDF 2.8.1

2016-01-06 Thread Mark
I created a standalone application using Camel 2.14.2.  I copied the route
from my blueprint file to a camel-context.xml file and everything worked
fine.  My best guess is that DDF is doing something to override certs,
which is preventing the connection to Twitter from working.



On Tue, Jan 5, 2016 at 12:10 PM, Mark  wrote:

> That's true, I am using 2.14.2, which is what the latest version (2.8.1)
> of DDF is using.
>
> I will try updating the Camel libs in DDF to the latest.
>
> Thanks,
> Mark
>
>
> On Tue, Jan 5, 2016 at 11:54 AM, Claus Ibsen 
> wrote:
>
>> You may need to upgrade camel as it may use an old twitter library
>> that may not support latest twitter api. I can see you are on the old
>> 2.14.x release.
>>
>> On Tue, Jan 5, 2016 at 4:55 PM, Mark  wrote:
>> > I was trying to deploy the camel-example-twitter-websocket-blueprint
>> > example in DDF 2.8.1 (uses Karaf version 2.4.3) and I get the exception
>> > shown below.  I'm not sure if anyone has experienced this and may know
>> how
>> > to get this bundle working inside OSGi with the proper Twitter
>> certificate
>> > information.
>> >
>> >
>> > 10:39:22,429 | INFO  | 00 milliseconds] | twitter4j.CommonsLoggingLogger
>> >   63 | ix.bundles.twitter4j | Establishing connection.
>> > 10:39:22,495 | INFO  | hing connection] | twitter4j.CommonsLoggingLogger
>> >   63 | ix.bundles.twitter4j |
>> > sun.security.validator.ValidatorException: PKIX path building failed:
>> > sun.security.provider.certpath.SunCertPathBuilderException: unable to
>> find
>> > valid certification path to requested target
>> > 10:39:22,495 | INFO  | hing connection] | twitter4j.CommonsLoggingLogger
>> >   63 | ix.bundles.twitter4j | Waiting for 16000 milliseconds
>> > 10:39:23,039 | WARN  | twitter://search |
>> org.apache.camel.util.CamelLogger
>> > 224 | che.camel.camel-core | Consumer
>> > Consumer[twitter://search?accessToken=] failed polling
>> endpoint:
>> > Endpoint[twitter://search?accessToken=]. Will try again at next
>> > poll. Caused by: [twitter4j.TwitterException -
>> > sun.security.validator.ValidatorException: PKIX path building failed:
>> > sun.security.provider.certpath.SunCertPathBuilderException: unable to
>> find
>> > valid certification path to requested target]
>> > sun.security.validator.ValidatorException: PKIX path building failed:
>> > sun.security.provider.certpath.SunCertPathBuilderException: unable to
>> find
>> > valid certification path to requested target
>> > Relevant discussions can be found on the Internet at:
>> > http://www.google.co.jp/search?q=506c3b98 or
>> > http://www.google.co.jp/search?q=105d1087
>> > TwitterException{exceptionCode=[506c3b98-105d1087 63e3f388-fb44fc20
>> > 63e3f388-fb44fc20 63e3f388-fb44fc20], statusCode=-1, message=null,
>> code=-1,
>> > retryAfter=-1, rateLimitStatus=null, version=4.0.2}
>> > at
>> >
>> twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:178)[406:org.apache.servicemix.bundles.twitter4j:4.0.2.1]
>> > at
>> >
>> twitter4j.HttpClientBase.request(HttpClientBase.java:53)[406:org.apache.servicemix.bundles.twitter4j:4.0.2.1]
>> > at
>> >
>> twitter4j.HttpClientBase.get(HttpClientBase.java:71)[406:org.apache.servicemix.bundles.twitter4j:4.0.2.1]
>> > at
>> >
>> twitter4j.TwitterImpl.get(TwitterImpl.java:1556)[406:org.apache.servicemix.bundles.twitter4j:4.0.2.1]
>> > at
>> >
>> twitter4j.TwitterImpl.search(TwitterImpl.java:247)[406:org.apache.servicemix.bundles.twitter4j:4.0.2.1]
>> > at
>> >
>> org.apache.camel.component.twitter.consumer.search.SearchConsumer.search(SearchConsumer.java:84)[407:org.apache.camel.camel-twitter:2.14.2]
>> > at
>> >
>> org.apache.camel.component.twitter.consumer.search.SearchConsumer.pollConsume(SearchConsumer.java:52)[407:org.apache.camel.camel-twitter:2.14.2]
>> > at
>> >
>> org.apache.camel.component.twitter.consumer.TwitterConsumerPolling.poll(TwitterConsumerPolling.java:65)[407:org.apache.camel.camel-twitter:2.14.2]
>> > at
>> >
>> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[186:org.apache.camel.camel-core:2.14.2]
>> > at
>> >
>> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[186:org.apache.camel.camel-core:2.14.2]
>> > at
>> >
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_51]
>> > at
>> >
>> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_51]
>> > at
>> >
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_51]
>> > at
>> >
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_51]
>> > at
>> >
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_51]
>> > at
>> >
>> java.util.concurre

Re: calling a spring bean inside an OSGI based project

2016-01-06 Thread Matt Sicker
Can't you just create a JdbcTemplate in blueprint and specify the
DataSource for it to use? I didn't think it required using Spring's
ApplicationContext or anything. You could also expose it as a service
(JdbcOperations).

On 6 January 2016 at 02:22, Meissa Sakho  wrote:

> Henryk,
> I did not want to use Spring.
> I just needed to call the Spring JdbcTemplate in my OSGI pure blueprint
> beans.
> The Spring JdbcTemplate provides database abstraction that we don't have
> with others camel component (sql,jpa,jdbc).
> Using Spring DM solves my problem, but that's not want I prefer.
> So if you know a way to call a Spring Bean (JdbcTemplate) inside an pure
> OSGI bean, i'll pay you a beer :-)
> Thanks,
> Meissa
>
> 2016-01-05 16:28 GMT+01:00 Henryk Konsek :
>
> > To use Spring, you have to stick to Spring DM configuration. Which is not
> > maintained anymore. So using Spring in OSGi creates more problem than it
> > solves.
> >
> > If you want to use Spring I recommend dropping OSGi on the behalf of the
> > Spring Boot running as fat jar or WAR.
> >
> > Cheers!
> >
> > wt., 5.01.2016 o 11:54 użytkownik Meissa Sakho 
> > napisał:
> >
> > > Hi Greg,
> > > I've already reviewed this links above.
> > > You can't define a spring bean inside yous OSGI configuration. It won't
> > > work.
> > > Let me first explain to you why I need to do it.
> > > I need to use the Spring JdbcTemplate component because to leverage the
> > > stored procedure abstraction.
> > > I do that because either the JPA component,sql or jdbc component do not
> > > provide this feature.
> > > I've found another workaround so far.
> > > But if you know a working solution for that (calling a spring bean
> from a
> > > blueprint), let me know.
> > > Thans,
> > > Meissa
> > >
> > > 2016-01-04 17:35 GMT+01:00 Greg Autric :
> > >
> > > > hi Meissa,
> > > >
> > > >
> > > > Blueprint configuration uses "almost" the same syntax and behavior
> than
> > > > Spring XML.
> > > > IMHO, I dislike use a mix of spring conf and blueprint conf.
> > > > Your spring configuration should work w/ few modifications into your
> > > > blueprint [1].
> > > >
> > > > [1]
> > > >
> > >
> >
> http://fuseesb.blogspot.fr/2014/10/what-is-differences-between-camel.html
> > > >
> > > > an other useful link :
> > > > http://camel.apache.org/using-osgi-blueprint-with-camel.html
> > > >
> > > > Greg AUTRIC
> > > > JBoss Middleware Consultant
> > > >
> > > > email   : gautric __at__ redhat __dot__ com
> > > > twitter : @gautric_io
> > > >
> > > > Red Hat Global Services
> > > > Red Hat France SARLsit: http://www.redhat.fr
> > > > Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
> > > > Sent from webmail
> > > >
> > > > - Mail original -
> > > > De: "Meissa Sakho" 
> > > > À: users@camel.apache.org
> > > > Envoyé: Mardi 22 Décembre 2015 12:37:29
> > > > Objet: calling a spring bean inside an OSGI based project
> > > >
> > > > Hi all,
> > > > I have created a restfull web service based on apache cxf with camel.
> > > > My endpoint is defined inside my blueprint configuration file like
> > below:
> > > >
> > > > 
> > > >
> > > > 
> > > >
> > > > 
> > > >
> > > > 
> > > >
> > > > 
> > > >
> > > > > > > "com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
> > > >
> > > > 
> > > >
> > > > 
> > > >
> > > > 
> > > >
> > > > 
> > > >
> > > >   
> > > >
> > > > 
> > > >
> > > > 
> > > >
> > > >  
> > > >
> > > >
> > > > I would like to Inject the Spring JdbcTemplate that I've defined in
> my
> > > > Spring configuration file to my BookingService business class.
> > > >
> > > > My question is :
> > > >
> > > > How can I a load and inject a Spring bean inside a OSGI based Bean?
> > > >
> > > > Thank you in advance,
> > > >
> > > > Meissa
> > > >
> > >
> > --
> > Henryk Konsek
> > http://about.me/hekonsek
> >
>



-- 
Matt Sicker 


statement.maxRows not working as expected camel jdbc

2016-01-06 Thread Felix Thomas
hello,

  I have an issue (not sure if its a bug)  in camel. I have tested in
multiple versio*n i.e. 2.15.1,2.16.0,2.16.1 *also but still the same result.

  I have a route defined below in spring XML . When i start the camel
instance it works fine at the first time i.e it fetches only 2 records as
expected . But  when the timer kicks in after 1 minute again it fetchs all
the rows in the table . I expect it to fetch only 2 again. Is there an
issue in my route definition ??


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


select * from TBL_DATA_AC




${body}











regards,
Felix


Re: camel-servlet is no-longer working in 2.16.1 (works in 2.15.3 and 2.16.0)

2016-01-06 Thread henrik
At 2015-11-30 15:14 GMT+01:00 MEL wrote:
> I am using the camel-servlet component, in an app hosted in tomcat, to 
> trigger a route via a URL such as this 
> 
> http://localhost:9090/appcontext/triggerimport/
> 
> When upgrading to 2.16.1 the URL fails to trigger the route;  the URL
> works 
> if I downgrade to 2.15.3 or 2.16.0 (looks like CAMEL-9263 may have 
> introduced the issue) 

Hi.

I'm having the same problem with camel-servlet.  Did you figure it out?

Cheers,
Henrik




--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-servlet-is-no-longer-working-in-2-16-1-works-in-2-15-3-and-2-16-0-tp5774558p5775896.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Problems with camel-jackson 2.16.1

2016-01-06 Thread rcarneiro-cit
Hi everyone!

I tried, recently, to update the camel version of a project from 2.15.4 to
2.16.1. Unfortunately, after that, I got an Exception with:
"Caused by: java.lang.NoSuchMethodError:
com.fasterxml.jackson.databind.util.BeanUtil.okNameForSetter(Lcom/fasterxml/jackson/databind/introspect/AnnotatedMethod;Z)Ljava/lang/String;"
I've the camel-jackson dependency on this project that was using the same
version of camel. When I replace the version of camel-jackson with 2.15.4, I
stop to got the Exception. 


Has anyone ever experienced this? I really need to keep the camel and the
camel- jackson in different versions?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problems-with-camel-jackson-2-16-1-tp5775920.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Producer Template // Count mismatch

2016-01-06 Thread CamelNayar
Reji,

I am not sure why you are facing the problem but something looks off with
the example. You are passing an object "batch" to vm component and clearing
the object in next line. vm component is asynchronous - so the object you
are trying to pass will clear once you do batch.clear(). 

Regards,
Saurabh Nayar



--
View this message in context: 
http://camel.465427.n5.nabble.com/Producer-Template-Count-mismatch-tp5775891p5775932.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel processor // Handling ArrayList of maps

2016-01-06 Thread CamelNayar
Reji,

This is related with the other question that has been posted by you. The
problem here is that you are modifying array list in two different threads
as I have posted in the other thread.

Regards,
Saurabh Nayar



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-processor-Handling-ArrayList-of-maps-tp5775893p5775933.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: statement.maxRows not working as expected camel jdbc

2016-01-06 Thread SaurabhNayar
Thats wired. You can try readSize as well.

Regards,
Saurabh Nayar



--
View this message in context: 
http://camel.465427.n5.nabble.com/statement-maxRows-not-working-as-expected-camel-jdbc-tp5775898p5775934.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: statement.maxRows not working as expected camel jdbc

2016-01-06 Thread Christian Müller
Hi Felix,

I have a unit test which confirms your finding. Could you please open an
JIRA and post the ticket number here. I will have a closer look during the
next days.
As workaround, you could also set the limit in the SQL query. Something
like: select * from TBL_DATA_AC LIMIT 2

Best,

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, Jan 6, 2016 at 4:04 PM, Felix Thomas  wrote:

> hello,
>
>   I have an issue (not sure if its a bug)  in camel. I have tested in
> multiple versio*n i.e. 2.15.1,2.16.0,2.16.1 *also but still the same
> result.
>
>   I have a route defined below in spring XML . When i start the camel
> instance it works fine at the first time i.e it fetches only 2 records as
> expected . But  when the timer kicks in after 1 minute again it fetchs all
> the rows in the table . I expect it to fetch only 2 again. Is there an
> issue in my route definition ??
>
>
> http://camel.apache.org/schema/spring";>
> 
> 
> select * from TBL_DATA_AC
> 
>
>  uri="jdbc:DSROUTE_TBL_DATA_AC?*statement.maxRows=2&*amp;outputType=StreamList"
> id="to8"/>
> 
> ${body}
> 
>  executorServiceRef="customThreadPoolProfile" id="multicast1">
> 
> 
> uri="rabbitmq://localhost/QUEUE?autoDelete=false&autoAck=false&queue=DEV&username=guest&password=guest&routingKey=DEV&durable=true"
> id="to9"/>
> 
> 
> 
> 
>
>
>
> regards,
> Felix
>


Re: calling a spring bean inside an OSGI based project

2016-01-06 Thread Meissa Sakho
Matt,
I created the Datasource and the JdbcTemplate in blueprint and it works !
I can get rid off the Spring DM that I used to make all working.
Thank you very much (I owe you a beer :-)
Meissa

2016-01-06 16:01 GMT+01:00 Matt Sicker :

> Can't you just create a JdbcTemplate in blueprint and specify the
> DataSource for it to use? I didn't think it required using Spring's
> ApplicationContext or anything. You could also expose it as a service
> (JdbcOperations).
>
> On 6 January 2016 at 02:22, Meissa Sakho  wrote:
>
> > Henryk,
> > I did not want to use Spring.
> > I just needed to call the Spring JdbcTemplate in my OSGI pure blueprint
> > beans.
> > The Spring JdbcTemplate provides database abstraction that we don't have
> > with others camel component (sql,jpa,jdbc).
> > Using Spring DM solves my problem, but that's not want I prefer.
> > So if you know a way to call a Spring Bean (JdbcTemplate) inside an pure
> > OSGI bean, i'll pay you a beer :-)
> > Thanks,
> > Meissa
> >
> > 2016-01-05 16:28 GMT+01:00 Henryk Konsek :
> >
> > > To use Spring, you have to stick to Spring DM configuration. Which is
> not
> > > maintained anymore. So using Spring in OSGi creates more problem than
> it
> > > solves.
> > >
> > > If you want to use Spring I recommend dropping OSGi on the behalf of
> the
> > > Spring Boot running as fat jar or WAR.
> > >
> > > Cheers!
> > >
> > > wt., 5.01.2016 o 11:54 użytkownik Meissa Sakho 
> > > napisał:
> > >
> > > > Hi Greg,
> > > > I've already reviewed this links above.
> > > > You can't define a spring bean inside yous OSGI configuration. It
> won't
> > > > work.
> > > > Let me first explain to you why I need to do it.
> > > > I need to use the Spring JdbcTemplate component because to leverage
> the
> > > > stored procedure abstraction.
> > > > I do that because either the JPA component,sql or jdbc component do
> not
> > > > provide this feature.
> > > > I've found another workaround so far.
> > > > But if you know a working solution for that (calling a spring bean
> > from a
> > > > blueprint), let me know.
> > > > Thans,
> > > > Meissa
> > > >
> > > > 2016-01-04 17:35 GMT+01:00 Greg Autric :
> > > >
> > > > > hi Meissa,
> > > > >
> > > > >
> > > > > Blueprint configuration uses "almost" the same syntax and behavior
> > than
> > > > > Spring XML.
> > > > > IMHO, I dislike use a mix of spring conf and blueprint conf.
> > > > > Your spring configuration should work w/ few modifications into
> your
> > > > > blueprint [1].
> > > > >
> > > > > [1]
> > > > >
> > > >
> > >
> >
> http://fuseesb.blogspot.fr/2014/10/what-is-differences-between-camel.html
> > > > >
> > > > > an other useful link :
> > > > > http://camel.apache.org/using-osgi-blueprint-with-camel.html
> > > > >
> > > > > Greg AUTRIC
> > > > > JBoss Middleware Consultant
> > > > >
> > > > > email   : gautric __at__ redhat __dot__ com
> > > > > twitter : @gautric_io
> > > > >
> > > > > Red Hat Global Services
> > > > > Red Hat France SARLsit: http://www.redhat.fr
> > > > > Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
> > > > > Sent from webmail
> > > > >
> > > > > - Mail original -
> > > > > De: "Meissa Sakho" 
> > > > > À: users@camel.apache.org
> > > > > Envoyé: Mardi 22 Décembre 2015 12:37:29
> > > > > Objet: calling a spring bean inside an OSGI based project
> > > > >
> > > > > Hi all,
> > > > > I have created a restfull web service based on apache cxf with
> camel.
> > > > > My endpoint is defined inside my blueprint configuration file like
> > > below:
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > > > > > > "com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > >   
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > >   class="com.mycompany.BookingService"/>
> > > > >
> > > > >
> > > > > I would like to Inject the Spring JdbcTemplate that I've defined in
> > my
> > > > > Spring configuration file to my BookingService business class.
> > > > >
> > > > > My question is :
> > > > >
> > > > > How can I a load and inject a Spring bean inside a OSGI based Bean?
> > > > >
> > > > > Thank you in advance,
> > > > >
> > > > > Meissa
> > > > >
> > > >
> > > --
> > > Henryk Konsek
> > > http://about.me/hekonsek
> > >
> >
>
>
>
> --
> Matt Sicker 
>


RE: Deploying Camel in WebLogic(Cluser)

2016-01-06 Thread madhava pulakanti
Thanks you very much preben for your response:)

-Original Message-
From: Preben.Asmussen [mailto:p...@dr.dk] 
Sent: Wednesday, January 06, 2016 12:05 AM
To: users@camel.apache.org
Subject: RE: Deploying Camel in WebLogic(Cluser)

hi Mahdava

If you package your camel app. as a war maybee tweek the weblogic.xml 
deployment descriptor to to use your war dependencies instead of app. server 
libs.
(prefer-web libs something) cant remember from the top of my head.

Then deploy it just as you would any other war file targeting all nodes or 
specific ones in the cluster. 
The nodemanager will take care of deploying it to the nodes.
You can do that using the weblogic web console, and there is even a weblogic 
maven plugin that you can use to automate it.

best,
preben



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


Re: camel-servlet is no-longer working in 2.16.1 (works in 2.15.3 and 2.16.0)

2016-01-06 Thread henrik
Aki Yoshida-3 wrote:
> There was some change introduced by CAMEL-9263 and there was a bug
> that calculated the wrong path in some cases.
> But this bug shouldn't affect normal servlet scenarios. So, I don't
> know why your scenario that runs with 2.16.0 is not running with 
> 2.16.1.
> You may try 2.16.2-SNAPSHOT to see if your scenario runs with that
> version, as this version corrects the mentioned bug.
> 
> In other cases, we need to see if there are any error logs indicating
> why the endpoint is not starting.

The endpoint is actually starting up:

[INFO ] [2016-01-06T15:30:37,050] [RMI TCP Connection(3)-127.0.0.1]
Initialized CamelHttpTransportServlet[name= MyTriggerImportServlet,
contextPath=/my-integration]  [CamelHttpTransportServlet]

2.16.2-SNAPSHOT does not fix the problem.

I have created CAMEL-9485 to track this issue.

Henrik




--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-servlet-is-no-longer-working-in-2-16-1-works-in-2-15-3-and-2-16-0-tp5774558p5775940.html
Sent from the Camel - Users mailing list archive at Nabble.com.