Using the Embedded Micro Integrator¶
WSO2 Integration Studio contains an embedded Micro Integrator instance, which you can use for testing your integration solutions during the development process.
Deploy and run artifacts in the (embedded) server¶
Once you have the integration artifacts packaged in a composite application, you can deploy and run them in the embedded Micro Integrator using a single click.
- Select the composite application in the project explorer.
Click the icon in the menu palette to open the Run As dialog box.
Select Run on Micro Integrator and click OK.
Select the artifacts from the composite application that you want to deploy.
Click Finish. The artifacts will be deployed in the WSO2 Micro Integrator and the server will start. See the startup log in the Console tab:
If you find errors in your mediation sequence, use the debugging features to troubleshoot.
View deployed endpoints in the (embedded) server¶
Use the Runtime Services tab in WSO2 Integration Studio to view the endpoint URLs of the artifacts deployed in the embedded Micro Integrator.
When you deploy tha artifacts and start the embedded Micro Integrator, the Console tab prints the server startup logs and the Runtime Services tab will open as shown below.
If you have closed the tab and you want to open it again, go to Window -> Show View -> Other and select Runtime Services.
Update (embedded) server configs and libraries¶
For some integrations, it is necessary to update the server configurations. For example, if you are integrating with an external broker, you need to update broker connection details and also add the broker's connection JARs to the server's
Click the icon to open the Embedded Micro Integrator Configuration dialog box shown below.
You can also paramterize configurations as environment variables and later inject environment variables to the embedded Micro Integrator.
In the upper section, update the server configuration file (
deployment.toml file). In the lower section, add any requried third-party libraries to the
/lib folder of the server.
Encrypt static (embedded) server secrets¶
If you have secrets in the
deployment.toml file, you can encrypt them using the Cipher Tool.
- Open the Embedded Micro Integrator Configuration dialog box.
- Update the static secrets in the
deployment.tomlfile as explained in encrypting server secrets.
Click Encrypt Secrets.
This will run the Cipher Tool internally and encrypt the secrets. The plain-text values you entered are now replaced with the encrypted values.
Redeploy integration artifacts¶
Hot deployment is enabled in the Micro Integrator by default. This allows you to redeploy artifacts without restarting the server. However, if you have applied changes to the server configurations and libraries, the server will restart.
- Select the composite application that contains your artifacts.
- Click the icon in the menu palette.
Injecting environment variables to embedded Micro Integrator¶
WSO2 Micro Integrator supports environment variables for server configurations as well as synapse configurations (integration artifacts).
To be able to dynamically inject parameters to the embedded Micro Integrator, you must first define the relevant configurations as environment variables. See the following topics for instructions:
Follow the steps given below.
Deploy and run the artifacts in the embedded Micro Integrator.
Note that you need to run the embedded Micro Integrator at least once before proceeding to specify environment variables.
You can now go to Run -> Run Configurations in the upper menu bar of your computer:
In the Run Configurations dialog box that opens, select Micro Integrator Server 1.2.0 that is listed under Generic Server in the navigator:
In the Server tab, select Micro Integrator 1.2.0 from the list if it is not already selected.
Go to the Environment tab and click New to add an environment variable:
Enter the variable name and value as a key-value pair and click OK. In this example, let's use the server offset:
The offset parameter in the
deployment.tomlfile of the embedded Micro Integrator should be specified as follows:
Click Apply to apply the new environment variable.