Skip to content

getting_started_with_pbj

Johnsd11 edited this page Sep 25, 2024 · 44 revisions

Prerequisites:

  • cTAKES
  • Python
  • Artemis

Artemis Instructions For making a Broker:

  1. Download Apache ActiveMQ Artemis here: https://activemq.apache.org/components/artemis/download/
  2. In a terminal, navigate to the apache-artemis folder
  3. Navigate into bin, then use these commands ./bin/artemis create [name of your broker] for Mac and Linux or bin\artemis create [name of your broker] for Windows
  • You will be prompted to create a username and password, as well as --allow-anonymous, Press Y for this option

You should now have an Artemis broker and can now run the following pbj example below

For more information see apache-artemis documentation.

Run Your First Example

  1. Start by creating an application configuration in your IDE (I will be using Intellij for this example)
  2. Create a name for it and copy down the information you see in the picture below

step3

NOTE: We used

  • Java-17
  • cp(class path) cTAKES examples
  • Main class org.apache.ctakes.core.pipeline.PiperFileRunner
  1. In this next step you will need to have made an artimis broker as well as have python installed, we also recommend creating a venv for this project which you can do by following this guide
  2. In the program arguments section include these parameters
    -p "PbjSentencePrinter" (path to program you would like to run)
    -i "org/apache/ctakes/examples/notes/annotated" (path to input folder)
    -a "[Destination of your Artemis Broker]"
    -v "[Destinaiton of your virtual env]"
    -o "output folder"
    step1
Clone this wiki locally