Abstractions for Key/Value components and Serializers

2012-01-04 Thread Ioannis Canellos
As camel component list grows, I can see a lot of components doing similar
things, but every component does things in its own way. A very common
example are key/value components, here are some:

camel-cache
camel-hazelcast
camel-krati
camel-solr
etc.

Each of the components listed above, behaves differently. Each component
uses its own headers. Some components support key/values in the query
string, some others don't and even when they do the names of the query
parameters might be different.

The result is lack transparency/conformity. I think that it would be a
great improvement to abstract some of the key/value concepts (a
KeyValueEndpoint/KeyValueProducer/KeyValueConsumer maybe?) and align those
components so that they all work in a similar fashion.

Some of the components above also use serialization internally in order to
serialize/deserialize key & value (e.g. krati/hbase). For this case data
formats are not a really good fit (imho). I think that it would make sense
to have an abstractions serializer that could be passed to an endpoint that
supports pluggable serialization.

What do you think?

-- 
*Ioannis Canellos*
*
FuseSource 

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf  Committer & PMC
Apache Camel  Committer
Apache ServiceMix   Committer
Apache Gora  Committer
Apache DirectMemory  Committer
*


Re: [DISCUSS] Camel and MongoDB

2012-01-04 Thread Ioannis Canellos
I've used morphia a lot last year and I was very happy with it. However, I
think that we should not base a mongodb component on that.

I think that we need a pure camel-mongodb component and we could have a
morphia dataformat or a separate morphia component.

-- 
*Ioannis Canellos*
*
FuseSource 

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf  Committer & PMC
Apache Camel  Committer
Apache ServiceMix   Committer
Apache Gora  Committer
Apache DirectMemory  Committer
*


MOCK Problem: it gets half of the messages it suppose to receive

2012-01-04 Thread pitfab
Hello, i'm testing an application that sends messages through some routes
defined in the camel-context as it follow: 


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









${header.headerEvent} == 'MTT'


**  





