java

RabittMQ batch message processing

Posted on

There are times when we want to fire set of jobs and be notified when all of them complete. This can be easily accomplished with the latest version of Hoplin.io RabbitMQ client. A use case for using batch messages would be partitioning a document and processing each partition via separate client. As always we need […]

Uncategorized

RabittMQ RPC Request/Response example

Posted on

RabittMQ RPC Request/Response example using hoplin.io library Following example creates RPC client and then setups Async response handler, which follows by the request to get processed. Hoplin client supports both Direct-Reply and Queue per Request/Response patterns. This is the binding that is used to create our client.

development

hoplin.io A lightweight RabbitMQ client for Java (built on top of rabittmq java client)

Posted on

A lightweight RabbitMQ client for Java (built on top of rabittmq java client) Documentation and project available at GitHub repohttps://github.com/gregbugaj/hoplin.io To make working with RabbitMQ as simple as possible with minimum dependencies. Minimal dependencies, simple configuration and API. Subscriber client Publisher client Async RPC Client Creating simple RabbitMQ client can be done in couple different […]

Uncategorized

Kryo (missing no-arg constructor): java.nio.HeapByteBuffer

Posted on

While serializing ByteBuffer using Kryo we will run into the following issue. Class cannot be created (missing no-arg constructor): java.nio.HeapByteBuffer To fix this we can create a custom serializer that will take a ByteBuffer and serialize it to and from Kryo. Serializer is rather simple all we need is two pieces of data, length of […]

java

PhantomSQL 2.0

Posted on

Since the beginning of this project, I have learned many lessons. First of all the syntax of the language was to closely related to SQL, as this was the language that I wanted to mimic and fit into this framework. Main reason for that was that I wanted something familiar to the end user, I […]

java

Generate ID from UUID

Posted on

This is a method to generate a long id in the positive space. There are few issues to consider with this method – UUID is 16 bytes / 128 bits – Long is 8 bytes / 64 bits This means that we will loose some information, if we don’t want to lose that we could […]

Uncategorized

Configuring Java JDK on Ubuntu

Posted on

This is an easy way to configure java on a linux box, all this information is available online. First we need to obtain the build. sudo wget http://192.168.201.47:8000/jdk-7u75-linux-x64.gz Extract from tar sudo tar xzvf jdk-7u75-linux-x64.gz Create symbolic link so we can later update the version sudo ln -s /opt/jdk1.7.0_75/ /opt/java we edit the /etc/profile and […]

development

Starting jetty via command line an nohup

Posted on

Somehow I am getting problems starting Jetty via service jetty start We will be using unix command called nohup “Nohup is a unix command, used to start another program, in such a way that it does not terminate when the parent process is terminated.” I have opted out for using this nohup java -jar start.jar […]

java

Calculate centroid of 2D non crossing polygon

Posted on

Calculate centroid of 2D non crossing polygon, To accommodate that points are correct using Gift wrapping algorithm(Finding Convex Hull) Test case   import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull;   import java.awt.Point; import java.util.ArrayList; import java.util.Arrays; import java.util.List;   import org.junit.Test;   public class MathUtilTest {   @Test public void computeCentroidWithHull() { Point p1 = new […]