192.5. 사용 예
192.5.1. 예 1: 사용
from("kestrel://kserver02:22133/massive?concurrentConsumers=10&waitTimeMs=500") .bean("myConsumer", "onMessage");
public class MyConsumer { public void onMessage(String message) { ... } }
192.5.2. 예 2: 진행 중
public class MyProducer { @EndpointInject(uri = "kestrel://kserver01:22133,kserver02:22133/myqueue") ProducerTemplate producerTemplate; public void produceSomething() { producerTemplate.sendBody("Hello, world."); } }
192.5.3. 예 3: Spring XML 구성
<camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="kestrel://ks01:22133/sequential?concurrentConsumers=1&waitTimeMs=500"/> <bean ref="myBean" method="onMessage"/> </route> <route> <from uri="direct:start"/> <to uri="kestrel://ks02:22133/stuff"/> </route> </camelContext>
public class MyBean { public void onMessage(String message) { ... } }