Skip to content

Instantly share code, notes, and snippets.

View felipepoliveira's full-sized avatar

Felipe Pereira de Oliveira felipepoliveira

  • Klaus Tecnologia
  • Brazil, São Paulo
View GitHub Profile
## Include on the array the services (service name and port on sequence) that you want to check.
$externalServicesNamesAndPorts = @('MySQL', 3306, 'MongoDB', 27017, 'Elastic Search', 9200, 'Apache Zookeeper', 2181, 'Kafka', 9092)
function Write-ColorOutput($ForegroundColor)
{
# save the current color
$fc = $host.UI.RawUI.ForegroundColor
# set the new color
$host.UI.RawUI.ForegroundColor = $ForegroundColor

Rodando Kafka no Windows com WSL 2

O Kafka é um serviço muito popular e difundido para ignorarmos só porque ele roda mal no Windows, então vamos resolver isso.

O que é Kafka?

Apache Kafka é uma plataforma open-source de processamento de streams desenvolvida pela Apache Software Foundation, escrita em Scala e Java. O projeto tem como objetivo fornecer uma plataforma unificada, de alta capacidade e baixa latência para tratamento de dados em tempo real. Sua camada de armazenamento é, essencialmente, uma "fila de mensagens de publishers/subscribers maciçamente escalável projetada como um log de transações distribuído", tornando-o altamente valioso para infra-estruturas corporativas que processam transmissão de dados. Além disso, Kafka se conecta a sistemas externos (para importação/exportação de dados) através do Kafka Connect e ainda fornece o Kafka Streams, uma biblioteca Java de processamento de fluxos.

Artigo extraído do Wikipedia.

@felipepoliveira
felipepoliveira / pom.xml
Last active July 22, 2018 19:44
Spring 5 (MVC, RESTFul, Security) + Hibernate 5 (EntityManager) + JWT
<dependencies>
<!-- Apache Commons: DBCP https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.1.1</version>
</dependency>
<!-- Jackson : Databind https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
@felipepoliveira
felipepoliveira / pom.xml
Last active February 15, 2018 10:17
POM File for: Spring 5.0.2 + Hibernate 5.1.10 ->JSP + JSTL + Validation Integration
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>your.group.id</groupId>
<artifactId>projectName</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
@felipepoliveira
felipepoliveira / PersistenceConfig.java
Created December 25, 2017 13:43
Spring configuration class for persistence modules (With Hiberbate 5.2)
package io.config;
import java.util.Properties;
import javax.sql.DataSource;
import org.apache.commons.dbcp2.BasicDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@felipepoliveira
felipepoliveira / web.xml
Last active February 15, 2018 10:21
Web XML file for Spring 5.2 Basic Configuration
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>ProjectName</display-name>
<!-- Spring Framework Dispatcher Servlet Configuration -->
<servlet>
<servlet-name>springDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
@felipepoliveira
felipepoliveira / pom.xml
Last active July 16, 2018 13:10
POM File for: Spring 5.0.2 + Hibernate 5.1.10 -> Web Services Packages + JSP + JSTL + ORM Integration + Validation Integration + JWT
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupid</groupId>
<artifactId>Project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>