<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Configures the Camel Context-->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:amq="http://activemq.apache.org/schema/core"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
       http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">


  <!--
    lets enable hawtio logs. See: http://hawt.io/logs/

    though you get this enabled by default if you use hawtio-default.war
   -->
  <bean id="logQuery" class="org.fusesource.insight.log.log4j.Log4jLogQuery" lazy-init="false" scope="singleton"
        init-method="start" destroy-method="stop"/>

  <!-- This creates an embedded ActiveMQ Broker -->
  <broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker1" useJmx="true">
    <networkConnectors>
      <networkConnector uri="static:(tcp://localhost:31317)" userName="admin" password="<PASSWORD>"/>
    </networkConnectors>
    <transportConnectors>
      <transportConnector uri="tcp://localhost:31316"/>
    </transportConnectors>

    <persistenceAdapter>
      <levelDB directory="target/activemq/broker1/data/leveldb" logSize="107374182"/>
    </persistenceAdapter>
    <plugins>
      <simpleAuthenticationPlugin>
        <users>
          <authenticationUser username="admin" password="<PASSWORD>" groups="users,admins"/>
        </users>
      </simpleAuthenticationPlugin>      
    </plugins>
  </broker>

  <broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker2" useJmx="true">
    <networkConnectors>
      <networkConnector uri="static:(tcp://localhost:31316)" userName="admin" password="<PASSWORD>"/>
    </networkConnectors>
    <transportConnectors>
      <transportConnector uri="tcp://localhost:31317"/>
    </transportConnectors>

    <persistenceAdapter>
      <levelDB directory="target/activemq/broker2/data/leveldb" logSize="107374182"/>
    </persistenceAdapter>
    <plugins>
      <simpleAuthenticationPlugin>
        <users>
          <authenticationUser username="admin" password="<PASSWORD>" groups="users,admins"/>
        </users>
      </simpleAuthenticationPlugin>      
    </plugins>    
  </broker>

  <!-- Lets connect the Camel ActiveMQ component to the embedded broker.
       See http://camel.apache.org/activemq.html for more information.
  -->
  <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL" value="failover:tcp://localhost:31316"/>
    <property name="userName" value="admin"/>
    <property name="password" value="<PASSWORD>"/>
  </bean>

  <!-- tell Camel to use localhost as the JMX MBean naming to have a fixed name style -->
  <bean id="managementName" class="org.apache.camel.management.DefaultManagementNamingStrategy">
      <!-- the hostname does not have to be resolvable, it can be any value you want -->
      <property name="hostName" value="localhost"/>
      <property name="domainName" value="org.apache.camel"/>
  </bean>

  <!-- Here is a sample which processes the input files
         (leaving them in place - see the 'noop' flag), and
         sends them on a JMS queue. This queue is watched by
         another route which then performs content based
         routing on the messages using XPath.
  -->
  <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
      <from uri="file:src/test/data?noop=true"/>
      <to uri="activemq:personnel.records"/>
      <to uri="activemq:browse.me"/>
    </route>
    <route id="foo">
      <from uri="activemq:personnel.records"/>
      <choice>
        <when>
          <xpath>/person/city = 'London'</xpath>
          <to uri="file:target/messages/uk"/>
        </when>
        <otherwise>
          <to uri="file:target/messages/others"/>
        </otherwise>
      </choice>
    </route>
    <!-- route for having something trigger all the time -->
    <route id="timerToAMQ">
      <from uri="timer:foo?period=5000"/>
      <setBody><constant>Hello World</constant></setBody>
      <delay><constant>500</constant></delay>
      <log message="The message contains ${body}" loggingLevel="DEBUG"/>
      <to uri="activemq:timer.events"/>
    </route>
  </camelContext>

  <camelContext id="onExceptionContext" xmlns="http://camel.apache.org/schema/spring">
    <onException>
      <exception>java.lang.Exception</exception>
      <choice>
        <when>
          <xpath>$foo = 'bar'</xpath>
          <to uri="direct:b"/>
        </when>
        <when>
          <xpath>$foo = 'cheese'</xpath>
          <to uri="direct:c"/>
        </when>
        <otherwise>
          <to uri="direct:d"/>
        </otherwise>
      </choice>
    </onException>
    <route id="route1">
      <from uri="timer://purgeTimer?period=900000"/>
      <log loggingLevel="INFO" logName="test" message="testPing..."/>
      <to uri="direct:e"/>
    </route>
    <route id="route2">
      <from uri="direct:b"/>
      <log loggingLevel="INFO" logName="test" message="direct:b"/>
    </route>
    <route>
      <from uri="direct:c"/>
      <log loggingLevel="INFO" logName="test" message="direct:c"/>
    </route>
    <route>
      <from uri="direct:d"/>
      <log loggingLevel="INFO" logName="test" message="direct:d"/>
    </route>
    <route>
      <from uri="direct:e"/>
      <log loggingLevel="INFO" logName="test" message="direct:e"/>
    </route>
  </camelContext>


  <!-- infinispan demo -->
  <bean id="infinispanFactory" class="io.hawt.example.infinispan.InfinispanDemo" init-method="init" lazy-init="false"/>
