Search…
IntelliJ
Harness the power of Velocity at the tip of your fingers using your favorite IDEs
Velocity provides an extension for IntelliJ that allows you to develop, debug and test code on a remote environment directly from the IntelliJ IDE.
The extension creates a new 'Run Configuration' in your project.
Running your local code with dependencies to the remote environment is done by using the Velocity 'Run Configuration'. It will connect your local machine to the remote environment as the first step, and then launch your "real" run configuration that spins up your local process.

Installing the IntelliJ Extension

The extension is compatible with IntelliJ 2020.1 and above
  1. 1.
    Contact Velocity to get the IntelliJ extension
  2. 2.
    Open IntelliJ
  3. 3.
    Open the IntelliJ menu and click preferences
Navigate to > Plugins > ⚙️ > Install Plugin from Disk and select the plugin file. This will install your plugin and make it appear in the Installed tab.
Choose Install Plugin from Disk on the right-hand side

Configuring the IntelliJ Extension

To configure the IntelliJ extension you need to define a new 'Run Configuration' for your project.
  1. 1.
    Open the 'Edit Configuration' dialog by clicking Run > Edit Configurations,or by clicking the triangle on your existing project's 'run configuration' definition.
2. Click + to add the new Velocity configuration type.
3. Edit the configuration:
  • Specify the name of the new Velocity Run Configuration
  • Specify the name of your existing Run Configuration Tip: If you don't remember the name of the existing run configuration, you can use the list on the left to refresh your memory.
  • Specify the name of the Velocity service that you want to develop
  • For detailed output messages you can enable the Verbose output.

Developing and Debugging using the IntelliJ extension

Once the Run configuration is set up properly, it should appear in your main project window.

Before running your code:

The extension assumes that a Velocity environment has already been set up and that a Velocity Portal is running in the background. If this is not the case, follow the steps below:
  • Open the IntelliJ terminal window and create a new environment using the env create command. Reference veloctl env create
  • Open another IntelliJ terminal window and start a portal that will manage the tunnels to the remote environment Reference veloctl env portal

Running your code connected to the remote environment:

In order to run your code connected to the remote environment, simply select the Velocity Run Configuration you added and click the 'Run' or 'Debug' icons.
As you run your code or debug it using the Velocity Run Configuration, the following steps will occur:
  1. 1.
    Velocity will run veloctl env develop --attach command and create a tunnel from your local machine to the dependencies running in the remote cluster.
  2. 2.
    Your original run configuration will be triggered with injected environment variables that connect your service to the remove environment.

Closing the opened tunnels

When you finish your development session and want to clean up all opened tunnels, simply go back to the Terminal window that is running the Portal, and terminate it by hitting CTRL+C.