Step 14 of 21 · 5 minutes

Different Tracks

The Scenario

PayPal and Stripe require API credentials that the security team mandates must only exist on dedicated, hardened servers. Internal JobRunr Finance transfers don't need these keys and can run anywhere.

We need to ensure external payments only run on servers with the right credentials.

The Challenge

How do we ensure external payments only run on servers with the right credentials?

The Solution

Use Server Tags to match jobs with capable servers:


// Tag the job based on platform
jobScheduler.create(aJob()
    .withServerTag(payment.getPlatform().getServerTag())
    .withDetails(() -> processPayment(payment)));

// In application.properties (on dedicated servers only)
jobrunr.background-job-server.tags=external

Start a dedicated server with jobrunr.background-job-server.tags=external to process PayPal and Stripe payments securely!

Read the documentation →

Try It Yourself

  1. Create payments for all three platforms
  2. JobRunr Finance payments process immediately on any server
  3. PayPal/Stripe payments wait until you start the external server:

    ./gradlew :demo-solution:bootRun --args='--server.port=8081 --jobrunr.dashboard.enabled=false --jobrunr.background-job-server.tags=external'
You need to log in to perform write operations. You can still view the code solution and dashboard.
Loading code...