When a WSO2 product starts, it starts all components, features and related artifacts bundled with it. Multi-profile support allows you to run the product on a selected profile so that only the features specific to that profile along with common features start up with the server.
Tip | |||||
---|---|---|---|---|---|
Starting a product on a preferred profile only blocks/allows the relevant OSGI bundles. As a result, even if you start the server on a profile such as the
|
Table of Contents |
---|
API-M Profiles
...
Run the
<PRODUCT_HOME>/bin/profileSetup.sh
script or<PRODUCT_HOME>/bin/profileSetup.bat
script based on your operating system, with the profile flag.Localtabgroup Localtab title Sample commands Code Block sh <PRODUCT_HOME>/bin/profileSetup.sh -Dprofile=<preferred-profile>
Localtab title Example Code Block title Starting the Publisher profile sh <PRODUCT_HOME>/bin/profileSetup.sh -Dprofile=api-publisher
Start the server with the specified profile. A sample command is shown below.
The pack in place is updated after the initial optimization, and the product pack would have fetched irrelevant files for this profile. The
--optimize
option is used to optimize the pack again.Configuration optimization is one of the steps in profile optimization process. This replaces the
deployment.toml
file with a pre-configured profile-specific TOML file that exists in the pack. If required, you can skip this step from the profile optimization process via passing the additional--skipConfigOptimization
option. This prevents the existingdeployment.toml
file in the pack from being overridden.Localtabgroup Localtab title Sample commands Code Block sh <PRODUCT_HOME>/bin/wso2server.sh -Dprofile=<preferred-profile> --optimize --skipConfigOptimization
Localtab title Example Code Block title Starting the Publisher profile sh <PRODUCT_HOME>/bin/wso2server.sh -Dprofile=api-publisher --optimize --skipConfigOptimization
Method 2 - Optimizing while starting the server
...