<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jenananthan on Medium]]></title>
        <description><![CDATA[Stories by Jenananthan on Medium]]></description>
        <link>https://medium.com/@Jenananthan?source=rss-4a2afb23d4d6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Awz1EhtaB_f3b4wqsyF63Q.jpeg</url>
            <title>Stories by Jenananthan on Medium</title>
            <link>https://medium.com/@Jenananthan?source=rss-4a2afb23d4d6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 17:31:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Jenananthan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ActiveMQ Message Group Feature with WSO2 Micro Integrator]]></title>
            <link>https://medium.com/@Jenananthan/activemq-message-group-feature-with-wso2-micro-integrator-b6e9b22bc8e1?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6e9b22bc8e1</guid>
            <category><![CDATA[activemq]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 10:53:47 GMT</pubDate>
            <atom:updated>2023-02-24T10:53:47.934Z</atom:updated>
            <content:encoded><![CDATA[<p>A guaranteed delivery messaging system ensures the delivery of the message from sender to receiver even when receiver is offline. WSO2 Micro Integrator can be used to build a guaranteed delivery messaging system along with a message broker.</p><p>Checkout the full article <a href="https://www.yenlo.com/blogs/activemq-message-group-feature-with-wso2-micro-integrator/">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6e9b22bc8e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WSO2 EI Publish message to multiple ActiveMQ queues in single operation]]></title>
            <link>https://medium.com/@Jenananthan/wso2-ei-publish-message-to-multiple-activemq-queues-in-single-operation-48fc71736555?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/48fc71736555</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[activemq]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 10:51:32 GMT</pubDate>
            <atom:updated>2023-02-24T10:51:32.879Z</atom:updated>
            <content:encoded><![CDATA[<p>ActiveMQ message broker provides a feature called “Composite Destination” [1]. This feature allows to publish the same message to multiple physical ActiveMQ queues in single operation. In this blog post, we will evaluate this feature using WSO2 EI as message producer and consumer.</p><p>Checkout the full article <a href="https://www.yenlo.com/blogs/wso2-ei-publish-message-to-multiple-activemq-queues-in-single-operation/">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48fc71736555" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Content based routing with ActiveMQ and WSO2 EI]]></title>
            <link>https://medium.com/@Jenananthan/content-based-routing-with-activemq-and-wso2-ei-cce983a78f8b?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/cce983a78f8b</guid>
            <category><![CDATA[wso2-ei]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[activemq]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 10:49:45 GMT</pubDate>
            <atom:updated>2023-02-24T10:49:45.038Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog post, we will discuss how we can achieve the content-based routing with ActiveMQ’s “Selectors” feature and avoid processing overhead in consumer end. We will show how to configure the WSO2 JMS proxy to subscribe to ActiveMQ with selector/filtering criteria.</p><p>Checkout the full article <a href="https://www.yenlo.com/blogs/content-based-routing-with-activemq-and-wso2-ei/">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cce983a78f8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[WSO2 APIM 4 Micro Integrator Profile] Updating the Key name in JSON payload]]></title>
            <link>https://medium.com/@Jenananthan/wso2-apim-4-micro-integrator-profile-updating-the-key-name-in-json-payload-1aed8f9b8f90?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1aed8f9b8f90</guid>
            <category><![CDATA[wso2-mi]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Wed, 15 Dec 2021 06:37:32 GMT</pubDate>
            <atom:updated>2021-12-15T06:37:32.446Z</atom:updated>
            <content:encoded><![CDATA[<p>In any integration scenario, if you want to update only the key name of JSON elements, you no longer need to write complex transformations logics. WSO2 has provided support in Enrich mediator to simply achieve this.</p><p>Let&#39;s dive into the example and see how it works,</p><p><strong>Example :</strong> Let&#39;s say we have below request JSON payload and we want to change the $.store.book[*].category into $.store.book[*].type. I.e All the key name “category” of book objects should be updated with new key name called “type”</p><p>$.store.book[*].category-&gt; $.store.book[*].type</p><p><strong><em>Request payload :</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*voEA96VjoXFf9om3mEDbew.png" /></figure><p>Let’s implement a Proxy Service to update the Key name.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;proxy name=&quot;JSONPlayGroundProxy5&quot; startOnLoad=&quot;true&quot; transports=&quot;http https&quot; xmlns=&quot;<a href="http://ws.apache.org/ns/synapse">http://ws.apache.org/ns/synapse</a>&quot;&gt;<br>    &lt;target&gt;<br>        &lt;inSequence&gt;<br>            &lt;log level=&quot;custom&quot;&gt;<br>                &lt;property expression=&quot;json-eval($)&quot; name=&quot;LOG##PayloadBeforeEnrich&quot;/&gt;<br>            &lt;/log&gt;<br>           <strong> &lt;enrich&gt;<br>                &lt;source clone=&quot;false&quot; type=&quot;inline&quot;&gt;type&lt;/source&gt;<br>                &lt;target xpath=&quot;json-eval($.store.book[*].category)&quot; action=&quot;replace&quot; type=&quot;key&quot;/&gt;<br>            &lt;/enrich&gt;</strong><br>            &lt;log level=&quot;custom&quot;&gt;<br>                &lt;property expression=&quot;json-eval($)&quot; name=&quot;LOG##PayloadAfterEnrich&quot;/&gt;<br>            &lt;/log&gt;<br>             &lt;respond/&gt;<br>        &lt;/inSequence&gt;<br>        &lt;outSequence/&gt;<br>        &lt;faultSequence/&gt;<br>    &lt;/target&gt;<br>&lt;/proxy&gt;</pre><blockquote>Here, enrich mediator is used to update the key name. Source element of mediator uses the <strong>type=”inline” </strong>and the new key name is provided as inline value(in our case it is ‘type’). <br>Target element of the mediator uses the <strong>type=”key” </strong>to specify that we need to update the key name. And JSON path of the key which should be updated with new value is provided in xpath attribute.</blockquote><p><strong><em>Result :</em></strong></p><p><em>Key name “category” in all the book objects are updated with new key name “type”<br></em>i.e. $.store.book[*].category-&gt; $.store.book[*].type</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7HvKJh-sBsXw0GBY7xx94Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1aed8f9b8f90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[WSO2 APIM 4 Micro Integrator Profile] Remove elements from JSON payload]]></title>
            <link>https://medium.com/@Jenananthan/wso2-apim-4-micro-integrator-profile-remove-elements-from-json-payload-c039100ed88e?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c039100ed88e</guid>
            <category><![CDATA[wso2-ei]]></category>
            <category><![CDATA[wso2-mi]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2am]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Wed, 15 Dec 2021 05:50:28 GMT</pubDate>
            <atom:updated>2021-12-15T05:50:28.776Z</atom:updated>
            <content:encoded><![CDATA[<p>In most integration scenarios you would have encountered the requirement to remove only a certain element or elements from a JSON payload before sending it to a destination location.</p><p>The solution to this requirement can be achieved by using Transformer mediators such as script, XSLT, data mapper, and payload factory. Here you will have to write some transformation logic to remove the elements and preserve other elements.</p><blockquote>To make the life easy, WSO2 has introduced out of the box support in <strong>Enrich Mediator</strong> to remove elements from a JSON payload by specifying JSON path/JSON paths of the elements which should be removed.</blockquote><p>Let&#39;s dive into the examples and see how this works,</p><p><strong>Example: </strong>Remove Json element/Objects by specifying the JSON path/paths</p><p>Let&#39;s say we have the below request JSON payload and we need to remove the below elements from the payload and get the result back(No transformation needed for other elements).</p><p><em>Request payload :</em></p><pre>{&quot;store&quot;: {{ &quot;store&quot;: { &quot;book&quot;: [ { &quot;category&quot;: &quot;reference&quot;, &quot;author&quot;: &quot;Nigel Rees&quot;, &quot;title&quot;: &quot;Sayings of the Century&quot;, &quot;price&quot;: 8.95 }, { &quot;category&quot;: &quot;fiction&quot;, &quot;author&quot;: &quot;Herman Melville&quot;, &quot;title&quot;: &quot;Moby Dick&quot;, &quot;isbn&quot;: &quot;0-553-21311-3&quot;, &quot;price&quot;: 8.99 }, { &quot;category&quot;: &quot;fiction&quot;, &quot;author&quot;: &quot;J.R.R. Tolkien&quot;, &quot;title&quot;: &quot;The Lord of the Rings&quot;, &quot;isbn&quot;: &quot;0-395-19395-8&quot;, &quot;price&quot;: 22.99 } ], &quot;bicycle&quot;: { &quot;color&quot;: &quot;red&quot;, &quot;price&quot;: 19.95 } }, &quot;expensive&quot;: 10 }</pre><p><em>Elements to remove:</em></p><p>- $.store.bicycle<br>- $.expensive<br>- $.store.book[?(@.price &gt; 10)] -&gt;(All books objects which has price value)</p><p>Let&#39;s implement a Proxy Service to process the request JSON.</p><pre>&lt;proxy name=&quot;JSONPlayGroundProxy5&quot; startOnLoad=&quot;true&quot; transports=&quot;http https&quot; xmlns=&quot;<a href="http://ws.apache.org/ns/synapse">http://ws.apache.org/ns/synapse</a>&quot;&gt;<br>    &lt;target&gt;<br>        &lt;inSequence&gt;<br>            &lt;log level=&quot;custom&quot;&gt;<br>                &lt;property expression=&quot;json-eval($)&quot; name=&quot;LOG##PayloadBeforeEnrich&quot;/&gt;<br>            &lt;/log&gt;</pre><pre>           <strong> &lt;enrich&gt;<br>                &lt;source clone=&quot;false&quot; xpath=&quot;json-eval($.store.bicycle,$.expensive,$.store.book[?(@.price &gt; 10)])&quot;/&gt;<br>                &lt;target type=&quot;body&quot; action=&quot;remove&quot;/&gt;<br>            &lt;/enrich&gt;</strong><br>            &lt;log level=&quot;custom&quot;&gt;<br>                &lt;property expression=&quot;json-eval($)&quot; name=&quot;LOG##PayloadAfterEnrich1&quot;/&gt;<br>            &lt;/log&gt;<br>             &lt;respond/&gt;<br>        &lt;/inSequence&gt;<br>        &lt;outSequence/&gt;<br>        &lt;faultSequence/&gt;<br>    &lt;/target&gt;<br>&lt;/proxy&gt;</pre><p>Here in this Proxy, the target element of Enrich mediator is used with <strong>action=” remove” </strong>to delete the elements which are specified using JSON paths in the source element. Multiple JSON paths can be provided as common separated values</p><pre>&lt;enrich&gt;<br>    &lt;source clone=&quot;false&quot; <strong>xpath=&quot;json-eval($.store.bicycle,$.expensive,$.store.book[?(@.price &gt; 10)])&quot;</strong>/&gt;<br>    &lt;target type=&quot;body&quot; <strong>action=&quot;remove&quot;</strong>/&gt;<br>&lt;/enrich&gt;</pre><p><em>Result :</em></p><p>Once JSON request payload is processed by the Enrich mediator, it has removed the elements specified by the JSON paths from the original payload as shown in the below response JSON</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgeabVJDhx3mT_MHmwpWtA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c039100ed88e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[WSO2 APIM 4 Micro Integrator Profile] Aggregate JSON responses into Array/Object]]></title>
            <link>https://medium.com/@Jenananthan/wso2-apim-4-micro-integrator-profile-aggregate-json-responses-into-array-object-5b11a0ccd6ab?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b11a0ccd6ab</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2-mi]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <category><![CDATA[wso2am]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Fri, 10 Dec 2021 12:18:29 GMT</pubDate>
            <atom:updated>2021-12-10T12:18:29.965Z</atom:updated>
            <content:encoded><![CDATA[<p>Micro Integrator’s Aggregate mediator can be used to implement Aggregator EIP pattern. Aggregate mediator can be used with Clone or Iterator mediator to collect the responses coming from a backend service.</p><p>Aggregate mediator supports both XML and JSON messages. In this post, we will try out the Aggregate mediator to aggregate small JSON messages coming from a backend service into a whole message.</p><p>When we aggregate the JSON messages we could either aggregate them into a JSON Array or JSON Object. This behavior is controlled by the attribute <strong>aggregateElementType </strong>in Aggregate mediator</p><p>If <strong>aggregateElementType=”root” -&gt; </strong>Messages will be aggregated into JSON Array</p><p>If <strong>aggregateElementType=”child”-&gt;</strong>Messages will be aggregated into JSON Object and all the key pair values of JSON messages will be placed inside this object</p><p>Let&#39;s understand this behavior with examples.</p><p>Let&#39;s say we have a Proxy that accepts the below JSON request and call a MockService backend for each employees record using Iterator mediator. MockService will return below mock response to each call and Proxy service should aggregate the responses into a whole message.</p><p>In the first example, we will aggregate the responses into a JSON object and in the second example, we will aggregate the responses into JSON Array.</p><p>Request to Proxy:</p><pre>{ &quot;employees&quot;: [{ &quot;name&quot;: &quot;John&quot;, &quot;email&quot;: &quot;john@gmail.com&quot; }, { &quot;name&quot;: &quot;Peter&quot;, &quot;email&quot;: &quot;peter@gmail.com&quot; }, { &quot;name&quot;: &quot;Aiden&quot;, &quot;email&quot;: &quot;aiden@gmail.com&quot; } ] }</pre><p>Response from MockService:</p><pre>{&quot;Status&quot;:&quot;OK&quot;,&quot;Id”:&quot;0001&quot;}</pre><p>Mock Service :</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;proxy name=&quot;JSONMockService1&quot; startOnLoad=&quot;true&quot; transports=&quot;http https&quot;<br> xmlns=&quot;<a href="http://ws.apache.org/ns/synapse">http://ws.apache.org/ns/synapse</a>&quot;&gt;<br> &lt;target&gt;<br>  &lt;inSequence&gt;<br>   &lt;log level=&quot;custom&quot;&gt;<br>    &lt;property expression=&quot;json-eval($.)&quot; name=&quot;##RequestInMockService&quot;/&gt;<br>   &lt;/log&gt;<br>   &lt;payloadFactory media-type=&quot;json&quot;&gt;<br>    &lt;format&gt;{&quot;Status&quot;:&quot;OK&quot;,&quot;Id&quot;:&quot;0001&quot;}&lt;/format&gt;<br>    &lt;args/&gt;<br>   &lt;/payloadFactory&gt;<br>   &lt;property name=&quot;messageType&quot; scope=&quot;axis2&quot; type=&quot;STRING&quot; value=&quot;application/json&quot;/&gt;<br>   &lt;respond/&gt;<br>  &lt;/inSequence&gt;<br>  &lt;outSequence/&gt;<br>  &lt;faultSequence/&gt;<br> &lt;/target&gt;<br>&lt;/proxy&gt;</pre><p><strong>Example 1</strong></p><p>Aggregate JSON responses to a <strong>JSON object. (aggregateElementType=”child”)</strong></p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;proxy name=&quot;JSONPlayGroundProxy2&quot; startOnLoad=&quot;true&quot; transports=&quot;http https&quot;<br> xmlns=&quot;<a href="http://ws.apache.org/ns/synapse">http://ws.apache.org/ns/synapse</a>&quot;&gt;<br> &lt;target&gt;<br>  &lt;inSequence&gt;<br>   &lt;iterate id=&quot;0001&quot; expression=&quot;json-eval($.employees)&quot; sequential=&quot;true&quot;&gt;<br>    &lt;target&gt;<br>     &lt;sequence&gt;<br>      &lt;call&gt;<br>       &lt;endpoint&gt;<br>        &lt;address uri=&quot;<a href="https://localhost:8253/services/JSONMockService1">https://localhost:8253/services/JSONMockService1</a>&quot; /&gt;<br>       &lt;/endpoint&gt;<br>      &lt;/call&gt;<br>      &lt;log level=&quot;custom&quot;&gt;<br>       &lt;property expression=&quot;json-eval($.)&quot; name=&quot;##ResponseInSideIterator&quot;/&gt;<br>      &lt;/log&gt;<br>     &lt;/sequence&gt;<br>    &lt;/target&gt;<br>   &lt;/iterate&gt;<br>   &lt;log level=&quot;custom&quot;&gt;<br>    &lt;property expression=&quot;json-eval($.)&quot; name=&quot;##ResponseAfterInterator&quot;/&gt;<br>   &lt;/log&gt;<br>   &lt;aggregate id=&quot;0001&quot;&gt;<br>    &lt;completeCondition&gt;<br>     &lt;messageCount min=&quot;-1&quot; max=&quot;-1&quot;/&gt;<br>    &lt;/completeCondition&gt;<br>    &lt;onComplete expression=&quot;json-eval($.)&quot; <strong>aggregateElementType=&quot;child&quot;</strong>&gt;<br>     &lt;log level=&quot;custom&quot;&gt;<br>      &lt;property name=&quot;##Aggregated_Message&quot; expression=&quot;json-eval($.)&quot;/&gt;<br>     &lt;/log&gt;<br>     &lt;respond/&gt;<br>    &lt;/onComplete&gt;<br>   &lt;/aggregate&gt;<br>  &lt;/inSequence&gt;<br>  &lt;outSequence/&gt;<br>  &lt;faultSequence/&gt;<br> &lt;/target&gt;<br>&lt;/proxy&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*uLhuwjoFMKj1uFHlTioq-w.png" /></figure><p><strong><em>We can see that responses are aggregated into a JSON object and all key pair values are added to this object</em></strong></p><p>Example 2</p><p>Aggregate JSON responses to a <strong>JSON array<br>(aggregateElementType=”root”)</strong></p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;proxy name=&quot;JSONPlayGroundProxy3&quot; startOnLoad=&quot;true&quot; transports=&quot;http https&quot;<br> xmlns=&quot;<a href="http://ws.apache.org/ns/synapse">http://ws.apache.org/ns/synapse</a>&quot;&gt;<br> &lt;target&gt;<br>  &lt;inSequence&gt;<br>   &lt;iterate id=&quot;0001&quot; expression=&quot;json-eval($.employees)&quot; sequential=&quot;true&quot;&gt;<br>    &lt;target&gt;<br>     &lt;sequence&gt;<br>      &lt;call&gt;<br>       &lt;endpoint&gt;<br>        &lt;address uri=&quot;<a href="https://localhost:8253/services/JSONMockService1">https://localhost:8253/services/JSONMockService1</a>&quot; /&gt;<br>       &lt;/endpoint&gt;<br>      &lt;/call&gt;<br>      &lt;log level=&quot;custom&quot;&gt;<br>       &lt;property expression=&quot;json-eval($.)&quot; name=&quot;##ResponseInSideIterator&quot;/&gt;<br>      &lt;/log&gt;<br>     &lt;/sequence&gt;<br>    &lt;/target&gt;<br>   &lt;/iterate&gt;<br>   &lt;log level=&quot;custom&quot;&gt;<br>    &lt;property expression=&quot;json-eval($.)&quot; name=&quot;##ResponseAfterInterator&quot;/&gt;<br>   &lt;/log&gt;<br>   &lt;aggregate id=&quot;0001&quot;&gt;<br>    &lt;completeCondition&gt;<br>     &lt;messageCount min=&quot;-1&quot; max=&quot;-1&quot;/&gt;<br>    &lt;/completeCondition&gt;<br>    &lt;onComplete expression=&quot;json-eval($.)&quot; <strong>aggregateElementType=&quot;root&quot;</strong>&gt;<br>     &lt;log level=&quot;custom&quot;&gt;<br>      &lt;property name=&quot;##Aggregated_Message&quot; expression=&quot;json-eval($.)&quot;/&gt;<br>     &lt;/log&gt;<br>     &lt;respond/&gt;<br>    &lt;/onComplete&gt;<br>   &lt;/aggregate&gt;<br>  &lt;/inSequence&gt;<br>  &lt;outSequence/&gt;<br>  &lt;faultSequence/&gt;<br> &lt;/target&gt;<br>&lt;/proxy&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*eKHfkL_-XKWKbfWI5IPqNg.png" /></figure><p><strong><em>We can see that responses are aggregated into a JSON Array</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b11a0ccd6ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[WSO2 APIM 4 Micro Integrator Profile] JSON support in Property mediator]]></title>
            <link>https://medium.com/@Jenananthan/wso2-apim-4-micro-integrator-profile-json-support-in-property-mediator-db4565a15628?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/db4565a15628</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Thu, 09 Dec 2021 09:13:01 GMT</pubDate>
            <atom:updated>2021-12-09T09:13:01.854Z</atom:updated>
            <content:encoded><![CDATA[<p>Micro Integrator run time wso2mi-4.0.0 has been released with latest WSO2 APIM 4.0.0 version. Along with release JSON support in property mediator has been improved by introducing new data type “JSON” to property mediator. Now property mediator supports below data types</p><ul><li>STRING</li><li>INTEGER</li><li>BOOLEAN</li><li>DOUBLE</li><li>FLOAT</li><li>LONG</li><li>SHORT</li><li>OM</li><li><strong>JSON</strong></li></ul><p>This blog post will describe how to store JSON payloads in property mediator and executing JSON path against the JSON payload stored</p><p><strong>Example 1 :</strong> Store the JSON payload in the message body to a property</p><pre>&lt;property expression=&quot;json-eval($)&quot; name=&quot;requestPayload&quot; scope=&quot;default&quot; type=&quot;<strong>JSON</strong>&quot;/&gt;</pre><p><strong>Example 2: </strong>Store a static JSON payload in property mediator</p><pre>&lt;property name=&quot;lookup&quot; value=&quot;{&#39;key1&#39;: &#39;value1&#39;, &#39;key2&#39;: &#39;value2&#39;}&quot; type=&quot;<strong>JSON</strong>&quot;/&gt;</pre><p><strong>Example 3 : </strong>Execute JSON path against a JSON payload stored in property mediator</p><p>Let say, “lookup” property has a JSON payload</p><pre>&lt;property name=&quot;lookup&quot; value=&quot;{&#39;key1&#39;: &#39;value1&#39;, &#39;key2&#39;: &#39;value2&#39;}&quot; type=&quot;<strong>JSON</strong>&quot;/&gt;</pre><p>To access the $.key1 of the payload from property, construct the JSON path with property name → &lt;prop-name&gt;.&lt;jsonpath&gt; → $ctx:lookup.key1</p><pre>&lt;property expression=&quot;json-eval(<strong>$ctx:lookup.key1</strong>)&quot; name=&quot;Lookup-Key1&quot;/&gt;</pre><p>Supported property scopes $trp, $axis2, $ctx</p><p><strong>Example 4 </strong>: Execute Dynamic JSON path expression against a JSON payload stored in property mediator</p><pre>&lt;!-- 1. JSON payload stored in property--&gt;<br>&lt;property name=&quot;lookup&quot; value=&quot;{&#39;key1&#39;: &#39;value1&#39;, &#39;key2&#39;: &#39;value2&#39;}&quot; type=&quot;JSON&quot;/&gt;</pre><pre>&lt;!-- 2. JSON path to get the field key1 from stored JSON payload --&gt;<br>&lt;property value=&quot;key1&quot; name=&quot;lookupKey&quot;/&gt;</pre><pre>&lt;!-- 3. Create dynamic JSON path by referring the jsonpath in property &#39;lookupKey&#39;. Add the property name within curly brackets and in runtime this will be resolved to the value of the property --&gt;</pre><pre>&lt;property expression=&quot;json-eval($ctx:lookup.<strong>{$ctx:lookupKey}</strong>)&quot; name=&quot;Lookup-Key1&quot;/&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db4565a15628" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to read CARBON_HOME value in WSO2EI/ESB]]></title>
            <link>https://medium.com/@Jenananthan/how-to-read-carbon-home-value-in-wso2ei-esb-8d29129d2514?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d29129d2514</guid>
            <category><![CDATA[wso2esb]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Mon, 13 Jan 2020 08:37:13 GMT</pubDate>
            <atom:updated>2020-01-13T08:37:13.180Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to read CARBON_HOME value in WSO2 EI/ESB</h3><p>You may come across the scenarios where you need to read CARBON_HOME path in synapse to refer the JKS file or any other configuration files which reside inside the EI/ESB</p><p>CARBON_HOME value is set in “carbon.home” system variable in the server startup. Therefore this can be read using get-property method in system scope as shown below.</p><p>&lt;property name=”CARBON_HOME” expression=”get-property(‘system’, ‘carbon.home’)”/&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d29129d2514" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WSO2 API Manager 3.0.0 — API Product feature]]></title>
            <link>https://medium.com/@Jenananthan/wso2-api-manager-3-0-0-api-product-feature-cd9c524bf0d4?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd9c524bf0d4</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <category><![CDATA[wso2am]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Thu, 07 Nov 2019 05:07:52 GMT</pubDate>
            <atom:updated>2019-11-07T05:07:52.552Z</atom:updated>
            <content:encoded><![CDATA[<h3>WSO2 API Manager 3.0.0 — API Product feature</h3><p>APP developers consume the APIs provided by the API provider to develop the application. Application may consume different resources from different APIs to implement specific functionality. When resources are scattered in different APIs, it is hard to discover the relevant resources(or APIs), at the same time need to manage different API endpoints to consume them.</p><p>As an example, let’s take the use case of e-wallet application development. Ewallet application should provide the following features.</p><ul><li>Link end user’s the bank account to end user’s e-wallet</li><li>Transfer money from bank account to linked e-wallet</li><li>Transfer money from linked e-wallet to bank account</li><li>Unlink the bank account from e-wallet</li></ul><p>There are secured APIs/Services exposed from bank for e-wallet developer to consume and develop the app. But these APIs are coming from different microservices as depicted in the below diagram. API 1 provides the resources to link and unlink an e-wallet and API 2 provides the money transaction from bank account to e-wallet and vice versa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*naXe22_8dhmyrNPjtw9doQ.jpeg" /></figure><p>Now the issue is app developers have to discover above two APIs to implement the app. Also, need to manage two API endpoints in the application side.</p><p>WSO2 APIM 3.0.0 has introduced the API Product feature to eliminate the hassle that app developers face in this kind of situation. API product helps to bundle the mapping resources from different APIs and provide a single interface to app developers as depicted in the below diagram. Now app developer has to just subscribe to the single API product and use the API resources which eventually points to different back ends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*sjPN7RkXMQDh8Bbb4uGwHg.jpeg" /></figure><h4>How to create an API Product.</h4><p>In this section, let’s go see how to create an API product for the above mentioned scenario.</p><ol><li>Login to publisher and Create API 1 (link-ewallet) and Crate API 2 (ewallet-transfer) with respective resources.</li></ol><p><strong>API 1</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7B_ON1gM803ovwtPq0BJ6Q.png" /></figure><p><strong>API 2</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yMOYVMMFyqVpE1LD_geXNg.png" /></figure><p>2. Now go to the <strong>API Product</strong> section in the publisher and create new API Product. Fill the required fields and click next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yMf9LXqLnv7mnBZZ2GrgkA.png" /></figure><p>3. Now the screen will display the available APIs in the left column and the middle column will display the resources available for particular API. This allows us to select the relevant resources from different APIs and add them to API product. Selected resources will be displayed in the right column</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ZOxy4YL8NMeq1GPx7Z-Nw.png" /></figure><p>4. Now click publish. This will create the API product and switch to the next screen, where you can see <strong>configuration</strong> options in the left panel. There you can configure different service plan, authentication mechanism etc.</p><p>This is because API Product also an API artifact which bundles resources from other APIs and expose as a single API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyWQeRANUsle6Z6euvbK3A.png" /></figure><p>5. Now if you go to the developer portal, created API product will appear as an API with resources bundled from other APIs. Now app developer can simply subscribe to this API and consume all the resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gRVMb9NDNpqUPEpQbdcB4Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd9c524bf0d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SoapUI- Mocking REST APIs Part 2]]></title>
            <link>https://medium.com/@Jenananthan/soapui-mocking-rest-apis-part-2-4450fddd9023?source=rss-4a2afb23d4d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4450fddd9023</guid>
            <category><![CDATA[mock-api]]></category>
            <category><![CDATA[mock]]></category>
            <category><![CDATA[soap]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[rest-api]]></category>
            <dc:creator><![CDATA[Jenananthan]]></dc:creator>
            <pubDate>Fri, 06 Sep 2019 11:26:08 GMT</pubDate>
            <atom:updated>2019-09-06T11:28:32.456Z</atom:updated>
            <content:encoded><![CDATA[<p>In the previous post(<a href="https://medium.com/@Jenananthan/soapui-mocking-rest-apis-part-1-1e69eaf67beb">SoapUI- Mocking REST APIs Part 1</a>), we looked in to how to quickly setup a mock server for REST API using OpenAPI specification in SoapUI. This post will explain how to mock the responses of each resources of the API.</p><p>We will take the <strong>POST /store/order </strong>resource as example and implement the mock responses for that. This is the Request and Responses defined for this resource in OpenAPI specification</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*4lVztKmuIImE-AGd0GOqvA.png" /></figure><p>As you can see, this resource can return two responses : HTTP 200 or HTTP 400. HTTP 200 has XML payload in response.</p><h4><strong>Setup HTTP 200 Mock Response</strong></h4><ol><li>Open mock service window and find the resource <strong>/v2/store/order</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*bapUrdNIiXRAKQ-rqKcPBg.png" /></figure><p>2. Double click the resource (or right click and open “Show Mock Action Editor”) which will open the<strong> MockAction Editor </strong>window. Editor will provide a default response(Response 1) . Right click the Response 1 and rename it to Response-200</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*UZ27rtY-BeT9HIVUIxhm9w.png" /></figure><p>3. Open the MockResponse editor or Response-200 by double click or using the option in right click.</p><ul><li>MockResponse editor has option to select the HTTP Status code of the response. Since we are mocking 200 response, select 200-OK in drop down list.</li><li>Since our response no need to add any headers, skip adding headers.</li><li>Select the content type for the response. In our case it is application/xml according to the API specification</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*c48_DMWZBkMwkpIEdwgrbg.png" /></figure><ul><li>Now add the mock response(xml format) to given text area.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*oI_M8q-tZEg5U4YBOBbcIg.png" /></figure><h4>Setup HTTP 400 Mock Response</h4><p>1. Open MockAction Editor. Right click and add new Mock Response as <strong>Response -400</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*vRHj3ZNKH5ZT8JS-bmmQZw.png" /></figure><p>2. Open MockResponse Editor of <strong>Response-400</strong> by double clicking. Select the Http Status code as 400. Since there is no response body or headers define in API specification for this response, leave others fields as it is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*3FNl7G9Gav-VvFgiH_7fCQ.png" /></figure><h4>Returning the Mock Responses according to requests</h4><p>Now we have created two mock responses. Lets start the mock server in Mock Service Editor and send the request to the mock resource.</p><ol><li>Response for the fist request is HTTP 200</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3wp9slK9sgA13IAqODT1Q.png" /></figure><p>2. Response for the second request is HTTP 400</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9IG2rZ-EM0lh43TrykfAYg.png" /></figure><blockquote><strong>The reason we get both response is we have selected response dispatch method as sequence in MockAction Editor. For this option mock server will return the responses created in sequence for each requests</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*rezY3eOd35wMtOj98LmrBg.png" /></figure><blockquote>This response behavior is not desired in our case. Because we need HTTP 200 for a valid request and HTTP 400 for an invalid request. In this case we need to return the response based on the request that is received. To achieve this need to select the <strong>Dispatch method as script</strong> which will let us to read the request and return response according to our logic.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*bkf46jRSjcX0U32nwpUNtg.png" /></figure><p>As in above image, once script is selected as dispatch method, there is an editor to write groovy script. By default sample script is available in commented mode, which holds syntax to access header, query ,body etc of requests.</p><p>In our case we will return HTTP 400 if request body is not presented other wise HTTP 200. Therefore we will update the script to check the presence of request body. Set the default response to Response-200 from drop down and return Response-400 from script logic if no request body found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*CPN7_ZphJfsTMPgfjdcTQw.png" /></figure><blockquote>Now mock API will return HTTP 400 , if request payload is not found in the request and HTTP 200 other wise.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4450fddd9023" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>