<?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 Dineth on Medium]]></title>
        <description><![CDATA[Stories by Dineth on Medium]]></description>
        <link>https://medium.com/@dineththarushan6?source=rss-3308b8a14866------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*L31tm1gw__1EMLW6</url>
            <title>Stories by Dineth on Medium</title>
            <link>https://medium.com/@dineththarushan6?source=rss-3308b8a14866------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 14:58:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dineththarushan6/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[WebSphere applications Remote Debugging]]></title>
            <link>https://medium.com/@dineththarushan6/websphere-applications-remote-debugging-eb23296a5fa6?source=rss-3308b8a14866------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb23296a5fa6</guid>
            <category><![CDATA[jdwp]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[intelij-idea]]></category>
            <category><![CDATA[remote-debugging]]></category>
            <category><![CDATA[websphere]]></category>
            <dc:creator><![CDATA[Dineth]]></dc:creator>
            <pubDate>Fri, 27 Mar 2026 09:20:09 GMT</pubDate>
            <atom:updated>2026-03-27T09:20:09.558Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is about remote debugging a WebSphere server application by a local IntelliJ. Both local and remote server are running windows and the application which is deployed in the WebSphere server is a java application. The WebSphere server version used for this experiment is 8.5.5.0 and the java version and the maven version of the application are 8 and 3.0.4. The windows versions are using, window 10 in the local and windows 2012 in the remote machine.</p><p>First, I attempted debug by running the WebSphere server in local machine by adding debug configurations to the WebSphere application level. The WebSphere path is shown below.</p><p>· [servers -&gt; server types -&gt; WebSphere application servers -&gt; Java and Process management -&gt; process definition -&gt; Java virtual machine]</p><p>· Then tick the debug mode and configure the debug arguments as below</p><p>· -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777</p><p>=7777 part is support only for the local machine (localhost). If you need to support debugging though the remote server configure as =*:7777 then it is supporting for the all network interfaces (0.0.0.0). However this is not required in my setup since I configured a SSH tunnel, so the WebSphere server level debugging treat as local debugging.</p><p>After configuring this in the local WebSphere server the debugging was successful. Then I tried to remote debug the same WebSphere application by hosting in a remote windows server.</p><p>First, I test the connectivity by telnetting to the port 7777 of remote server, it succeeded but remote debugging failed with a JDWP handshake error. Then I tried to find what is the reason for failing this remote debug even though the telnet test succeeded. After that had to think this with the OSI 7 layers network model, this made much easier to understand what was happening in my case.</p><p>· <strong>Application layer: </strong>User facing logics -&gt; <strong>JDWP is working here</strong></p><p>· <strong>Presentation layer: </strong>encryption and decryption</p><p>· <strong>Session layer: </strong>connection management</p><p>· <strong>Transport layer:</strong> TCP/UDP -&gt; <strong>telnet is working here</strong></p><p>· <strong>Network layer:</strong> IP Addressing</p><p>· <strong>Data link layer: </strong>MAC/frames</p><p>· <strong>Physical layer: </strong>Cabling and signal</p><p>OSI 7 layers network model help to understand why the remote debugging is failing even when the telnet was successful. The JDWP (Java Debug wired protocol) handshake is happening in the application layer. I connected to remote windows server through a VPN. The VPN is blocking the data frames regarding to the JDWP handshake. I identified three reasons why the JDWP was failing.</p><p>1. Data is in plain text format</p><p>2. 7777 not whitelisted by the commercial VPNs</p><p>3. JDWP protocol because this is not a allowed protocol by the VPN(http/https/SSH are allowed)</p><p>These are because of security purposes of the remote server. So all these three issues resolved at once by creating a SSH tunnel through local machine to remote machine. The following explains how the three issues are resolved by a SSH tunnel.</p><p>1. Data is encrypted in the SSH tunnel so VPN connection cannot read it</p><p>2. Port: 22, the SSH tunnel is opening through the port 22 which is whitelisting by the VPN.</p><p>3. Protocol: SSH</p><p>Summary of workflow : InteliJ -&gt; SSH client -&gt; VPN -&gt; SSH server -&gt; WAS</p><p>1. InteliJ : calls localhost:7777</p><p>2. SSH client: encrypt data and send through 22</p><p>3. VPN: check port, protocol.</p><p>4. SSH server: receive 22 and decrypt the data</p><p>5. WAS: debug through 7777</p><p>·<strong> Configure SSH tunnel in remote server(SSH server)</strong></p><p>Since remote server runs windows 2012 open SSH is not built in and must be installed manually and start it.</p><p>1. Download open SSH</p><p>a. Link : <a href="https://github.com/PowerShell/Win32-OpenSSH/releases">https://github.com/PowerShell/Win32-OpenSSH/releases</a></p><p>b. Stable version: OpenSSH-Win64.zip</p><p>2. Install</p><p>a. powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1</p><p>3. Start the SSH server service</p><p>a. net start sshd</p><p>· Configure SSH tunnel on the local machine (SSH client)</p><p>a. ssh -L 7777:192.168.14.250:7777 <a href="/service/mailto:directfn@192.168.14.250">directfn@192.168.14.250</a></p><p>Special:</p><p>Before connecting the SSH tunnel need to check the process is running under 0.0.0.0 in the remote server. Otherwise it can be exposed in the local machine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb23296a5fa6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed Hash Using JMS Queues and Topics]]></title>
            <link>https://medium.com/@dineththarushan6/distributed-hash-using-jms-queues-and-topics-d36e6bc3f721?source=rss-3308b8a14866------2</link>
            <guid isPermaLink="false">https://medium.com/p/d36e6bc3f721</guid>
            <dc:creator><![CDATA[Dineth]]></dc:creator>
            <pubDate>Sat, 29 Jun 2024 08:19:12 GMT</pubDate>
            <atom:updated>2024-06-29T08:19:12.139Z</atom:updated>
            <content:encoded><![CDATA[<ul><li><strong>Introduction to JMS Messaging in Distributed Hashing</strong></li></ul><p>HashPub-Store is a distributed hashing system using JMS queues and topics. This is an educational project to get a sound understanding about JMS messaging. There are multiple nodes in the system and the nodes can dynamically add or withdraw from the system. The system is always optimized with the existing nodes in the system. The git hub repository reference is mentioned in the end of the post.</p><p>The <strong>Receiver</strong> is a role of nodes. These kinds of nodes can output data and store data when user requires. <strong>Hasher </strong>nodes are the nodes that have the responsibility to hash values that got from the users.</p><p>As the communication medium JMS topics are used for message broadcasting and JMS queues are used for point-to-point message passing when necessary. This post mainly focuses about the application and implementation, not the specific technologies.</p><ul><li><strong>JMS messaging</strong></li></ul><p>As a distributed hash system there so many messages are passed here and there. Then the main concern is to choose a messaging techniques to be a lightweight communication protocol. JMS (Java Messaging Service) is more optimal communication protocol that suites with java.</p><p>There are mainly three bus words that we need to consider when work with JMS messaging system. They are message broker, JMS queues and JMS topics.</p><ul><li><strong>Message Broker (ActiveMQ)</strong></li></ul><p>Assume there happen a car business among two parties. Most probably they connected with a broker to success this business. Because a broker have the capability to resolve some problems among these two parties. The broker is specialized to resolve that kind of problems. Broker is responsible to find the buyer and seller and store the business when a seller will be found. The message broker in JMS communication is same as this type of broker. There are some inbuilt mechanisms to avoid some of potential issues.</p><p>Message broker is the responsible component to ensure the message communication through distributed nodes. There are mechanisms to resolve the potential common problems when communicate within distribute components.</p><p>To ensure the message is delivered to the consumer or not, is one of the common problems when communicating within distributed components. There are configurations to setup acknowledgment when consume a message by a consumer. Then the consumer sends an acknowledgment when a message received.</p><p>Some components can be offline when a message communication is happening then the message has disappeared from the particular component. The message broker is maintaining a message store. Then the messages can store for some time to, back to online the disconnected components. And there are configurations to timeout, then the messages that remaining some amount of time then those messages are removed from the store. This mechanism is to avoid the storage issues of the messages broker. These configurations need to configure manually by the users.</p><p>The message brokers have mechanisms to avoid these kinds of problems that potential when communicate through the distributed computing. These can be different based on the message broker.</p><p>Ex: ActiveMQ, RabbitMQ</p><ul><li><strong>How to use JMS Queues in HashPub-Store</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V0OMIYK5ydPyNtRxs2OLvQ.png" /></figure><p>There are some scenarios to use queue messages based on the domain. Theoretically JMS queue messages are used for point to point message communication. But practically queues also have the capability to send a message to multiple consumers. But some of the scenario there are some potential issues when using JMS messages with multiple consumers.</p><p>There are some scenarios that should use to message queue when considering about the HashPub-Store application. These kinds of scenarios can be explored in implementation section.</p><ul><li><strong>How to use JMS Topics in HashPub-Store</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ljL-yh79T4abG5BmLZYfwA.png" /></figure><p>This is same as the news feeds, television or radio. All the subscribers can access the messages that broadcast by the producer. There is not any control to handle the receivers of the messages by the producer. The producer only sends the message to broker. The broker holds the message when all the consumers are consumed that messages. Otherwise, the broker can store the message also.</p><p>There are some incidents in the HashPub-Store to use the JMS topic messages as role assignment, data retrieve from the hashers etc. Actually, topic can use access an audience and get some common idea about the audience. After identifying the audience, then can use queue message and communicate with a particular party.</p><ul><li><strong>Implementation</strong></li><li>Setup nodes</li></ul><p>As the requirement this need to be a distributed system that means need to communicate through the distributed components to ensure the hashing process. The same code base is used for all the nodes, and they run on different ports.</p><p>Java is the programming language that is used to this system. Spring boot is the framework. There are dependencies to import to the application to work with JMS messages. After that spring boot and JMS messaging are the compatible technologies to fulfill these requirements.</p><p>We can easily write a bat code to run the nodes on different port by asking for the port number from the user as below.</p><p>Bat Code:</p><p>@echo off</p><p>cd /d E:\HashPub\target</p><p>set /p port=Enter the port to run the HashPub-store on:</p><p>java -jar -Dserver.port=%port% &lt;name of the jar file&gt;.jar</p><ul><li>Assign roles</li></ul><p>After setup node then the main challenge is assigning roles to the nodes as receiver or hasher. Then a JMS topic message is broadcasted to all the subscribers in the system and then all the consumers reply to their port number as the reply message for the mentioned topic message. The reply message is a queue message because we know the exact consumer of the message. Otherwise, the other nodes can mislead with the messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*-lYlHICw5mxuTliuCE3ikg.jpeg" /></figure><p>After the role confirmation message to the existing roles then all the nodes can update their node map. (node map is the map to roles against the particular node). This node map is a hash map that maintains in the each node.</p><ul><li>Data insertion</li></ul><p>After roles assign to the nodes then the nodes know who the receivers are and who are the hashers. Then simply can get data from the user by a hasher node. Then the hash node converts the value into hash and then need to pass those values to receiver to store. Two receivers are sent those values to ensure the fault tolerance property. When some node down the values have remained because the values are redundant within two receiver nodes.</p><p>There are multiple receiver nodes in the system. Then an algorithm is used for choosing the two receiver nodes to store values.</p><p>Receivers selection algorithm:-</p><p>primaryReceiver = char Value of the first 10 letters of the input % receiverCount<br>secondaryReceiver = (char Value of the first 10 letters of the input + 1)%receiverCount</p><ul><li>Data Retrieval</li></ul><p>There are two nodes that have a same data record from the data insertion mechanism because to ensure fault tolerance. But the system cannot correctly predict this node have this particular data record because nodes can disconnect any time. Then the node count will change, and the position of the node also changed.</p><p>As the insertion algorithm we have chosen two receiver nodes to store a data. This node sequence is gotten from the map that stores the receivers. This map sequence can be changed any time with the disconnections of the nodes. Then we need to think the system is new one at all the time.</p><p>First of all, system need to ask for the particular data from all nodes of the system. JMS topic is the best communication way that ensure this task effortlessly. Then the system can broadcast a message through all nodes then each node will try to find that hash value from their own map that stores the hash values. Then it will send the hash value and particular data value to the node that requests the data. The node that requested the data is waiting for a limited time period for data from the receivers and then automatically ignore the request. This is implemented by the timers in the java application.</p><p>There is one redundant node to ensure the fault tolerance of this system. There is one assumption that the two nodes not disconnected that have a one particular data. We can increase the redundant data nodes to ensure more fault tolerance.</p><ul><li><strong>Conclusion</strong></li></ul><p>There are some specific drawbacks with the distributed systems when compared to the monolithic systems. Ensuring at once communication is a problem that comes with the distributed systems. The sender is hard to know the receiver will receive the message at once. Then this system has a timeout mechanism to recover this issue. Then the node that request the data is waiting for a limited time. Then we can avoid the performance issue from the resource&#39;s allocation to the unnecessary tasks.</p><ul><li><strong>Extensions</strong></li></ul><p>Considering this learning project there are so many extensions can do by several areas such as logging, fault tolerance etc. Initially I decided to implement a side car application for logging purpose for each node. It is a recommended way how implement the logging process of distributed system because we can ensure the performance KPI from it by doing logging process without any burden for the main node. So, it is the extension part of my learning project.</p><p>Git Repository : <a href="https://github.com/DinethTharushan/HashPub-Store">Click Here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d36e6bc3f721" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>