samedi 14 mars 2015

Camel: getting current route's exchange without specfying exchange as parameter

When I work with Camel almost every method I write has Exchange as a parameter, in order to get the current exchange by automatic binding.


Something like that:



class MyClass
{
void doSomething(Exchange exchange, ........)
{
exchange.getIn().....

.......
}
}


Is there a way to get the current exchange without specifying it as a parameter?


Maybe something like this....?



class MyClass
{
@ExchangeAware
Exchange exchange;

void doSomething(........)
{
exchange.getIn().....

.......
}
}

Aucun commentaire:

Enregistrer un commentaire