Skip to content

Dependencies (local, cloud or mock)

A dependency is a core that a micro calls over REST. When you launch a scenario, for each dependency you choose how to resolve it: MicroLab rewrites the URL that micro uses to call, without touching the repo’s code.

OptionWhat it doesWhen to use it
localPoints to the peer launched in the same scenarioTest the real communication between your micros
cloudPoints to the DEV environment (may require corporate VPN)Use a core you don’t want to launch
mockPoints to MicroLab’s mock serverWork without VPN or launching the core

For local resolution to work, the target core has to be part of the scenario. If it isn’t, MicroLab warns you.

Each dependency declares which configuration property to rewrite (for example app.rest-client.pagos.url). At startup, MicroLab computes the effective URL according to the chosen resolution and injects it as configuration, with the correct perspective (host or container) depending on where the client runs. The micro’s repo is not modified.

External dependencies (gateways, authentication) are fixed to cloud. If any dependency is resolved against the cloud, the app shows the notice that a connection (VPN) to the corporate network is needed, and the cloud credentials (${creds.x}) must be defined.

In the Scenarios section, the Dependencies panel has a local/cloud/mock selector per dependency. You can change it:

  • Before launching: it is saved as part of the scenario.
  • With the scenario running: many resolutions are applied hot, without a restart; others restart the affected micro. The app tells you which of the two happened.

From the CLI, the equivalent is microlab set-resolution <dep> <local|dev|mock> (or --resolve at startup, as a one-off override for that invocation).

When a dependency is resolved as mock, MicroLab serves the responses you have defined for that service in the Mocks section. You don’t need to launch anything to edit them: the mock catalog lives on disk and is served with hot reload.