KoltinPulsar - A collection of experiments using Kotlin with Apache Pulsar

Overview

Some Experiments of using Kotlin and Apache Pulsar

This is a collection of experiments of using Kotlin with Apache Pulsar

How to Run

To run Pulsar, the easiest way is to run straight from Docker

docker run -it --rm -p 6650:6650 -p 8080:8080 -v data:/pulsar/data apachepulsar/pulsar:2.6.0 bin/pulsar standalone

And then, simply execute one of the Kotlin main classes.

  • KotlinPulsar.kt - This file contains both a Producer and a Consumer, running in seperate coroutines (lightweight threads)
  • KotlinPulsarProducer.kt - This file contains a standalone producer, that will publish messages to Pulsar
  • KotlinPulsarConsumers.kt - This file contains a standalone consumer, which takes an ID as a parameter, to allow multiple consumers to read the same topic

The easiest way to execute the main classes is to use the maven exec command

  1. Combined Producer / Consumer (KotlinPulsar.kt)

    mvn exec:java -Dexec.mainClass=KotlinPulsarKt

  2. Standalone Producer

    mvn exec:java -Dexec.mainClass=KotlinPulsarProducerKt

  3. Standalone Consumer(s)

    mvn exec:java -Dexec.mainClass=KotlinPulsarConsumersKt -Dexec.args=1

Note: On the standalone consumers, it takes an argument (in the example below, a 1). This appends to the consumer name. If you start multiple consumers with the same argument, the consumption will be Shared (based on the strategy specified in the code). If you start multiple consumers with different arguments, each consumer will consume all messages.

You might also like...
GraphQL Jetpack - A collection of packages for easily writing Java GraphQL server implementations

GraphQL Jetpack A collection of packages for easily writing Java GraphQL server

Collection of code samples for learning Android Fundamentals.
Collection of code samples for learning Android Fundamentals.

Android Tutorials Collection of code samples for learning Android Fundamentals and lessons in KOTLIN from YOUTUBE. The layout of Android Applications

This is a sample app to demonstrate the power of using EventSourced models and the ease with which these can be modelled using Kotlin.
This is a sample app to demonstrate the power of using EventSourced models and the ease with which these can be modelled using Kotlin.

Lego 4 Rent This is a sample app to demonstrate the power of using EventSourced models and the ease with which these can be modelled using Kotlin. To

A complete Kotlin application built to demonstrate the use of Modern development tools with best practices implementation using multi-module architecture developed using SOLID principles
A complete Kotlin application built to demonstrate the use of Modern development tools with best practices implementation using multi-module architecture developed using SOLID principles

This repository serves as template and demo for building android applications for scale. It is suited for large teams where individuals can work independently on feature wise and layer wise reducing the dependency on each other.

Mocking for Kotlin/Native and Kotlin Multiplatform using the Kotlin Symbol Processing API (KSP)

Mockative Mocking for Kotlin/Native and Kotlin Multiplatform using the Kotlin Symbol Processing API (KSP). Installation Mockative uses KSP to generate

Screencast using Minecraft blocks using Minestom
Screencast using Minecraft blocks using Minestom

BlockScreen 🖥️ Usage Note: This can only be used locally, servers generally don't have capturable screens First, download the latest jar, then to sta

Integration Testing Kotlin Multiplatform Kata for Kotlin Developers. The main goal is to practice integration testing using Ktor and Ktor Client Mock
Integration Testing Kotlin Multiplatform Kata for Kotlin Developers. The main goal is to practice integration testing using Ktor and Ktor Client Mock

This kata is a Kotlin multiplatform version of the kata KataTODOApiClientKotlin of Karumi. We are here to practice integration testing using HTTP stub

Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to
Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to "Go" actually "Kotlin" :-)

Microservices Kotlin gRPC Deployed in EC2, Check it out! This repo contains microservices written in Kotlin with BFF pattern for performing CRUD opera

A sample skeleton backend app built using Spring Boot kotlin, Expedia Kotlin Graphql, Reactive Web that can be deployed to Google App Engine Flexible environmennt

spring-kotlin-gql-gae This is a sample skeleton of a backend app that was built using: Spring Boot(Kotlin) Reactive Web Sprinng Data R2DBC with MYSQL

Owner
Wayne Ellis
Twitter: codemwnci
Wayne Ellis
Hands-on experiments to demonstrate the exploitability of insecure TLS configurations in Android apps

Containerized Demo for Insecure TLS Certificate Checking in Android Overview Thi

Guardsquare 13 Dec 19, 2022
Collection of JVM library logic that the Sirloin software development team is currently using

Collection of JVM library logic that the Sirloin software development team is currently using

Sirloin Dev 4 May 10, 2022
An extensive collection of Kotlin Android Utils

An extensive collection of Kotlin Android Utils This library contains small helper functions used throughout almost all of my other projects. The goal

Allan Wang 207 Dec 23, 2022
A simple Kotlin class to use to connect to a MongoDB collection.

mongodb-kotlin A simple Kotlin class to use to connect to a MongoDB collection. Once you have created a MongoDB project, choose Build a Database: Next

null 2 Oct 23, 2022
Third application for Big Brain Kotlin book, will be pokemon collection app

Big Brain Kotlin : Application #3 - PokemonHurddle Third application for Big Brain Kotlin book, will be pokemon collecting app 11285 Pokemon and becom

Chetan Gupta 3 May 12, 2022
Collection of various algorithms in mathematics, computer science etc implemented in Kotlin for educational purposes.

The Kotlin Algorithms Implementation of different algorithms and data structures using Kotlin lang Overview The repository is a collection of open-sou

Oleksii Shtanko 9 Aug 1, 2022
Collection of Rewrite Recipes pertaining to the JHipster web application & microservice development platform

Apply JHipster best practices automatically What is this? This project implements a Rewrite module that applies best practices and migrations pertaini

OpenRewrite 5 Mar 7, 2022
A collection of code generators powered by ksp.

AutoKsp A collection of code generators powered by ksp. status: working in progress Projects AutoGradlePlugin - Generate gradle plugin properties file

shenghaiyang 0 Nov 8, 2021
A collection of katas either copied or ported from some amazing folks

Kotlin Refactoring Katas A collection of katas either copied or ported from some

Ragunath Jawahar 5 Nov 15, 2022