<?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 Yasothar Arulnayagam on Medium]]></title>
        <description><![CDATA[Stories by Yasothar Arulnayagam on Medium]]></description>
        <link>https://medium.com/@ayasothar?source=rss-3e28184413f0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OfuaTnjDrvhvR9B2QJ0NIA.jpeg</url>
            <title>Stories by Yasothar Arulnayagam on Medium</title>
            <link>https://medium.com/@ayasothar?source=rss-3e28184413f0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 07:11:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayasothar/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[IBM App Connect Enterprise (ACE)- TLS Configuration]]></title>
            <link>https://ayasothar.medium.com/ibm-app-connect-enterprise-ace-tls-configuration-6137571fbff9?source=rss-3e28184413f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/6137571fbff9</guid>
            <category><![CDATA[ibm-integration-bus]]></category>
            <dc:creator><![CDATA[Yasothar Arulnayagam]]></dc:creator>
            <pubDate>Wed, 11 Nov 2020 16:40:50 GMT</pubDate>
            <atom:updated>2020-11-11T16:40:50.734Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dl0F36mQqB_LNtA_dKd3ug.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Spiske</a> on <a href="https://unsplash.com/s/photos/encryption?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Once you successfully build an API you have to start thinking of non-functional requirements. One of the most important non-functional is security. There are so many ways to implement security for a REST API in App Connect. This post, we will discuss one of the widely used methodology, Transport Level Security (TLS) configuration for App Connect Enterprise. At first, configuring TLS to any application may seem to be a daunting task, but if we understand the key terms and concepts this will be just as any other configuration.</p><p>There are few key terms which we need to understand before implementing TLS. There are so many resources in the internet explaining in detail, the terms I’m about to discuss. You can go through them and get a better understanding. In this post I’ll try to explain them as simple as possible.</p><p><strong>TLS</strong> - is a predecessor to now deprecated version of Secure Socket Layer (SSL). A detailed explanation on what is TLS is provided in this <a href="https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/">post</a>. In brief TLS is a mechanism that ensures secure communication between systems over networks. Data transmitted through communication channels are encrypted using <a href="https://medium.com/@vrypan/explaining-public-key-cryptography-to-non-geeks-f0994b3c2d5">keys</a> meaning it will be impossible to tamper or eavesdrop transmitted data.</p><p><strong>Public key/Private key</strong> -Keys are factors of very large prime numbers, once data is encrypted by a public key it can be only decrypted by it’s pair private key. During a TLS transmission we share the public key to a client application, ask them to encrypt the data using the shared public key. That encrypted data can only be decrypted by the private key at our end which we only own.</p><p><strong>Keystore</strong> - Is a repository which we store key pairs (public/private keys) and certificates.</p><p><strong>Truststore</strong> - Is a repository we store certificates of trusted third parties.</p><p><strong>Certificate</strong> - Simply put, certificates are small data files which bind a public key and organizations details.</p><p><strong>Certificate Authority </strong>-<strong> </strong>Is an entity that issues digital certificates. Digital certificates proves the ownership of public keys. A certificate approved by a Certificate Authority ensures the communication can be trusted.</p><p><strong>Self-signed certificate</strong> - Is a certificate that is not signed by a Certificate Authority. Self-signed certificates are used for testing purposes and must not be used in production.</p><p>There are heap of resources in the internet which you can read and understand these concepts. For simplicity I’ll stick to the App Connect Enterprise TLS configuration part.</p><p>Configuring TLS for App Connect consist of two main parts.</p><ul><li>Generating a self signed certificate and adding that certificate to a keystore.</li><li>Configuring the keystore to be used by App Connect.</li></ul><h3><strong>1. Certificate generation</strong></h3><p>Certificate generation is a complicated process and involves lots of technicality. In this post I will just concentrate on the generation steps and try to keep the explanation as simple as possible. I completely followed <a href="https://www.ibm.com/support/pages/using-ikeyman-create-and-manage-digital-certificates">this</a> IBM support portal to generate the certificates. Java developers would be familiar with keytool utility which helps us generating certificates and keystores. This post we will use ikeycmd, a similar utility which works well for IBM applications.</p><p>We start with generating two keystores. One is to act as a certificate signing authority (keyselfsigned.jks), since we are creating a self signed certificate, and the other as our App Connect keystore(keypersonalcert.jks).</p><pre>ikeycmd -keydb -create -db keyselfsigned.jks -pw abc@123 -type jks<br>ikeycmd -keydb -create -db keypersonalcert.jks -pw abc@123 -type jks</pre><p>Next we’ll create a certificate which will function as our Certificate Authority. Second command will allow us to view the created certificate.</p><pre>ikeycmd -cert -create -db keyselfsigned.jks -pw abc@123 -label testesb -dn &quot;cn=testesb ou=sample o=mycompany c=LK&quot; -size 2048 -expire 365 -ca true<br>ikeycmd -cert -details -label testesb -db keyselfsigned.jks -pw abc@123</pre><p>Next we’ll create a certificate request file. The subsequent command will allow us to view this certificate request.</p><pre>ikeycmd -certreq -create -db keypersonalcert.jks -pw abc@123 -label testesb -dn “cn=testesb ou=sample o=mycompany c=LK” -size 2048 -file personalcertreq.arm<br>more personalcertreq.arm</pre><p>Take note that an .arm file is the IBM version of .csr file(certificate signing request). Both are the same file types. In a real world scenario we will provide thia .arm/.csr file to a global certificate signing authority and get it signed. By the following command we can verify the certificate request exist in the keystore.</p><p>ikeycmd -certreq -details -label testesb -db keypersonalcert.jks -pw abc@123</p><p>Nex we submit the certificate sign request and get it signed (self signed).</p><p>ikeycmd -cert -sign -db keyselfsigned.jks -pw abc@123 -label testesb -target signedpersonalcert.cer -format ascii -file personalcertreq.arm</p><p>We can view the content of the generated signed personal certificate by the following command.</p><p>more signedpersonalcert.cer</p><p>Next we extract the signed certificate and add it to our own keystore.</p><pre>ikeycmd -cert -extract -db keyselfsigned.jks -pw abc@123 -label testesb -target signer.cer -format ascii<br>ikeycmd -cert -add -db keypersonalcert.jks -pw abc@123 -label testesb -file signer.cer -format ascii -trust enable</pre><p>Using below commands we can verify whether our certificate imports have errors.</p><pre>ikeycmd -cert -receive -file signedpersonalcert.cer -db keypersonalcert.jks -pw abc@123 -format ascii<br>ikeycmd -certreq -list -db keypersonalcert.jks -pw abc@123</pre><p>If no errors are given our certificate generation part is complete. keypersonalcert.jks would be our App Connect Enterprise keystore and signer.cer will be our certificate which should be shared to third party systems. This signer.cer should be added in their truststores for secure communication. We are done with the self signed certificate creation part. Next we’ll move on to App Connect configuration.</p><h3>2. App Connect configuration</h3><p>Assume that I have an integration node named ACE1 and and integration server is1. I place my keystore in location /home/user/keypersonalcert.jks and provide the necessary permissions. Following commands will add the keystore file to the integration server and do the password configuration</p><pre>mqsichangeproperties ACE1 -e is1 -o ComIbmJVMManager -n keystoreFile -v /home/user/keypersonalcert.jks<br>mqsichangeproperties ACE1 -e is1 -o ComIbmJVMManager -n keystorePass -v is1Keystore::password</pre><p>Take note of the is1Keystore::password value in the second command. This should be identical with your integration server name, mine being is1.</p><p>Following command will set the password value given above.</p><pre>mqsisetdbparms ACE1 -n is1Keystore::password -u ignore -p abc@123</pre><p>abc@123 would be my keystore password value. It is always good to set the truststore also. Command would be similar to keystore setup. Once all the configuration are done don’t forget to do a restart for the changes to be effective.</p><p>If we want we can set the HTTPS connection port explicitly by the following command.</p><pre>mqsichangeproperties ACE1 -e is1 -o HTTPSConnector -n explicitlySetPortNumber -v 7843</pre><p>This completes the App Connect Enterprise configurations.To enable HTTPS in the REST API project, tick the Enable SSL in the projects’ rest API description.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*xHZ1-5ztsge39hCRvMdE7A.jpeg" /></figure><p>Do a clean build for the project and deploy it in the server. Below is a image captured from one of my post man test run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*18Do4ygliQK2xmZAdCeWww.jpeg" /></figure><p>That’s it, we are done with TLS configuration for App Connect Enterprise.</p><h3>Conclusion</h3><p>In this post we saw how we can implement TLS for secure communication between IBM App Connect and external system. We created a self signed certificate, added the certificate to a keystore and configured that keystore to App Connect. We verified the configuration using Postman, by enabling SSL in the Rest API description and deploying the project to a integration server.</p><h3>References</h3><ul><li><a href="https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/">https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/</a></li><li><a href="https://www.educative.io/edpresso/keystore-vs-truststore">https://www.educative.io/edpresso/keystore-vs-truststore</a></li><li><a href="https://www.ibm.com/support/pages/using-ikeyman-create-and-manage-digital-certificates">https://www.ibm.com/support/pages/using-ikeyman-create-and-manage-digital-certificates</a></li><li><a href="https://www.ibm.com/support/knowledgecenter/SSTTDS_11.0.0/com.ibm.etools.mft.doc/ap34020_.html">https://www.ibm.com/support/knowledgecenter/SSTTDS_11.0.0/com.ibm.etools.mft.doc/ap34020_.html</a></li><li><a href="https://www.ibm.com/support/knowledgecenter/SSEQVQ_8.1.9/srv.install/t_oc_inst_ssl_receive_cert.html">https://www.ibm.com/support/knowledgecenter/SSEQVQ_8.1.9/srv.install/t_oc_inst_ssl_receive_cert.html</a></li><li><a href="https://www.ibm.com/support/pages/secure-communication-setting-iib-over-ssltls">https://www.ibm.com/support/pages/secure-communication-setting-iib-over-ssltls</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6137571fbff9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM App Connect Enterprise (ACE)- Libraries]]></title>
            <link>https://ayasothar.medium.com/ibm-app-connect-enterprise-ace-libraries-b7a9112cd24e?source=rss-3e28184413f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7a9112cd24e</guid>
            <category><![CDATA[ibm-app-connect]]></category>
            <dc:creator><![CDATA[Yasothar Arulnayagam]]></dc:creator>
            <pubDate>Wed, 14 Oct 2020 03:41:22 GMT</pubDate>
            <atom:updated>2020-10-14T03:41:22.524Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H2ZxGrI-8XZHoS5Df40i1Q.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@alfonsmc10?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alfons Morales</a> on <a href="https://unsplash.com/s/photos/library?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>When we identify a re-usable scenario in any programming language we create a library. Libraries are a good to have feature. They reduce rework and make your application more structured. App Connect also have this library functionality and this post will describe how to create one. Basic understanding of message flows, ESQL, REST API assumed before trying out this sample.</p><h3>Use case</h3><p>Objective of this blog is to create a logger library, which will log all the incoming and outgoing messages. For this sample I will create a REST project that will read in two numbers, process and respond. The processing logic would be simple as multiplying the input numbers by 0.5 and 0.25. We are going to create a REST API project, create a logger library, and include that library to the REST project. This library is going to log all the incoming and outgoing messages.</p><h3>Implementation</h3><p>Though the heading indicates this blog is about libraries there quite few new things you might encounter during the implementation. So my advice would be whenever you encounter something new please try to read more about it, understand and try the sample which will give more clarity on what we are doing. I’ll start with the simple part, creating a REST API project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*jIMwq1Lm16m5Qx9CXO-Z7g.jpeg" /><figcaption>Figure 1 — REST API description</figcaption></figure><p>This is a simple project with URL /libsample/v1/proccessNos having a POST method, and takes in the input JSON below (values can be anything you prefer).</p><pre>{&quot;A&quot; : 100, &quot;B&quot; : 200}</pre><p>We will create the sub flow as shown below with just one compute node which will do the processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*KMejYwolNwOcK_qoFqYlzA.jpeg" /><figcaption>Figure 2 — REST API canvas</figcaption></figure><p>The compute node will have the below ESQL code between BEGIN and END keywords.</p><pre> DECLARE I DECIMAL 1;<br> DECLARE J DECIMAL 1;</pre><pre> SET I = InputRoot.JSON.Data.A;<br> SET J = InputRoot.JSON.Data.B;</pre><pre> SET I = I * 0.5;<br> SET J = J * 0.25;<br> SET OutputRoot.JSON.Data.procesedA = I;<br> SET OutputRoot.JSON.Data.procesedB = J;</pre><p>Nothing much here, we read in two values from the JSON input, assign it to two decimal variables, multiply each of them by 0.5 and 0.25 respectively, generate a JSON response result.</p><p>Next we’ll create the library. In the <strong>File</strong> menu select the <strong>Library</strong> option, in the wizard tick the type <strong>Shared Library. </strong>This will allow the created library to be shared between different projects. Click Next and Finish. Right click on the library and create a new <strong>Sub flow. </strong>I have named it Logger. Add the below nodes in the canvas to complete the sub flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*jIRlfjGPRQy-iUxnY2E9PQ.jpeg" /><figcaption>Figure 3 — Logger library canvas</figcaption></figure><p>I have two input terminals, one to process input messages and the other for output messages. The ESQL code in the input node would be as follows.</p><pre> SET OutputRoot = InputRoot;<br> SET OutputLocalEnvironment = InputLocalEnvironment;<br> SET Environment.MSG_TYPE = &#39;[INPUT]&#39;;<br> SET Environment.REQ_URL = COALESCE(&#39;[&#39; ||        InputLocalEnvironment.Destination.HTTP.RequestURL || &#39;]&#39;, &#39;[]&#39;);</pre><p>We are copying the InputRoot and InputLocalVariable to be passed to the next node. Setting an Environment Variable indicating the direction of message, (INPUT or OUTPUT), and storing the request URL. COALESCE is an inbuilt ESQL function that concatenates strings. output node would have the same set of lines except the direction &#39;[OUTPUT]&#39;. Place the below lines of code in process compute node.</p><pre> IF Environment.UID IS NULL THEN <br>   SET Environment.UID = UUIDASCHAR;<br> END IF;<br> <br> SET OutputRoot = InputRoot; <br> SET OutputRoot.HTTPInputHeader = NULL;<br> SET OutputRoot.HTTPResponseHeader = NULL;<br> <br> DECLARE MSG_STRING CHAR;<br> CREATE FIRSTCHILD OF Environment DOMAIN &#39;JSON&#39; Name &#39;Variables&#39;;<br> SET Environment.Variables.OUT_MSG = OutputRoot;<br> <br> SET MSG_STRING = CAST(ASBITSTREAM (Environment.Variables.OUT_MSG) as CHAR CCSID 1208);<br>SET MSG_STRING = OutputRoot.returnCode;<br> <br> DECLARE v_carriage CHAR; <br> SET v_carriage =CAST(X&#39;0A&#39; AS CHAR CCSID 1208); <br> SET Environment.MSG_STRING = REPLACE(MSG_STRING,v_carriage,&#39;&#39;); <br> <br> SET Environment.MSG_SOURCE = &#39;[&#39; || BrokerName || &#39;][&#39; || ExecutionGroupLabel || &#39;][&#39; || MessageFlowLabel|| &#39;]&#39;;<br> <br> SET OutputRoot = InputRoot;</pre><p>In this node we prepare the message which needs to be logged. First IF assigns a UUID using UUIDASCHAR function if there is not any. We don’t need the InputHeader, RequestHeader information to be logged hence we are making them null. Next we create a Environment variable and store the OutputRoot message as a JSON. Next we cast this JSON as a bit stream, bcause we don’t won’t the log the line breaks the JSON message will have, this will make a single request take up so many lines, we want to log everything in a single line, hence we replace the X&#39;OA&#39; with empty string. X&#39;OA&#39; is the carriage return value in CCSID. Please do some further reading in the IBM knowledge center in what is CCSID, carriage returns and how they are handled in ESQL. We build the message which is to be logged and move on to the next node.</p><p>Next we have a flow order node, first terminal will to lead to the logging, writing the information to a file, and the second will continue the flow. After all our purpose is to process the numbers not just log them.</p><p>Next will be the prepareLog node before the file output node. Below will be the ESQL code.</p><pre>SET OutputLocalEnvironment.Destination.File.Directory = &#39;C:\temp\log\&#39;; <br> DECLARE LOG_DATE CHARACTER CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT &#39;_yyyy_MM_dd&#39;);<br> SET OutputLocalEnvironment.Destination.File.Name = &#39;log&#39; || LOG_DATE; <br> <br> DECLARE v_carriage CHAR;<br> SET v_carriage = CAST(X&#39;0A&#39; AS CHAR CCSID 1208);<br> DECLARE NOW CHARACTER;<br> SET NOW = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT &#39;yyyy-MM-dd HH:mm:ss&#39;);<br> <br> SET OutputRoot.BLOB.BLOB = CAST(NOW ||&#39; — &#39;|| Environment.MSG_SOURCE ||&#39; — &#39;||Environment.UID ||&#39; — &#39;|| Environment.MSG_TYPE ||&#39; — &#39;|| Environment.REQ_URL || &#39;— &#39;|| Environment.MSG_STRING || v_carriage AS BLOB CCSID 1208) ;</pre><p>We set the directory name, format of the file name, set the OutputRoot with all the required information which is to be logged. In our case this would be the timestamp, message source, UUID, message type, Request URL and the message string. Please note the v_carriage variable having the value X&#39;0A’ at the end of the BLOB making sure the next message would be logged in a new line, not to mix up different request/responses. Last we have the File Output Node. Nothing to do much here since all (the destination directory, file name) are handled at the ESQL level.</p><p>Join the second terminal to the output node. That’s it. We are done with the logger library. Now to include the logger in our REST project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*0wIw6fUNtDgUAx5VJtbV8A.jpeg" /><figcaption>Figure 4 — REST API after adding loggers</figcaption></figure><p>Above will be my canvas after adding the loggers. I have added two loggers, one to log the input message and other to log the output message. Take note that I have connected the Input terminal with In Msg terminal of the logger and Output terminal with Out Msg terminal. We are done. For testing purposes we can use the the Postman to make a service call. I used the following values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*sPyBaUCBqCzpStBQVeMEWA.jpeg" /><figcaption>Figure 5 — Postman sample call</figcaption></figure><p>Check the location where you have given the log to be written. Mine is C:\temp\log\ in a Windows environment. I had the file log_2020_10_13 and it had the following two lines logged.</p><pre>2020–10–13 09:46:47 — [integration_server][wd-ace][gen.M3_LibSample] — 03fc9eff-799c-41e4–8759–7fece3d8c40b — <strong>[INPUT]</strong> — [] — {“Properties”:{“MessageSet”:””,”MessageType”:””,”MessageFormat”:””,”Encoding”:546,”CodedCharSetId”:1208,”Transactional”:false,”Persistence”:false,”CreationTime”:”2020–10–13 04:16:47.555&quot;,”ExpirationTime”:-1,”Priority”:0,”ReplyIdentifier”:”000000000000000000000000000000000000000000000000&quot;,”ReplyProtocol”:”SOAP-HTTP”,”Topic”:null,”ContentType”:”application\/json”,”IdentitySourceType”:””,”IdentitySourceToken”:””,”IdentitySourcePassword”:””,”IdentitySourceIssuedBy”:””,”IdentityMappedType”:””,”IdentityMappedToken”:””,”IdentityMappedPassword”:””,”IdentityMappedIssuedBy”:””},”JSON”:{“Data”:<strong>{“A”:100,”B”:200}</strong>}}<br>2020–10–13 09:46:47 — [integration_server][wd-ace][gen.M3_LibSample] — 03fc9eff-799c-41e4–8759–7fece3d8c40b — <strong>[OUTPUT]</strong> — [] — {“Properties”:{“MessageSet”:null,”MessageType”:null,”MessageFormat”:null,”Encoding”:null,”CodedCharSetId”:null,”Transactional”:null,”Persistence”:null,”CreationTime”:null,”ExpirationTime”:null,”Priority”:null,”ReplyIdentifier”:null,”ReplyProtocol”:”SOAP-HTTP”,”Topic”:null,”ContentType”:null,”IdentitySourceType”:null,”IdentitySourceToken”:null,”IdentitySourcePassword”:null,”IdentitySourceIssuedBy”:null,”IdentityMappedType”:null,”IdentityMappedToken”:null,”IdentityMappedPassword”:null,”IdentityMappedIssuedBy”:null},”JSON”:{“Data”:<strong>{“procesedA”:50.0,”procesedB”:50.00}</strong>}}</pre><p>I have given the important parts in the log in bold, the direction and the data. This logger will be helpful to trace and analyze messages. The great thing is, this logger library can be used in a completely different project without any modification. Any JSON messages will be logged based on where you are placing the logger library.</p><h3>Conclusion</h3><p>We created a logger library in App Connect Enterprise. Just as any other language/ESB this was also simple and straight forward. Few things we might need to take note while trying this sample.</p><ul><li>Once we create the project and library, always the library should be deployed in the server. If we try to deploy the project first it will look for the library dependency and throw an error.</li><li>You can customize the contents on what needs to be logged and what needs not to be.</li><li>You might need read bit further and understand on CCSID, carriage returns.</li><li>Also note that errors and exceptions are not handled in this example. When using in real world scenarios these might need to be required to carefully handled.</li></ul><h3>References</h3><ul><li><a href="https://www.ibm.com/support/knowledgecenter/en/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ak05870_.html">https://www.ibm.com/support/knowledgecenter/en/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ak05870_.html</a></li><li><a href="https://www.ibm.com/support/knowledgecenter/SSTTDS_11.0.0/com.ibm.etools.mft.doc/ac12380_.html">https://www.ibm.com/support/knowledgecenter/SSTTDS_11.0.0/com.ibm.etools.mft.doc/ac12380_.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7a9112cd24e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM App Connect Enterprise (ACE)-Group Nodes]]></title>
            <link>https://ayasothar.medium.com/ibm-app-connect-enterprise-ace-group-nodes-ef507517f6d2?source=rss-3e28184413f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef507517f6d2</guid>
            <category><![CDATA[ibm-integration-bus]]></category>
            <category><![CDATA[ibm-app-connect]]></category>
            <dc:creator><![CDATA[Yasothar Arulnayagam]]></dc:creator>
            <pubDate>Fri, 18 Sep 2020 11:32:48 GMT</pubDate>
            <atom:updated>2020-09-18T11:32:48.343Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Just like Software Design Patterns there are Enterprise Integration Patterns and they come in handy when designing middle-ware solutions. In this write-up, we’ll look at a example for Scatter-Gather pattern, one commonly used and very useful Enterprise Integration Pattern. As the name indicates this pattern scatters request messages, sends it to single or multiple end-points and gathers response messages. Assume there is a service, which when we pass a user id, responds with user information. Our requirement is to get a list of user information as response, calling the service multiple times with different user ids. This can be achieved by App Connects’ Group Nodes. Prior to version 10, this scenario required an IBM MQ and aggregation nodes. But with the introduction of Group Nodes in version 10, this mediation has become simple and straight forward. Let’s see how this can be achieved by the following example.</p><h3>Example REST Project</h3><p>For this exercise we are going to use the free online API found at <a href="https://jsonplaceholder.typicode.com/">https://jsonplaceholder.typicode.com/</a>. You can check the functionality of this API using Postman and check out their documentation. For example when I call this end point <a href="https://jsonplaceholder.typicode.com/users/1">https://jsonplaceholder.typicode.com/users/1</a>, user information for id 1 will be returned. Below is the response I got.</p><pre>{<br> &quot;id&quot;: 1,<br> &quot;name&quot;: &quot;Leanne Graham&quot;,<br> &quot;username: &quot;Bret&quot;,<br> &quot;email&quot;: <a href="/service/mailto:Sincere@april.biz">&quot;Sincere@april.biz</a>&quot;,<br> &quot;address&quot;: {<br> &quot;street&quot;: &quot;Kulas Light&quot;,<br> &quot;suite&quot;: &quot;Apt. 556&quot;,<br> &quot;city&quot;: &quot;Gwenborough&quot;,<br> &quot;zipcode&quot;: &quot;92998–3874&quot;,<br> &quot;geo&quot;: {<br> &quot;lat&quot;: &quot;-37.3159&quot;,<br> &quot;lng&quot;: &quot;81.1496&quot;<br> }<br> },<br> &quot;phone&quot;: &quot;1–770–736–8031 x56442&quot;,<br> &quot;website&quot;: &quot;hildegard.org&quot;,<br> &quot;company&quot;: {<br> &quot;name&quot;: &quot;Romaguera-Crona&quot;,<br> &quot;catchPhrase&quot;: &quot;Multi-layered client-server neural-net&quot;,<br> &quot;bs&quot;: &quot;harness real-time e-markets&quot;<br> }<br>}</pre><p>This API has a set of users ranging from user id 1 to 10. What we are going to do is develop a REST API which takes in two parameters start and end, fetch all those users between a given range and consolidate as a single JSON response. For example if I pass start = 1 and end = 3 user information 1,2,3 will be given as a single response.</p><p>Let’s see how we can achieve this with the help of IBM App Connect Enterprise group nodes.</p><p>First I created a REST API project with query parameters start and end. start and end parameters would act as the range indicators of user ids.</p><figure><img alt="REST API description" src="https://cdn-images-1.medium.com/max/986/1*y2wJOGi7bie3kqRkPk9EuQ.jpeg" /><figcaption>Figure 1 — REST API description</figcaption></figure><p>Below would be my message flow implementation.</p><figure><img alt="Message flow canves" src="https://cdn-images-1.medium.com/max/650/1*iPy_yN4Y2yRXQzdY8NvqwA.jpeg" /><figcaption>Figure 2 — Message flow canvas</figcaption></figure><p>One by one I’ll list the code listing and node properties.</p><p>Compute node getParams will be setting up the stage. It copies all the InputRoot and InputLocalEnvironment values, so that they can be used in the preceding node.</p><p>SET OutputRoot = InputRoot;<br> SET OutputLocalEnvironment = InputLocalEnvironment;<br> SET Environment.Destination.GroupScatter.Context = InputLocalEnvironment.Destination;</p><p>Take note of the line where GroupScatter.Context is being set with the LocalEnvironment destination. This line indicates, once all the processing is complete, where the response should be sent, the actual initiating source.</p><p>Next would be the group scatter node where the fan out process begins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*vZX67eEX1z8tRcfGKawVhg.jpeg" /><figcaption>Figure 3— Group Scatter node properties</figcaption></figure><p>Take note the <strong>Group name</strong> property we have given. This would be unique for Group Gather and Group Complete nodes.</p><p>Next is the prepareInputs compute node. As the name indicates this is the node where the preparation of request occurs for the subsequent HTTP Asynchronous Request node. Between the BEGIN and END block following ESQL code should be written.</p><pre>DECLARE I,J INT 1;<br> <br> SET I = InputLocalEnvironment.HTTP.Input.QueryString.start;<br> SET J = InputLocalEnvironment.HTTP.Input.QueryString.end;</pre><pre> WHILE I &lt;= J DO<br> SET OutputLocalEnvironment.Destination.HTTP.RequestURL = &#39;http://jsonplaceholder.typicode.com/users/&#39; || CAST(I AS CHARACTER);<br> SET I = I + 1;<br> PROPAGATE TO TERMINAL ‘out’;<br> END WHILE;</pre><pre> RETURN FALSE;</pre><p>First two lines are variable declarations. Next two lines are getting the query parameter values and setting them for the declared variables. Next is a loop which will iterate from the start to end values. Take note that the RETURN is FALSE. This is to stop the compute node from moving to the next node before completing all the iterations . With each iteration the endpoint will change based on the value of I which is found at the end of the URL as path parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*U_HmMDCXgF7qQuqy2V9PdA.jpeg" /><figcaption>Figure 4 — HTTP Asynchronous Request node Basic tab properties</figcaption></figure><p>Next would be the HTTP Asynchronous Request. Properties would be <strong>Unique identifier</strong> and <strong>Web service URL</strong>. I have given a dummy value for Web service URL since this value would be overridden in the ESQL code in the previous compute node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*a_e2sK7io9TrLfTGK_cQ4w.jpeg" /><figcaption>Figure 5— HTTP Asynchronous Request Group tab properties</figcaption></figure><p>In the Group tab of properties tick the <strong>Add request to group</strong> and provide a <strong>Request folder name</strong>. This name will be used to gather the responses in the consolidateMsgs compute node.</p><p>Following will be the HTTP Asynchronous Response node properties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*S5dlPvQhrpYRx99Z3YX_ag.jpeg" /><figcaption>Figure 5 — HTTP Asynchronous Response properties</figcaption></figure><p>Next is the Group Gather node and Group Complete nodes. Always keep in mind that the<strong> Group name</strong> property should be the same. Finally a compute node to consolidate received response messages. This is will be the ESQL between the BEGIN and END block.</p><pre>DECLARE card INTEGER;<br>DECLARE idx INTEGER 1;<br>DECLARE Ref_grpRef reference TO InputRoot.ComIbmGroupCompleteNode.Group.Replies;<br> <br>CREATE FIELD OutputRoot.JSON.Data.result IDENTITY(JSON.Array)result;<br> <br>SET card = CARDINALITY(Ref_grpRef.FLDREMP[]);<br> <br>WHILE idx &lt;= card DO<br> SET OutputRoot.JSON.Data.result.Item[idx] =      Ref_grpRef.FLDREMP[idx].Reply.Root.JSON.Data;<br> SET idx = idx + 1;<br>END WHILE;<br> <br>SET OutputLocalEnvironment.Destination = InputRoot.ComIbmGroupCompleteNode.Group.Context;<br> <br> RETURN TRUE;</pre><p>First two lines are a declarations. Next line would be a reference to InputRoot.ComIbmGroupCompleteNode.Group.Replies We create a JSON array to store the JSON responses. Get the cardinality of the FLDREMP where the responses got stored. We iterate and build the consolidated response in the next few lines and tell the App Connect where the response need to be sent by the following line of code.</p><pre>SET OutputLocalEnvironment.Destination = InputRoot.ComIbmGroupCompleteNode.Group.Context;</pre><p>That’s it, we have done a basic sample for group nodes using IBM App Connect Enterprise. I’m not going to put the combined response since it will take up space but if done correctly, this code and configuration will work without any issues.</p><h3>Conclusion</h3><p>Service orchestration or implementing a Scatter-Gather Pattern is simple and straight forward in IBM App Connect just as any other middle-ware . In the IIB previous versions Aggregate nodes gave the same functionality but required an IBM MQ. With Group Nodes, need of an IBM MQ is eliminated. Few points to consider when developing the message flow,</p><ul><li>GroupScatter, GroupGather, GroupComplete should contain the same <strong>Group name</strong> property (In this example I have given GRPTST).</li><li>Value of the<strong> Request folde</strong>r property in the HTTP Asynchronous Request node would be referred while consolidating the messages using InputRoot.ComIbmGroupCompleteNode.Group.Replies.</li><li>Timeouts should be carefully set for large groupings based on the API response times for GroupScatter, HTTP Asynchronous Request, and Group Gather nodes.</li><li>HTTP Asynchronous Request and HTTP Asynchronous Response should have the same<strong> Unique identifier</strong> property</li><li>In the given message flow error/exception handling is not done. You can observe most of the terminals are not connected. Only the happy path scenario is given here. For a complete solution all the terminals should be connected and errors/exceptions should be handled correctly.</li></ul><h3>References</h3><ul><li><a href="https://prasadvadnala.blogspot.com/p/group-nodes-in-ace.html?m=1">https://prasadvadnala.blogspot.com/p/group-nodes-in-ace.html?m=1</a></li><li><a href="https://developer.ibm.com/integration/blog/2018/10/08/ibm-app-connect-enterprise-now-supports-group-nodes/">https://developer.ibm.com/integration/blog/2018/10/08/ibm-app-connect-enterprise-now-supports-group-nodes/</a></li><li><a href="https://iteritory.com/ibm-integration-bus-iib-aggregate-nodes-sample-with-http-web-services/">https://iteritory.com/ibm-integration-bus-iib-aggregate-nodes-sample-with-http-web-services/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef507517f6d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM App Connect Enterprise (ACE) -  Developing a REST API Project]]></title>
            <link>https://ayasothar.medium.com/ibm-app-connect-enterprise-ace-developing-a-rest-api-project-df997b48f778?source=rss-3e28184413f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/df997b48f778</guid>
            <category><![CDATA[ibm-app-connect]]></category>
            <category><![CDATA[ibm-integration-bus]]></category>
            <category><![CDATA[rest-api]]></category>
            <dc:creator><![CDATA[Yasothar Arulnayagam]]></dc:creator>
            <pubDate>Mon, 06 Jul 2020 09:26:46 GMT</pubDate>
            <atom:updated>2020-07-06T09:26:46.241Z</atom:updated>
            <content:encoded><![CDATA[<h3>IBM App Connect Enterprise (ACE) - Developing a REST API Project</h3><p>I’ve been a middleware developer for quite some time mostly working on WSO2 technology stack. Recently I moved to IBM stack (App Connect Enterprise, IBM MQ). Though the core concepts were same, IBM and WSO2 had their own wonderful ways of doing things. Both are enterprise <br>grade middleware and provide powerful ways of developing integration solutions. One thing I found lack in IBM was the resources <br>to tryout samples for self learning. Though IBM has a structured and organized documentation, during my self learning period I found fewer resources for IBM samples compared to WSO2. Hence my intention of writing this blog, not to just write about IBM ESB but to write about the interesting things I found in both technologies. I’ll begin with what I stared, <br>developing a simple REST API project using App Connect Enterprise (ACE). In this write up I’ll focus more on the development part rather than the installation and configuration which I’ll save it for a later write-up. To download and install ACE please refer this <a href="https://developer.ibm.com/integration/docs/app-connect-enterprise/get-started/">IBM link</a>. Make sure you have the toolkit installed and ESB up and running before start working on this sample.</p><h4>Use case</h4><p>We are going to create a simple REST API that takes in three types of parameters <strong>Query</strong>, <strong>Path</strong> and <strong>Header</strong>, build a JSON response message comprising the values of these parameters and respond back to the caller. In the toolkit create a new REST API project providing the required details and a REST API description will appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ChtZ36lxgdjmQjhEE9mrfQ.jpeg" /></figure><p>The header section will have the base URL, we still don’t have any resources or models defined yet. Click on the (+) at the right corner of the resources to add resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*udSL5mVlUMyn1T2Tzyv2Jw.jpeg" /></figure><p>I have given the resource name as params with a GET method and a path parameter name pathParameter. Once you click OK the the API decription will be updated as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aNBlc8YcBcfAKgnBd0b9tw.jpeg" /></figure><p>As you can see the pathParam is non-editable. Defining the path parameter is the tricky part. Other parameters we can just add by clicking the (+) sign pertaining to the resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ryyOcgRpMiMOgvAHoiOr4w.jpeg" /></figure><p>We are ready with the API description and now have to implement the API.</p><p>Click the ‘Create a subflow for the operation’ in the right corner which will create a subflow. Add a compute node to process the message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*BvPagUAVoaNGNkCnEIQCtg.jpeg" /></figure><p>Double click the compute node and open the ESQL. Add the following code.</p><p>SET OutputRoot = InputRoot;<br> SET OutputLocalEnvironment = InputLocalEnvironment; <br> <br> SET OutputRoot.JSON.Data.pathParamValue = InputLocalEnvironment.REST.Input.Parameters.pathParam;<br> SET OutputRoot.JSON.Data.queryParamValue = InputLocalEnvironment.REST.Input.Parameters.queryParam;<br> SET OutputRoot.JSON.Data.headerParamValue = InputRoot.HTTPInputHeader.Headerparam;</p><p>First two lines copy the header and message information. Next three line build the JSON message based on the input values. Note that even though I have defined the header parameter value as headerParam when reading the value from the input I’m using Headerparam . This is some ACE internal mechanism (the name should start with a capital and be a single word) and needs to be carefully handled, though this <a href="https://stackoverflow.com/questions/5258977/are-http-headers-case-sensitive">link</a> stackoverflow question discusses HTTP headers are case insensitive. Make sure you set the Compute Node property Compute Mode to LocalEnvironment and Message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*649iYe9q-uB08BZfcxLYZw.jpeg" /></figure><p>Once you are done with the implementation deploy it in a server and test it using a test tool. (I used Postman).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*jeL3x1IRLKhbomEvisU1Lw.jpeg" /></figure><p>I have used 100, 200, 300 respectively for the path, query, header param values in the request and they are being sent back in the JSON message.</p><h4>Conclusion</h4><p>Just like any tool, creating a REST API project is simple and easy in IBM toolkit. Few things to take note here are setting the resource with path parameter and reading a header parameter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df997b48f778" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>