User manual

Camel CLI - Dev Services

The Camel CLI can start and manage local infrastructure services (databases, message brokers, etc.) for development and testing — similar to Spring Boot Dev Services and Quarkus Dev Services. Services are powered by Apache Camel test-infra and run in containers (Docker or Podman).

The CLI commands use camel infra (short for infrastructure). In the documentation we call this feature Dev Services to align with Spring Boot and Quarkus terminology — they mean the same thing.

Listing available services

camel infra list
ALIAS                   IMPLEMENTATION
 ignite
 azure                   storage-queue
 openldap
 event-bridge
 xmpp
 kinesis
 redis
 ...

Running a service

camel infra run $SERVICE

Some services offer multiple implementations — pass the implementation name as a second argument:

camel infra run kafka redpanda

Once running, the service prints its connection details as JSON:

$ camel infra run ftp

Starting service ftp
{
  "getPort" : 52472,
  "getFtpRootDir" : "file://path/to/current/directory/target/ftp/..."
}
$ camel infra run kafka redpanda

Starting service kafka with implementation redpanda
{
  "getBootstrapServers" : "localhost:32771"
}

Stopping a service

camel infra stop arangodb

Restarting a service

Stops a running service and starts it again. This is handy after changing configuration or to recover a service into a clean state:

camel infra restart kafka

Use --background to restart the service detached from the terminal:

camel infra restart kafka --background

Listing running services

$ camel infra ps
  PID   ALIAS      IMPLEMENTATION  UI  DESCRIPTION                                        SERVICE_DATA
 45211  arangodb                       ArangoDB is a multi-model database for high-pe...  {"getServiceAddress":"http:/...

There is one row per running instance, so starting the same service twice lists both processes, each with its own PID and connection details:

$ camel infra ps
  PID   ALIAS  IMPLEMENTATION  UI  DESCRIPTION                                   SERVICE_DATA
 45244  ftp                        FTP is a standard communication protocol ...  {"port":21,"host":"localhost"...
 45262  ftp                        FTP is a standard communication protocol ...  {"port":2121,"host":"localhos...

Pass a service name to list only its instances, and --json to get the full connection details of each instance as machine-readable JSON:

camel infra ps ftp
camel infra ps ftp --json

Services whose process is no longer running are not listed, and their leftover files are removed.

Getting service details

Retrieve connection details for a running service:

$ camel infra get openldap
{
  "getPort" : 32774,
  "getSslPort" : 32775,
  "getHost" : "localhost"
}

Viewing service logs

Tail logs from all running services:

camel infra log

Or from a specific service:

camel infra log openldap

Every running instance of the service is tailed. When more than one instance is running, the log lines are prefixed with <alias>-<pid> instead of <alias> so they can be told apart.

See Also

The Sending messages to infrastructure services feature in the Development Tools page can send messages directly to services started with camel infra run.