and here is the class that sends the messages:
@Test
public void testRoutes() throws Exception {

msgHeader = new MessageHeader ("headerEvent", "MTT");
msgHeader2 = new MessageHeader("headerEvent", "CASH");
msgBody = new MessageBody ("body");
mBM = MessageBrokerManagerImpl.getInstance(prop);
mBM.startRoutingEngine();
   
for(int i = 0; i<50;i++){
if(i < 25){

mBM.sendHeaderAndBodyToEndPoint("message-inTo-filter",msgBody ,
msgHeader);

}else{


mBM.sendHeaderAndBodyToEndPoint("message-inTo-filter",msgBody ,
msgHeader2);
}
}
the problem is that when i set the MOCK component as endpoint i assert that
it should receive 25 msg but it just receive half(13). no track of the
others.
it's strange because if i change the IF like this ---> 
  for(int i = 0; i<50;i++){

if(i%2 ==0 ){

mBM.sendHeaderAndBodyToEndPoint("message-inTo-filter",msgBody ,
msgHeader);

}

the mock receive all the messages. 

The last thing i noticed is that if i set as endpoint an ActiveMQ queue it
works anyway.(no matter the IF).

Sorry if it's not clear..but i would really appreciate any of your suggest.

Thank you.
Fabrizio.

--
View this message in context: 
http://camel.465427.n5.nabble.com/MOCK-Problem-it-gets-half-of-the-messages-it-suppose-to-receive-tp5119702p5119702.html
Sent from the Camel Development mailing list archive at Nabble.com.


Re: MOCK Problem: it gets half of the messages it suppose to receive

2012-01-04 Thread Claus Ibsen
See the JMS wiki page about what types is allowed to use according to
the JMS spec.
Especially JMS headers is very limited what you can use/send.

So instead of using a object such as MessageHeader, then use a valid
type such as String or primitive type.
http://camel.apache.org/jms


On Wed, Jan 4, 2012 at 3:17 PM, pitfab  wrote:
> Hello, i'm testing an application that sends messages through some routes
> defined in the camel-context as it follow:
>
>
>                xmlns="http://camel.apache.org/schema/spring";>
>
>
>
>                 uri="lobby-jms:queue:lobby-filtered.queue" />
>                                        
> uri="lobby-jms:queue:lobby-event-worker.queue?concurrentConsumers=5" />
>
>                
>                        
>                        
>                                ${header.headerEvent} == 'MTT'
>
>
>                                **
>                        
>
>                
>
> and here is the class that sends the messages:
> @Test
>        public void testRoutes() throws Exception {
>
>            msgHeader = new MessageHeader ("headerEvent", "MTT");
>            msgHeader2 = new MessageHeader("headerEvent", "CASH");
>            msgBody = new MessageBody ("body");
>            mBM = MessageBrokerManagerImpl.getInstance(prop);
>            mBM.startRoutingEngine();
>
>            for(int i = 0; i<50;i++){
>                if(i < 25){
>                        
> mBM.sendHeaderAndBodyToEndPoint("message-inTo-filter",msgBody ,
> msgHeader);
>
>                }else{
>
>                        
> mBM.sendHeaderAndBodyToEndPoint("message-inTo-filter",msgBody ,
> msgHeader2);
>                }
>            }
> the problem is that when i set the MOCK component as endpoint i assert that
> it should receive 25 msg but it just receive half(13). no track of the
> others.
> it's strange because if i change the IF like this --->
>              for(int i = 0; i<50;i++){
>
>                if(i%2 ==0 ){
>                        
> mBM.sendHeaderAndBodyToEndPoint("message-inTo-filter",msgBody ,
> msgHeader);
>
>                }
>
> the mock receive all the messages.
>
> The last thing i noticed is that if i set as endpoint an ActiveMQ queue it
> works anyway.(no matter the IF).
>
> Sorry if it's not clear..but i would really appreciate any of your suggest.
>
> Thank you.
> Fabrizio.
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/MOCK-Problem-it-gets-half-of-the-messages-it-suppose-to-receive-tp5119702p5119702.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: MOCK Problem: it gets half of the messages it suppose to receive

2012-01-04 Thread pitfab
thank you for the reply. i resolved. it was a problem between the Mock
component and the interface we wrote to wrap the producer template. By using
the original template it works with no problem.

I also take this opportunity to congratulate you for the book Camel in
Action. Very clear and simple to read!

With regards,
Fabrizio.

--
View this message in context: 
http://camel.465427.n5.nabble.com/MOCK-Problem-it-gets-half-of-the-messages-it-suppose-to-receive-tp5119702p5120012.html
Sent from the Camel Development mailing list archive at Nabble.com.


Re: [DISCUSS] Dropping support for Camel 2.7.x

2012-01-04 Thread Babak Vahdat
Hi Christian,

did you see my previous post on this Thread? That would be really great if
you could give it a try while running a dry run of release. BTW I couldn't
catch up with Hadrian on irc chat so why I ask you.

The other option would be if you could postpone this friday release until
Hadrian has tested the patch.

Babak

--
View this message in context: 
http://camel.465427.n5.nabble.com/DISCUSS-Dropping-support-for-Camel-2-7-x-tp5112509p5120927.html
Sent from the Camel Development mailing list archive at Nabble.com.


Re: [DISCUSS] Dropping support for Camel 2.7.x

2012-01-04 Thread Babak Vahdat
Hi again Christian,

I just catches up with Hadrian on the chat and he is right now in the middle
of testing it. So let's see what will come out of it...

Babak

--
View this message in context: 
http://camel.465427.n5.nabble.com/DISCUSS-Dropping-support-for-Camel-2-7-x-tp5112509p5120952.html
Sent from the Camel Development mailing list archive at Nabble.com.


Re: Whats about a camel-all feature

2012-01-04 Thread Christian Müller
+1 on this.

It's not possible with Karaf 2.2.5

Christian-Muellers-MacBook-Pro:bin cmueller$ ./karaf clean
__ __  
   / //_/ __ _/ __/
  / ,<  / __ `/ ___/ __ `/ /_
 / /| |/ /_/ / /  / /_/ / __/
/_/ |_|\__,_/_/   \__,_/_/

  Apache Karaf (2.2.5)

Hit '' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '' or 'osgi:shutdown' to shutdown Karaf.

karaf@root> features:addurl
mvn:org.apache.camel.karaf/apache-camel/2.9.0/xml/features
karaf@root> features:install camel-*
Error executing command: No feature named 'camel-*' with version '0.0.0'
available

Best,
Christian

On Mon, Jan 2, 2012 at 2:45 PM, Jean-Baptiste Onofré wrote:

> AFAIR, it's already possible (I did an enhancement like this, I'm quite
> sure on the bundle, on features, I think so).
>
> Let me check.
>
> Regards
> JB
>
>
> On 01/02/2012 02:41 PM, Guillaume Nodet wrote:
>
>> Maybe we should be able to install those in karaf using:
>>   >  features:install camel-*
>>
>> That may solve this problem in a different way.
>>
>> On Sun, Jan 1, 2012 at 15:17, Christian Müller
>>   wrote:
>>
>>> It looks like it was not one of my best ideas... ;-)
>>>
>>> My goal was to have one command to install all Camel features and see
>>> whether or not we can successfully deploy all of them into Karaf.
>>> I agree the better solution is to have an OSGI integration test for all
>>> our
>>> components. At least we should have a (empty) test which use our features
>>> file to deploy the component into Karaf (with the jre.properties.cxf)
>>> configuration. I will have a look into our OSGI integraton tests an see
>>> whether we can improve something here to avoid the issues we had with our
>>> last release candidate. If so, I will raise a JIRA for it...
>>>
>>> Best,
>>> Christian
>>>
>>
>>
>>
>>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>


Re: [DISCUSS] Dropping support for Camel 2.7.x

2012-01-04 Thread Christian Müller
Hello Babak!

I will give it a try.
But at the moment the build hangs on my machine by executing the
maven-gpg-plugin:1.1:sign when I run a 'mvn release:prepare
-DdryRun=true'...

Best,
Christian

On Wed, Jan 4, 2012 at 10:35 PM, Babak Vahdat
wrote:

> Hi again Christian,
>
> I just catches up with Hadrian on the chat and he is right now in the
> middle
> of testing it. So let's see what will come out of it...
>
> Babak
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/DISCUSS-Dropping-support-for-Camel-2-7-x-tp5112509p5120952.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>


Re: [DISCUSS] Dropping support for Camel 2.7.x

2012-01-04 Thread Daniel Kulp
On Thursday, January 05, 2012 12:02:48 AM Christian Müller wrote:
> Hello Babak!
> 
> I will give it a try.
> But at the moment the build hangs on my machine by executing the
> maven-gpg-plugin:1.1:sign when I run a 'mvn release:prepare
> -DdryRun=true'...

It's likely not "hung", it's probably prompting for your password.   Something 
that keeps breaking and fixing with each release plugin/maven release.   
That's generally why I have a profile in my settings.xml that looks like:


release

true
true
true
true



which the release plugin would activate and I have the gpg agent setup to 
popup a nice dialog box asking for it.   I think you can do:

yougpgpassword

instead.  

Dan





> Best,
> Christian
> 
> On Wed, Jan 4, 2012 at 10:35 PM, Babak Vahdat
> 
> wrote:
> > Hi again Christian,
> > 
> > I just catches up with Hadrian on the chat and he is right now in the
> > middle
> > of testing it. So let's see what will come out of it...
> > 
> > Babak
> > 
> > --
> > View this message in context:
> > http://camel.465427.n5.nabble.com/DISCUSS-Dropping-support-for-Camel-2-7
> > -x-tp5112509p5120952.html Sent from the Camel Development mailing list
> > archive at Nabble.com.
-- 
Daniel Kulp
dk...@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: [DISCUSS] Dropping support for Camel 2.7.x

2012-01-04 Thread Hadrian Zbarcea
Yes, I have a similar setup and and I set  only during a 
release. For some reason  didn't work for me (but last 
time I tried was a couple of years back). Some of the properties (like 
maven.test.skip.exec) are not necessary for camel, they are already 
defined in the poms.


Christian, if you don't mind I could release 2.7.5. Babak's patch seems 
to help and I did commit it on all branches. I am doing a dryRun release 
now on my mac, but it'll probably take a couple of hours before I'll 
know more.


Cheers,
Hadrian



On 01/04/2012 06:38 PM, Daniel Kulp wrote:

On Thursday, January 05, 2012 12:02:48 AM Christian Müller wrote:

Hello Babak!

I will give it a try.
But at the moment the build hangs on my machine by executing the
maven-gpg-plugin:1.1:sign when I run a 'mvn release:prepare
-DdryRun=true'...


It's likely not "hung", it's probably prompting for your password.   Something
that keeps breaking and fixing with each release plugin/maven release.
That's generally why I have a profile in my settings.xml that looks like:

 
 release
 
 true
 true
 true
 true
 
 

which the release plugin would activate and I have the gpg agent setup to
popup a nice dialog box asking for it.   I think you can do:

yougpgpassword

instead.

Dan






Best,
Christian

On Wed, Jan 4, 2012 at 10:35 PM, Babak Vahdat

wrote:

Hi again Christian,

I just catches up with Hadrian on the chat and he is right now in the
middle
of testing it. So let's see what will come out of it...

Babak

--
View this message in context:
http://camel.465427.n5.nabble.com/DISCUSS-Dropping-support-for-Camel-2-7
-x-tp5112509p5120952.html Sent from the Camel Development mailing list
archive at Nabble.com.


--
Hadrian Zbarcea
Principal Software Architect
Talend, Inc
http://coders.talend.com/
http://camelbot.blogspot.com/


Re: [jira] [Commented] (CAMEL-4713) Create a camel component for SSH

2012-01-04 Thread David Karlsen
Ssh is quite widespread (and often replacing FTP) so I think it belongs to
the main sourcetree.
Den 4. jan. 2012 22:52 skrev "Scott Cranton (Commented) (JIRA)" <
j...@apache.org> følgende:

>
>[
> https://issues.apache.org/jira/browse/CAMEL-4713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13179924#comment-13179924]
>
> Scott Cranton commented on CAMEL-4713:
> --
>
> I've now got a connection re-connect test, and code and test for RSA Key
> Auth at https://github.com/scranton/camel. Plus sync'd with Camel trunk
> as of today...
>
> Any feedback, testing, etc. would be greatly appreciated...
>
> Not sure at one point this component reaches enough critical mass to be
> worthy of consideration of inclusion in Camel proper for on-going use and
> development...
>
> > Create a camel component for SSH
> > 
> >
> > Key: CAMEL-4713
> > URL: https://issues.apache.org/jira/browse/CAMEL-4713
> > Project: Camel
> >  Issue Type: New Feature
> >Reporter: Ioannis Canellos
> > Fix For: 2.10
> >
> >
> > Lately, I've seen a lot of questions in the mailing list for people that
> would want to use camel to execute SSH commands to remote hosts.
> > I think it would be nice if we could provide such component to the users.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA
> administrators:
> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>


Re: Whats about a camel-all feature

2012-01-04 Thread Jean-Baptiste Onofré

Thanks for the update Christian,

I do the enhancements (as I did on bundle).

Regards
JB

On 01/04/2012 11:20 PM, Christian Müller wrote:

+1 on this.

It's not possible with Karaf 2.2.5

Christian-Muellers-MacBook-Pro:bin cmueller$ ./karaf clean
 __ __  
/ //_/ __ _/ __/
   / ,<   / __ `/ ___/ __ `/ /_
  / /| |/ /_/ / /  / /_/ / __/
 /_/ |_|\__,_/_/   \__,_/_/

   Apache Karaf (2.2.5)

Hit '' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '' or 'osgi:shutdown' to shutdown Karaf.

karaf@root>  features:addurl
mvn:org.apache.camel.karaf/apache-camel/2.9.0/xml/features
karaf@root>  features:install camel-*
Error executing command: No feature named 'camel-*' with version '0.0.0'
available

Best,
Christian

On Mon, Jan 2, 2012 at 2:45 PM, Jean-Baptiste Onofréwrote:


AFAIR, it's already possible (I did an enhancement like this, I'm quite
sure on the bundle, on features, I think so).

Let me check.

Regards
JB


On 01/02/2012 02:41 PM, Guillaume Nodet wrote:


Maybe we should be able to install those in karaf using:
   >   features:install camel-*

That may solve this problem in a different way.

On Sun, Jan 1, 2012 at 15:17, Christian Müller
   wrote:


It looks like it was not one of my best ideas... ;-)

My goal was to have one command to install all Camel features and see
whether or not we can successfully deploy all of them into Karaf.
I agree the better solution is to have an OSGI integration test for all
our
components. At least we should have a (empty) test which use our features
file to deploy the component into Karaf (with the jre.properties.cxf)
configuration. I will have a look into our OSGI integraton tests an see
whether we can improve something here to avoid the issues we had with our
last release candidate. If so, I will raise a JIRA for it...

Best,
Christian







--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com





--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com