@BeforeClass public static void setupBroker() { broker = new EmbeddedActiveMQBroker("localhost"); try { broker.before(); } catch (Throwable t) { throw new RuntimeException(t); } }
@Override protected CamelContext createCamelContext() throws Exception { SimpleRegistry registry = new SimpleRegistry(); registry.put("aggStrategy", AggregationStrategies.groupedExchange()); ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(); connectionFactory.setBrokerURL(broker.getTcpConnectorUri()); SjmsComponent sjmsComponent = new SjmsComponent(); sjmsComponent.setConnectionFactory(connectionFactory); SjmsBatchComponent sjmsBatchComponent = new SjmsBatchComponent(); sjmsBatchComponent.setConnectionFactory(connectionFactory); CamelContext context = new DefaultCamelContext(registry); context.addComponent("sjms-batch", sjmsBatchComponent); context.addComponent("sjms", sjmsComponent); return context; }
@AfterClass public static void shutDownBroker() { broker.after(); }