</beans><commit_msg>add a bunch of empty contexts; so its easy to test/demo removing them :)<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Configures the Camel Context-->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:amq="http://activemq.apache.org/schema/core"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
       http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">


  <!--
    lets enable hawtio logs. See: http://hawt.io/logs/

    though you get this enabled by default if you use hawtio-default.war
   -->
  <bean id="logQuery" class="org.fusesource.insight.log.log4j.Log4jLogQuery" lazy-init="false" scope="singleton"
        init-method="start" destroy-method="stop"/>

  <!-- This creates an embedded ActiveMQ Broker -->
  <broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker1" useJmx="true">
    <networkConnectors>
      <networkConnector uri="static:(tcp://localhost:31317)" userName="admin" password="<PASSWORD>"/>
    </networkConnectors>
    <transportConnectors>
      <transportConnector uri="tcp://localhost:31316"/>
    </transportConnectors>

    <persistenceAdapter>
      <levelDB directory="target/activemq/broker1/data/leveldb" logSize="107374182"/>
    </persistenceAdapter>
    <plugins>
      <simpleAuthenticationPlugin>
        <users>
          <authenticationUser username="admin" password="<PASSWORD>" groups="users,admins"/>
        </users>
      </simpleAuthenticationPlugin>      
    </plugins>
  </broker>

  <broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker2" useJmx="true">
    <networkConnectors>
      <networkConnector uri="static:(tcp://localhost:31316)" userName="admin" password="<PASSWORD>"/>
    </networkConnectors>
    <transportConnectors>
      <transportConnector uri="tcp://localhost:31317"/>
    </transportConnectors>

    <persistenceAdapter>
      <levelDB directory="target/activemq/broker2/data/leveldb" logSize="107374182"/>
    </persistenceAdapter>
    <plugins>
      <simpleAuthenticationPlugin>
        <users>
          <authenticationUser username="admin" password="<PASSWORD>" groups="users,admins"/>
        </users>
      </simpleAuthenticationPlugin>      
    </plugins>    
  </broker>

  <!-- Lets connect the Camel ActiveMQ component to the embedded broker.
       See http://camel.apache.org/activemq.html for more information.
  -->
  <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL" value="failover:tcp://localhost:31316"/>
    <property name="userName" value="admin"/>
    <property name="password" value="<PASSWORD>"/>
  </bean>

  <!-- tell Camel to use localhost as the JMX MBean naming to have a fixed name style -->
  <bean id="managementName" class="org.apache.camel.management.DefaultManagementNamingStrategy">
      <!-- the hostname does not have to be resolvable, it can be any value you want -->
      <property name="hostName" value="localhost"/>
      <property name="domainName" value="org.apache.camel"/>
  </bean>

  <!-- Here is a sample which processes the input files
         (leaving them in place - see the 'noop' flag), and
         sends them on a JMS queue. This queue is watched by
         another route which then performs content based
         routing on the messages using XPath.
  -->
  <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
      <from uri="file:src/test/data?noop=true"/>
      <to uri="activemq:personnel.records"/>
      <to uri="activemq:browse.me"/>
    </route>
    <route id="foo">
      <from uri="activemq:personnel.records"/>
      <choice>
        <when>
          <xpath>/person/city = 'London'</xpath>
          <to uri="file:target/messages/uk"/>
        </when>
        <otherwise>
          <to uri="file:target/messages/others"/>
        </otherwise>
      </choice>
    </route>
    <!-- route for having something trigger all the time -->
    <route id="timerToAMQ">
      <from uri="timer:foo?period=5000"/>
      <setBody><constant>Hello World</constant></setBody>
      <delay><constant>500</constant></delay>
      <log message="The message contains ${body}" loggingLevel="DEBUG"/>
      <to uri="activemq:timer.events"/>
    </route>
  </camelContext>

  <camelContext id="onExceptionContext" xmlns="http://camel.apache.org/schema/spring">
    <onException>
      <exception>java.lang.Exception</exception>
      <choice>
        <when>
          <xpath>$foo = 'bar'</xpath>
          <to uri="direct:b"/>
        </when>
        <when>
          <xpath>$foo = 'cheese'</xpath>
          <to uri="direct:c"/>
        </when>
        <otherwise>
          <to uri="direct:d"/>
        </otherwise>
      </choice>
    </onException>
    <route id="route1">
      <from uri="timer://purgeTimer?period=900000"/>
      <log loggingLevel="INFO" logName="test" message="testPing..."/>
      <to uri="direct:e"/>
    </route>
    <route id="route2">
      <from uri="direct:b"/>
      <log loggingLevel="INFO" logName="test" message="direct:b"/>
    </route>
    <route>
      <from uri="direct:c"/>
      <log loggingLevel="INFO" logName="test" message="direct:c"/>
    </route>
    <route>
      <from uri="direct:d"/>
      <log loggingLevel="INFO" logName="test" message="direct:d"/>
    </route>
    <route>
      <from uri="direct:e"/>
      <log loggingLevel="INFO" logName="test" message="direct:e"/>
    </route>
  </camelContext>

  <camelContext id="cheese" xmlns="http://camel.apache.org/schema/spring">
  </camelContext>

  <camelContext id="thingy" xmlns="http://camel.apache.org/schema/spring">
  </camelContext>

  <camelContext id="bar" xmlns="http://camel.apache.org/schema/spring">
  </camelContext>


  <!-- infinispan demo -->
  <bean id="infinispanFactory" class="io.hawt.example.infinispan.InfinispanDemo" init-method="init" lazy-init="false"/>
</beans>
{'fraction_non_alphanumeric': 0.16313947675387436, 'fraction_numerical': 0.011998000333277787, 'mean_word_length': 3.1176672384219555, 'pattern_counts': {'":': 0, '<': 287, '<?xml version=': 2, '>': 287, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 19}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2269876', 'n_tokens_mistral': 3789, 'n_tokens_neox': 3633, 'n_words': 720}