Skip to main content

Posts

Showing posts from August, 2016

Managing GREG publisher menu based on user permissions

The default behaviour of GREG is to show all the menu options related to each asset. Even though you can enable/disable the asset type based on the user permissions you cannot manage the different options of the individual asset. Prerequisite In order to try this use case first you would need to download the Governance Registry Product. You can download it here [1] Overview For each asset the GREG publisher would show the following menu. This is the menu shows for a esdl based soap service. If we have a requirement where we need to control the users who are able to create Associations there is no direct way in which this is supported. In other words there is no way of managing these menu items based on role permissions. But the good news is this can be accomplished by doing a few customizations in the GREG. Below steps will guide you through how you can allow/disable the Association tab based on user permission with GREG. Let's get started 1) First let's crea

Processing large payloads with the esb script mediator iteratively

Overview WSO2 ESB uses Rhino engine to execute JavaScripts. Rhino engine converts the script to a method inside a Java class. Therefore, when processing large JSON data volumes, the code length must be less than 65536 characters, since the Script mediator converts the payload into a Java object. However, you can use the following alternative options to process large JSON data volumes. The script mediator which is used in ESB is powered by the Rhino engine. Therefore, when processing large JSON data volumes, the code length must be less than 65536 characters which is a limitation in the script mediator being used in the esb versions less than 5.0.0. In ESB 5.0.0 there is a higher capability to process larger payloads using script mediator. In order to process such large payloads we can follow the below two approaches. 1. Replace the javascript tranformation logic using java code by writing a custom mediator. [1] 2. Break down the large payload and execute them as sections using

Adding custom error messages within a custom sequence in API Manager

Overview You can add custom error messages for an API by following the post [1] but when the error is thrown inside the custom in or out sequence we add as the mediation extension this custom error sequence which we specify for the API does not get invoked. Therefore we need to specify the error sequence seperately for the custom sequence. This blog will explain how to carry out this use case. Let's get started To demonstrate this I will be using the call mediator inside the custom sequence. Since when an invalid endpoint is invoked with the call mediator it would generate an error in the API Manager which would be received inside our custom sequence. 1) You can follow my previous tutorial [2] to get a better understanding and configurations needed to use the call mediator using wso2 api manager 1.10.0. Create the API as mentioned in the sequence above and subscribe and generate keys for the API in the store. 2) Now what we are going to do is, we are going to provide an

Invoking external endpoints using the call mediator in wso2 api manager

Introduction In API Manager if you need to do any service chaining use cases the call mediator comes in handy. If you need to use the response received by invoking one endpoint and then use it to invoke another endpoint you can use the call mediator in API Manager. The call mediator behaves in a synchronous manner. Hence, mediation pauses after the service invocation and resumes from the next mediator in the sequence when the response is received. You can read more about the call mediator in the wso2 esb documentation [1] . In api manager 1.10.0 the call mediator works in the blocking mode. Prerequisite Before we can use the call mediator in API Manager 1.10.0 we need to make the following changes to some configs. We need to comment the jms transport sender in axis2_blocking_client.xml found in the location APIM_HOME/repository/conf/axis2. This will resolve the jms sender initialization issues.   <!--transportSender name="jms"                      class