Search in sources :

Example 1 with ListAggregationStrategy

use of org.apache.camel.component.sjms.batch.ListAggregationStrategy in project camel by apache.

the class ManualBatchFromQueueTest method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    SimpleRegistry registry = new SimpleRegistry();
    registry.put("testStrategy", new ListAggregationStrategy());
    CamelContext camel = new DefaultCamelContext(registry);
    SjmsBatchComponent sjms = new SjmsBatchComponent();
    sjms.setAsyncStartListener(true);
    log.info("Using live connection to existing ActiveMQ broker running on {}", url);
    sjms.setConnectionFactory(new ActiveMQConnectionFactory(url));
    camel.addComponent("sjms-batch", sjms);
    return camel;
}
Also used : CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) SimpleRegistry(org.apache.camel.impl.SimpleRegistry) SjmsBatchComponent(org.apache.camel.component.sjms.batch.SjmsBatchComponent) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) ListAggregationStrategy(org.apache.camel.component.sjms.batch.ListAggregationStrategy)

Aggregations

ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)1 CamelContext (org.apache.camel.CamelContext)1 ListAggregationStrategy (org.apache.camel.component.sjms.batch.ListAggregationStrategy)1 SjmsBatchComponent (org.apache.camel.component.sjms.batch.SjmsBatchComponent)1 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)1 SimpleRegistry (org.apache.camel.impl.SimpleRegistry)1