Usage of deployment.toml in wso2 apim 3.0.0 - wso2

I want to deploy a gateway-worker profile for WSO2 APIM 3.0.0. As i understand, the new deployment.toml file is used to override all configuration files when the instance is started.
Is the shared DB required for a deployment of a gateway instance only, because toml overidding failed if I remove this database ? I was thinking that gateway doesn't required any database.
Why this toml file doesn't remove all not necessary datasources in master-datasources.xml, all datasources are still active with h2 even if they are not describe in the toml file ?
Thanks.

shared DB is required for the gateway in tenancy mode. Hence it is a required data source.
Default APIM distribution required both AM DB and Shared DB, hence only those data sources are defined in the TOML file. In profiles, some data sources can be removed. In order to configure the profile, you need to run the profile optimization tool[1]. Optimization tool will generate profile-specific TOML configuration with minimum required configuration.
[1] https://apim.docs.wso2.com/en/latest/SetupAndInstall/DeployingWSO2APIManager/DistributedDeployment/product-profiles/

Related

Configuring the synapse properties file in wso2

How to configure the wso2/repository/conf/synapse.properties files in wso2? I need to change the synapse.global_timeout_interval value but updates to the synapse.properties seems to be overridden when the server restart.
Assuming you are using API manager product and a version that use deployment.toml for configurations, you can add following config in wso2/repository/conf/deployment.toml.
[synapse_properties]
"synapse.global_timeout_interval"=value

WSO2 API Manager 4.1.0 - Unable to update api-manager.xml

Downloaded WSO2 API Manager 4.1.0 Zip Archive
Navigated to APIM\wso2am-4.1.0\wso2am-4.1.0\repository\conf\api-manager.xml
Updated the api-manager.xml for JWTConfiguration and set EnableJWTGeneration to
true
save the api-manager.xml changes and restarted the server.
after restarting the server the api-manager.xml changes are reverting back to old values
false
Why changes are not reflecting in api-manager.xml?
Help us how to update api-manager.xml
Do not change xml configuration files directly, you should be changing deployment.toml instead.
Complete list of options can be found here
Read more about this behaviuor at Understanding the new configuration model
Edit APIM\wso2am-4.1.0\wso2am-4.1.0\repository\conf\deployment.toml
remove '#' before
[apim.jwt]
enable = true
then restart APIM

How i can change the User-Agent Header in WSO2 API Manager

WSO2 APIM has a default User-Agent header which is:
Synapse-PT-HttpComponents-NIO
I want to change it to something else, so i have added header mediation from the publisher run time configuration but no luck, also i tried to add this line http.user.agent.preserve=true in passthru-http.properties as many people said but whenever i restart the server it is removed from the file.
How I can accomplish it ?
I am using wso2am-3.2.0
In APIM 3.2.0, we use deployment.toml file to add/modify configurations. If you edit the configuration files directly, it will be overridden by the configs in the deployment.toml during server startup. Try adding the below values in deployment.toml found inside <APIM_HOME>/repository/conf/
[passthru_http]
'http.user.agent.preserve'=true

Using placeholders in WSO2 DSS dbs files for DB connection params

Is it possible to use placeholders in WSO2 DSS db connection params - e.g. ${prod.db.url} and replace them in runtime from Registry?
Thanks.
The datasource connection is checked and established in the dataservice deployment time. Therefore, you have to provide the datasource configurations such as driver class name, connection url. etc. at the deployment time.
Since the datasource configurations like db url, driver name, user name, password is needed during deployment stage, its not possible to refer the same from registry.
I assume your requirement comes from the need to manage different environments, to achieve the same, have the option to create datasources at server level, called Carbon_Datasources.
These datasources can be referred from .dbs file like the below one. In the below example, serviceDS is the datasource configured.
<config id="rs">
<property name="carbon_datasource_name">serviceDS</property>
</config>
<query id="deliveryService" useConfig="rs">
Refer here for adding different types of datasources and here for managing the same.

WSO2 identity server external JDBC store

I want to use a external JDBC store as default store instead of the default LDAP store. Followed the documentation in this link.
http://docs.wso2.org/wiki/display/IS400/Configuring+an+External+JDBC+User+Store
Getting the following exception Appreciate any help.
An unknown exception occurred while starting LDAP server.java.lang.NullPointerException: Name is null
You can configure WSO2 IS 4.0.0 with an external JDBC users store.The problem is due to an issue with the instructions in the documentation(1) as some configuration steps are missing there.I have created the jira [DOCUMENTATION-17] to track this doc issue.
Please follow below steps to connect IS 4.0.0 with external jdbc users-store.
1) Change the UserStoreManager class to JDBCUserStoreManager from user-mgt.xml [IS_Home/repository/conf] and add the related database connection property to it as mentioned in (1)
2) Add 'passwordHashMethod' propert within JDBCUserStoreManager and set the value to 'SHA' or 'PLAIN_TEXT' in {IS_HOME}/repository/conf/user-mgt.xml.
Eg: <Property name="passwordHashMethod">SHA</Property>
3) Set value of the 'MultiTenantRealmConfigBuilder' property to 'org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder' in {IS_HOME}/repository/conf/user-mgt.xml.
Eg: <Property name="MultiTenantRealmConfigBuilder">org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder</Property>
4) Enable JDBCTenantManager in tenant-mgt.xml and comment out the config section for CommonHybridLDAPTenantManager.
Once you did above configurations,you'll able to configure WSO2 Identity Server to an external jdbc user store successfully.
(1) http://docs.wso2.org/wiki/display/IS400/Configuring+an+External+JDBC+User+Store
I was able to resolve this.
Start with a clean install of WSO2 IS 4.0.0 if possible.
Apart from following the directions given in the documentation to setup a JDBC datastore; you need to do the following :
Enable JDBCTenantManager in tenant-mgt.xml and comment out CommonHybridLDAPTenantManager2
Set the enable property to false for EmbeddedLDAP in embedded-ldap.xml