Thanks Raul !
I haven't found simple example enrich here (
http://camel.apache.org/content-enricher.html, direct:resource in never
explains ). Perharps that I haven't understand fondamental but it's a huge
framework and learning needs time :)
So I have a querie :
from("direct:refreshReferentielDynamic")
.setBody(constant("SELECT * FROM TEST"))
.to("jdbc:dataSource")
.to("direct:ds")
.end();
Plus :
from("direct:ds").to("log:dans.directds").end();
Otherwise it doesn't works.
And an " main route " :
from("file://....")
.split()
.tokenize("\n")
.enrich("direct:ds", new AggregationStrategyRessource())
With :
public class AggregationStrategyRessource implements AggregationStrategy {
public Exchange aggregate(Exchange original, Exchange resource) {
return resource; // for the moment
}
}
But original is always null ...
Do you see with ?
2013/3/6 Jean Francois LE BESCONT <[email protected]>
> Hey !
>
> A picture is sometime better than explication :) I try to make a really
> simple test ( equivalent of MAP with lookup in ETL) :
>
>
> -------------------------
> | TABLE TEST |
> -------------------------
> | COL1 | COL2 |
> | jack | 2 |
> | bob | 3 |
> ------------------------
> |
> |
> |
> |
> |
> ---------------- ----------------------
> ------------------------
> | FILE INPUT | | ENRICH ? | |
> FILE OUTPUT |
> ---------------- ----------------------
> -----------------------
> | jack | cool | >>>>>>>>> | | >>>>>>>>> | jack
> | cool | 2 |
> | bob | foo | | |
> | bob | foo | 3 |
> ---------------- -----------------------
> ------------------------
>
>
>
>
>
>
>
> 2013/3/6 Jean Francois LE BESCONT <[email protected]>
>
>> If i do:
>> public class AggregationStrategyRessource implements AggregationStrategy {
>>
>> @Override
>> public Exchange aggregate(Exchange original, Exchange resource) {
>> int i = 1 / 0;
>> return original;
>> }
>> }
>>
>> no exception are thows.
>>
>>
>>
>> 2013/3/6 Jean Francois LE BESCONT <[email protected]>
>>
>>> thks Raul
>>>
>>> For the moment it's a simple :
>>>
>>> public class AggregationStrategyRessource implements AggregationStrategy
>>> {
>>>
>>> @Override
>>> public Exchange aggregate(Exchange original, Exchange resource) {
>>> return original;
>>> }
>>>
>>> }
>>>
>>> If I put a debug point on it, it is never fired ....
>>>
>>>
>>>
>>>
>>>
>>> 2013/3/6 Raúl Kripalani <[email protected]>
>>>
>>>> Can we see the code of AggregationStrategyRessource?
>>>>
>>>> Regards,
>>>> Raúl.
>>>>
>>>> On Mar 5, 2013, at 23:30, Jean Francois LE BESCONT wrote:
>>>>
>>>> > Hey,
>>>> >
>>>> > I have this >
>>>> >
>>>> http://camel.465427.n5.nabble.com/Enrich-message-with-data-from-dynamic-sql-query-td5329427.html
>>>> >
>>>> > But I haven't found a solution to my question.
>>>> >
>>>> > How can enrich my stream with data from a queries ?
>>>> >
>>>> > I have a a route called from the start :
>>>> >
>>>> > from("direct:refreshReferentielDynamic")
>>>> > //
>>>> > .setBody(constant("SELECT * FROM TEST"))
>>>> > //
>>>> > .to("jdbc:dataSource")
>>>> > //
>>>> > .to("direct:ds")
>>>> > //
>>>> > .end();
>>>> >
>>>> >
>>>> > End I would like to acces data in memory in direct:ds from an other
>>>> route.
>>>> > I have try this :
>>>> >
>>>> > from("foo").
>>>> > [...]
>>>> > .enrich("direct:ds", new AggregationStrategyRessource())
>>>> >
>>>> > But code in AggregationStrategyRessource is not called ... and body is
>>>> > replace by the content of the query.
>>>> >
>>>> > Thks !
>>>> >
>>>> > Thks !
>>>>
>>>>
>>>
>>
>