Skip to content

Get Set Run

Tony Ng edited this page Mar 29, 2015 · 2 revisions

Run on IDE

Now how to run this app:

  1. In Run->Run Configurations, create new Java Application instance whose main class is com.ebay.jetstream.application.JetstreamApplication.
    Project: publisher

  2. Under Arguments tab, specify management port, app name, app config version for the app as follows in Program arguments: -n <appname> -cv <configversion> –p <management port> for example -p 9999 -n publisher -cv 1.0.

  3. set vm arguments to -server -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -Xmn50m -Xmx1200m

  4. Under Environment tab, setup new

  • Variable: JETSTREAM_HOME
  • Value: buildsrc (This is the parent directory of JetStreamConf)

Follow the 4 steps for both the projects. Run both the apps on different port number in step2.

Run Subscriber first and then Publisher. This is to avoid the published events if the publisher is started before.

Run it on docker

The jetstreamdemo have been dockerized, and it is super easy to run it on docker.

  1. cd to jetstreamdemo
  2. mvn clean install
  3. sudo docker build -t jetstreamdemo/publisher publisher
  4. sudo docker build -t jetstreamdemo/subscriber subscriber
  5. sudo docker run -d --name zkserver -t "pulsar/zookeeper"
  6. sudo docker run -d -p 0.0.0.0:7001:9999 --link zkserver:zkserver -t "jetstreamdemo/subscriber"
  7. sudo docker run -d -p 0.0.0.0:7002:9999 --link zkserver:zkserver -t "jetstreamdemo/publisher"
  • pulsar/zookeeper is a docker image for zookeeper.

Next: Verify App is Running

Clone this wiki locally