<commit_before>Tracer Example
==============

This example shows how to persist Camel trace event messages into a database using JPA.
It can be run using Maven or Ant.

You will need to compile this example first:
  mvn compile
  
For a background in tracer and JPA see
  http://activemq.apache.org/camel/tracer.html
  http://activemq.apache.org/camel/jpa.html

To run the example with Maven, type
  mvn camel:run

To run the example with Ant
  a. You need to have Hibernate Core, Entity Manager and HSQLDB installed.
  They can be downloaded from the following locations
    Hibernate Core 3.2.6 GA
      http://www.hibernate.org
    Hibernate Entity Manager 3.2.0.GA
      http://prdownloads.sourceforge.net/hibernate/hibernate-entitymanager-3.2.0.GA.zip?download
    HSQLDB 
      http://hsqldb.org/

  b. Export / Set home directories for the above as follows
    UNIX
    export HIBERNATE_CORE_HOME=<path to Hibernate install directory>
    export HIBERNATE_EM_HOME=<path to Hibernate EM install directory>
    export HSQLDB_HOME=<path to HSQLDB install directory>
    Windows
    set HIBERNATE_CORE_HOME=<path to Hibernate install directory>
    set HIBERNATE_EM_HOME=<path to Hibernate EM install directory>
    set HSQLDB_HOME=<path to HSQLDB install directory>

  c. To Run the example using Ant, type
    ant
     
In the HSQL Database Explorer type
  select * from camel_messagetraced

to see the trace events of the Exchanges. Notice how the Exchange correlates with
fromNode/toNode so you exactly can see how a given Exchange was routed in Camel.


Using the query:
  select shortExchangeId, previousNode, toNode, body from camel_messagetraced order by id

is a bit more easier to read as it uses the fields we are most interrested in to see how Exchanges
was routed in Camel.

In the console you can enter some words separated with space. Try to enter:
  nice beer
  beer whiskey
  camel nice day

This example will based on the input get some quotes from the input and select the best quote
to return as response in the console.

To stop the example hit ctrl + c

To use log4j as the logging framework add this to the pom.xml:
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
    </dependency>
and log4j.properties is located in src/main/resources 

For the latest & greatest documentation on how to use this example please see
  http://activemq.apache.org/camel/tracer.html

If you hit any problems please let us know on the Camel Forums
  http://activemq.apache.org/camel/discussion-forums.html
<commit_msg>CAMEL-1255: added snippet tags for documentation<commit_after>Tracer Example
==============

This example shows how to persist Camel trace event messages into a database using JPA.
It can be run using Maven or Ant.

You will need to compile this example first:
  mvn compile
  
For a background in tracer and JPA see
  http://activemq.apache.org/camel/tracer.html
  http://activemq.apache.org/camel/jpa.html

To run the example with Maven, type
  mvn camel:run

To run the example with Ant
  a. You need to have Hibernate Core, Entity Manager and HSQLDB installed.
  They can be downloaded from the following locations
    Hibernate Core 3.2.6 GA
      http://www.hibernate.org
    Hibernate Entity Manager 3.2.0.GA
      http://prdownloads.sourceforge.net/hibernate/hibernate-entitymanager-3.2.0.GA.zip?download
    HSQLDB 
      http://hsqldb.org/

  b. Export / Set home directories for the above as follows
    UNIX
    export HIBERNATE_CORE_HOME=<path to Hibernate install directory>
    export HIBERNATE_EM_HOME=<path to Hibernate EM install directory>
    export HSQLDB_HOME=<path to HSQLDB install directory>
    Windows
    set HIBERNATE_CORE_HOME=<path to Hibernate install directory>
    set HIBERNATE_EM_HOME=<path to Hibernate EM install directory>
    set HSQLDB_HOME=<path to HSQLDB install directory>

  c. To Run the example using Ant, type
    ant
     
In the HSQL Database Explorer type
  select * from camel_messagetraced

to see the trace events of the Exchanges. Notice how the Exchange correlates with
fromNode/toNode so you exactly can see how a given Exchange was routed in Camel.


Using the query:
  select shortExchangeId, previousNode, toNode, body from camel_messagetraced order by id

is a bit more easier to read as it uses the fields we are most interrested in to see how Exchanges
was routed in Camel.

In the console you can enter some words separated with space. Try to enter:
  nice beer
  beer whiskey
  camel nice day

This example will based on the input get some quotes from the input and select the best quote
to return as response in the console.

To stop the example hit ctrl + c

To use log4j as the logging framework add this to the pom.xml:
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
    </dependency>
and log4j.properties is located in src/main/resources 

For the latest & greatest documentation on how to use this example please see
  http://activemq.apache.org/camel/tracer-example.htmls

If you hit any problems please let us know on the Camel Forums
  http://activemq.apache.org/camel/discussion-forums.html

{'fraction_non_alphanumeric': 0.055964368706429124, 'fraction_numerical': 0.005809450038729667, 'mean_word_length': 3.6531531531531534, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2479951', 'n_tokens_mistral': 1576, 'n_tokens_neox': 1475, 'n_words': 663}