You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2011/05/23 17:27:30 UTC
assert & hashes
Hi,
i wrote 2 camel components,
- the first one is very simple and could be a language: camel-assert (
http://code.google.com/p/rmannibucau/source/browse/camel/camel-assert/): it
just allow to check values in a route, i know i could have used simple but i
wanted something more close to junit Assert class and really more simple
than what is dont to evaluate a language expression.
from("direct:arrayEquals").to("assert:equals").to("mock:arrayEquals");
template.sendBodyAndHeader("direct:arrayEquals", new String[] { "a",
"b" }, AssertComponent.ACTUAL_HEADER_KEY, new String[] { "a", "b" });
- the second one is simple too but can be useful when you work with files:
camel-codec (
http://code.google.com/p/rmannibucau/source/browse/camel/#camel%2Fcamel-codec),
it allows to create hashes from a file.
from("direct:start").to("codec:MD5").to("mock:result");
sendBody("direct:start",
getClass().getClassLoader().getResourceAsStream("foo.txt"));
Of course both can be used together to check a file ckecksum.
Any thought about it? I created jira about them.
- Romain
Re: assert & hashes
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Totally agree.
- Romain
Le 23 mai 2011 17:50, "Charles Moulliard" <cm...@gmail.com> a écrit :
> Hi Romain,
>
> Just a quick thought about what you call camel-codec but doing hasing
> of a file using MD5 algorithm. As this is part of crypto concern, we
> should integrate your code into the following existing component
> (http://camel.apache.org/crypto-digital-signatures.html) and not
> creating a new one
>
> crypto:sign
> crypto:verify
> --> crypto:digest
>
> Regards,
>
> Charles Moulliard
>
> Sr. Principal Solution Architect - FuseSource
> Apache Committer
>
> Blog : http://cmoulliard.blogspot.com
> Twitter : http://twitter.com/cmoulliard
> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> Skype: cmoulliard
>
>
>
> On Mon, May 23, 2011 at 5:27 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
>> Hi,
>>
>> i wrote 2 camel components,
>>
>> - the first one is very simple and could be a language: camel-assert (
>> http://code.google.com/p/rmannibucau/source/browse/camel/camel-assert/):
it
>> just allow to check values in a route, i know i could have used simple
but i
>> wanted something more close to junit Assert class and really more simple
>> than what is dont to evaluate a language expression.
>>
>> from("direct:arrayEquals").to("assert:equals").to("mock:arrayEquals");
>>
>> template.sendBodyAndHeader("direct:arrayEquals", new String[] { "a",
>> "b" }, AssertComponent.ACTUAL_HEADER_KEY, new String[] { "a", "b" });
>>
>>
>> - the second one is simple too but can be useful when you work with
files:
>> camel-codec (
>>
http://code.google.com/p/rmannibucau/source/browse/camel/#camel%2Fcamel-codec
),
>> it allows to create hashes from a file.
>>
>> from("direct:start").to("codec:MD5").to("mock:result");
>>
>> sendBody("direct:start",
>> getClass().getClassLoader().getResourceAsStream("foo.txt"));
>> Of course both can be used together to check a file ckecksum.
>>
>> Any thought about it? I created jira about them.
>>
>> - Romain
>>
Re: assert & hashes
Posted by Charles Moulliard <cm...@gmail.com>.
Hi Romain,
Just a quick thought about what you call camel-codec but doing hasing
of a file using MD5 algorithm. As this is part of crypto concern, we
should integrate your code into the following existing component
(http://camel.apache.org/crypto-digital-signatures.html) and not
creating a new one
crypto:sign
crypto:verify
--> crypto:digest
Regards,
Charles Moulliard
Sr. Principal Solution Architect - FuseSource
Apache Committer
Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard
On Mon, May 23, 2011 at 5:27 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Hi,
>
> i wrote 2 camel components,
>
> - the first one is very simple and could be a language: camel-assert (
> http://code.google.com/p/rmannibucau/source/browse/camel/camel-assert/): it
> just allow to check values in a route, i know i could have used simple but i
> wanted something more close to junit Assert class and really more simple
> than what is dont to evaluate a language expression.
>
> from("direct:arrayEquals").to("assert:equals").to("mock:arrayEquals");
>
> template.sendBodyAndHeader("direct:arrayEquals", new String[] { "a",
> "b" }, AssertComponent.ACTUAL_HEADER_KEY, new String[] { "a", "b" });
>
>
> - the second one is simple too but can be useful when you work with files:
> camel-codec (
> http://code.google.com/p/rmannibucau/source/browse/camel/#camel%2Fcamel-codec),
> it allows to create hashes from a file.
>
> from("direct:start").to("codec:MD5").to("mock:result");
>
> sendBody("direct:start",
> getClass().getClassLoader().getResourceAsStream("foo.txt"));
> Of course both can be used together to check a file ckecksum.
>
> Any thought about it? I created jira about them.
>
> - Romain
>
Re: assert & hashes
Posted by Romain Manni-Bucau <rm...@gmail.com>.
I created days ago these ones:
https://issues.apache.org/jira/browse/CAMEL-4000
https://issues.apache.org/jira/browse/CAMEL-4001
- Romain
2011/5/25 Charles Moulliard <cm...@gmail.com>
> Can you open two tickets : one concerning the first component and the
> other to improve the crypto please ?
> Can you also put in the jira ticket the link to nabble web site
> containing this discussion please ?
>
> On Tue, May 24, 2011 at 8:58 AM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Hi Chatres,
> >
> > i don't want to use simple because the cost (in time) of the evaluation
> is
> > very important in my simple route (the half of the execution time), the
> > component i did is faster because it is not a language and it is a bit
> > simpler than simple.
> >
> > I know i could have written my own predicates but packaging it into a
> > component is IMHO more sexy.
> >
> > I'm agree it is not perfect since simple can do the same but i can't
> accept
> > to loose time on simple assertions in my route.
> >
> > If there is any other solution i'll have a look.
> >
> > - Romain
> >
> > 2011/5/24 Charles Moulliard <cm...@gmail.com>
> >
> >> Hi Romain,
> >>
> >> Concerning the first component or new langage proposed based on
> >> assert, what will be the added value to use it instead of the existing
> >> "simple" language ? Can we imagine that missing functionalities
> >> covered by assert are simply added to the simple language instead of
> >> creating a new one ?
> >> I just think about rationality to maintain so much expression
> >> languages in camel and avoid having too much. By the way, this
> >> question should also be raised for some existing and question too
> >> their pertinence.
> >>
> >> Regards,
> >>
> >> Charles
> >>
> >> On Mon, May 23, 2011 at 5:27 PM, Romain Manni-Bucau
> >> <rm...@gmail.com> wrote:
> >> > Hi,
> >> >
> >> > i wrote 2 camel components,
> >> >
> >> > - the first one is very simple and could be a language: camel-assert (
> >> >
> http://code.google.com/p/rmannibucau/source/browse/camel/camel-assert/):
> >> it
> >> > just allow to check values in a route, i know i could have used simple
> >> but i
> >> > wanted something more close to junit Assert class and really more
> simple
> >> > than what is dont to evaluate a language expression.
> >> >
> >> > from("direct:arrayEquals").to("assert:equals").to("mock:arrayEquals");
> >> >
> >> > template.sendBodyAndHeader("direct:arrayEquals", new String[] { "a",
> >> > "b" }, AssertComponent.ACTUAL_HEADER_KEY, new String[] { "a", "b" });
> >> >
> >> >
> >> > - the second one is simple too but can be useful when you work with
> >> files:
> >> > camel-codec (
> >> >
> >>
> http://code.google.com/p/rmannibucau/source/browse/camel/#camel%2Fcamel-codec
> >> ),
> >> > it allows to create hashes from a file.
> >> >
> >> > from("direct:start").to("codec:MD5").to("mock:result");
> >> >
> >> > sendBody("direct:start",
> >> > getClass().getClassLoader().getResourceAsStream("foo.txt"));
> >> > Of course both can be used together to check a file ckecksum.
> >> >
> >> > Any thought about it? I created jira about them.
> >> >
> >> > - Romain
> >> >
> >>
> >
>
Re: assert & hashes
Posted by Charles Moulliard <cm...@gmail.com>.
Can you open two tickets : one concerning the first component and the
other to improve the crypto please ?
Can you also put in the jira ticket the link to nabble web site
containing this discussion please ?
On Tue, May 24, 2011 at 8:58 AM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Hi Chatres,
>
> i don't want to use simple because the cost (in time) of the evaluation is
> very important in my simple route (the half of the execution time), the
> component i did is faster because it is not a language and it is a bit
> simpler than simple.
>
> I know i could have written my own predicates but packaging it into a
> component is IMHO more sexy.
>
> I'm agree it is not perfect since simple can do the same but i can't accept
> to loose time on simple assertions in my route.
>
> If there is any other solution i'll have a look.
>
> - Romain
>
> 2011/5/24 Charles Moulliard <cm...@gmail.com>
>
>> Hi Romain,
>>
>> Concerning the first component or new langage proposed based on
>> assert, what will be the added value to use it instead of the existing
>> "simple" language ? Can we imagine that missing functionalities
>> covered by assert are simply added to the simple language instead of
>> creating a new one ?
>> I just think about rationality to maintain so much expression
>> languages in camel and avoid having too much. By the way, this
>> question should also be raised for some existing and question too
>> their pertinence.
>>
>> Regards,
>>
>> Charles
>>
>> On Mon, May 23, 2011 at 5:27 PM, Romain Manni-Bucau
>> <rm...@gmail.com> wrote:
>> > Hi,
>> >
>> > i wrote 2 camel components,
>> >
>> > - the first one is very simple and could be a language: camel-assert (
>> > http://code.google.com/p/rmannibucau/source/browse/camel/camel-assert/):
>> it
>> > just allow to check values in a route, i know i could have used simple
>> but i
>> > wanted something more close to junit Assert class and really more simple
>> > than what is dont to evaluate a language expression.
>> >
>> > from("direct:arrayEquals").to("assert:equals").to("mock:arrayEquals");
>> >
>> > template.sendBodyAndHeader("direct:arrayEquals", new String[] { "a",
>> > "b" }, AssertComponent.ACTUAL_HEADER_KEY, new String[] { "a", "b" });
>> >
>> >
>> > - the second one is simple too but can be useful when you work with
>> files:
>> > camel-codec (
>> >
>> http://code.google.com/p/rmannibucau/source/browse/camel/#camel%2Fcamel-codec
>> ),
>> > it allows to create hashes from a file.
>> >
>> > from("direct:start").to("codec:MD5").to("mock:result");
>> >
>> > sendBody("direct:start",
>> > getClass().getClassLoader().getResourceAsStream("foo.txt"));
>> > Of course both can be used together to check a file ckecksum.
>> >
>> > Any thought about it? I created jira about them.
>> >
>> > - Romain
>> >
>>
>
Re: assert & hashes
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Chatres,
i don't want to use simple because the cost (in time) of the evaluation is
very important in my simple route (the half of the execution time), the
component i did is faster because it is not a language and it is a bit
simpler than simple.
I know i could have written my own predicates but packaging it into a
component is IMHO more sexy.
I'm agree it is not perfect since simple can do the same but i can't accept
to loose time on simple assertions in my route.
If there is any other solution i'll have a look.
- Romain
2011/5/24 Charles Moulliard <cm...@gmail.com>
> Hi Romain,
>
> Concerning the first component or new langage proposed based on
> assert, what will be the added value to use it instead of the existing
> "simple" language ? Can we imagine that missing functionalities
> covered by assert are simply added to the simple language instead of
> creating a new one ?
> I just think about rationality to maintain so much expression
> languages in camel and avoid having too much. By the way, this
> question should also be raised for some existing and question too
> their pertinence.
>
> Regards,
>
> Charles
>
> On Mon, May 23, 2011 at 5:27 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Hi,
> >
> > i wrote 2 camel components,
> >
> > - the first one is very simple and could be a language: camel-assert (
> > http://code.google.com/p/rmannibucau/source/browse/camel/camel-assert/):
> it
> > just allow to check values in a route, i know i could have used simple
> but i
> > wanted something more close to junit Assert class and really more simple
> > than what is dont to evaluate a language expression.
> >
> > from("direct:arrayEquals").to("assert:equals").to("mock:arrayEquals");
> >
> > template.sendBodyAndHeader("direct:arrayEquals", new String[] { "a",
> > "b" }, AssertComponent.ACTUAL_HEADER_KEY, new String[] { "a", "b" });
> >
> >
> > - the second one is simple too but can be useful when you work with
> files:
> > camel-codec (
> >
> http://code.google.com/p/rmannibucau/source/browse/camel/#camel%2Fcamel-codec
> ),
> > it allows to create hashes from a file.
> >
> > from("direct:start").to("codec:MD5").to("mock:result");
> >
> > sendBody("direct:start",
> > getClass().getClassLoader().getResourceAsStream("foo.txt"));
> > Of course both can be used together to check a file ckecksum.
> >
> > Any thought about it? I created jira about them.
> >
> > - Romain
> >
>
Re: assert & hashes
Posted by Charles Moulliard <cm...@gmail.com>.
Hi Romain,
Concerning the first component or new langage proposed based on
assert, what will be the added value to use it instead of the existing
"simple" language ? Can we imagine that missing functionalities
covered by assert are simply added to the simple language instead of
creating a new one ?
I just think about rationality to maintain so much expression
languages in camel and avoid having too much. By the way, this
question should also be raised for some existing and question too
their pertinence.
Regards,
Charles
On Mon, May 23, 2011 at 5:27 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Hi,
>
> i wrote 2 camel components,
>
> - the first one is very simple and could be a language: camel-assert (
> http://code.google.com/p/rmannibucau/source/browse/camel/camel-assert/): it
> just allow to check values in a route, i know i could have used simple but i
> wanted something more close to junit Assert class and really more simple
> than what is dont to evaluate a language expression.
>
> from("direct:arrayEquals").to("assert:equals").to("mock:arrayEquals");
>
> template.sendBodyAndHeader("direct:arrayEquals", new String[] { "a",
> "b" }, AssertComponent.ACTUAL_HEADER_KEY, new String[] { "a", "b" });
>
>
> - the second one is simple too but can be useful when you work with files:
> camel-codec (
> http://code.google.com/p/rmannibucau/source/browse/camel/#camel%2Fcamel-codec),
> it allows to create hashes from a file.
>
> from("direct:start").to("codec:MD5").to("mock:result");
>
> sendBody("direct:start",
> getClass().getClassLoader().getResourceAsStream("foo.txt"));
> Of course both can be used together to check a file ckecksum.
>
> Any thought about it? I created jira about them.
>
> - Romain
>