Example #1
0
 @BeforeClass
 public static void setupBroker() {
   broker = new EmbeddedActiveMQBroker("localhost");
   try {
     broker.before();
   } catch (Throwable t) {
     throw new RuntimeException(t);
   }
 }
Example #2
0
  @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;
  }
Example #3
0
 @AfterClass
 public static void shutDownBroker() {
   broker.after();
 }