Pular para o conteĂşdo principal

Postagens

QuickPost: Object to CSV using Java 8

In a personal application I wanted to transform a few classes to CSV format without having to use external libraries. I used Java 8 and it is working very well for me so I thought about share the class in this post. It basically goes through the fields of a given class from a List and creates the CSV. The same case could be applied for XML, JSON and other formats, but in my case I only needed CSV. The original version had only a few lines, but I increased it to include a few configuration fields. See the class and a simply JUnit test for it. The source code of the maven project is also in my github .

First steps with MQTT using Mosquitto

In this post I will quickly show the steps I followed to install and test mosquitto , a MQTT server . Installing and starting Mosquitto In my case I simply added the yum repository and then, as root, I run yum install mosquitto . After a few minutes it was installed. To install it for your system, please see mosquitto download page . After the installation, you can run mosquitto in the command line and the server will be started: Running mosquitto. You can also run in daemon mode, see the mosquitto man page for further information To test the installation I suggest to install the mosquito clients: yum install mosquitto-clients.x86_64. Once you install the clients, let's use the mosquito_sub tool to subscribe to the topic fxapps/test: Subscribing to the topic fxapps/test. The -q parameter sets the QoS. For further information see mosquitto_pub man page .   Now we are able to public strings to it using mosquito_pub : Publishing a message to the topi...