Hello Camel,
I am using Camel 2.4 and writting my first Java DSL route
I would like to translate the following route from Spring DSL:
<choice>
<when>
<simple>${header.JMSPriority} < 5</simple>
<throttle maximumRequestsPerPeriod="50"
timePeriodMillis="60000">
<to ref="nsResolved" />
</throttle>
</when>
<otherwise>
<to ref="nsResolved" />
</otherwise>
</choice>
Here is what I did :
@Override
public void configure() throws Exception {
from("direct:throttler.in")
.choice()
.when(simple("header.JMSPriority >= 5"))
.throttle(50).timePeriodMillis(60000)
.to("direct:nsResolved")
//.end()
.otherwise()
.to("direct:nsResolved")
.end();
}
In both case I can use otherwise() because I dont have a ChoiceDefinition
object.
Like that I get a ThrottlerDefinition, which implements block, so I should
close is with end() I suppose.
In that case I get a ProcessDefinition not a ChoiceDefinition.
Am I doing something wrong here ?
Thanks for your help,
Olivier
--
View this message in context:
http://camel.465427.n5.nabble.com/Throttler-in-a-Choice-tp3242130p3242130.html
Sent from the Camel - Users mailing list archive at Nabble.com.