Code Monkey home page Code Monkey logo

zsmq's Introduction

This is the simplest Message Queue you've ever experienced.

ZSMQ

ZSMQ (Zola Simple Message Queue) is a very simple message queue created in java.

'zola' is a korean slang. It means 'utterly', 'extremely', 'super', 'very'

ZSMQ can be used in a variety of situations (ex, Poc or study), except in the operating environment.

ZSMQ is the best choice if you don't consider performance.

ZSMQ aims to have

  • Simplest
  • Easiest
  • intuitive configuration
  • you to focus on other than message queue

Quick Start

ZSMQ is fast and easy to use, so we aim to minimize the configuration.

Check example to see the detailed configuration; there is a simple example using zsmq.

You can quickly create a great message queue by following these steps!

  1. run messaging server and dashboard
  2. gradle dependency
  3. configure property
  4. Just U.S.E it!!

1. run messaging server and dashboard

ZSMQ provides two components:

Both of the following components must be run

  1. Messaging Server
  2. Message Server Dashboard

The Messaging Server manages the MQ. The destination to publish and subscribe to a message is Messaging Server.

The dashboard provides a view of the server. Describe the message queue and crreate/delete the MQ.

You can easily run Zola (ZSMQ) server using docker

docker run --rm -d -p 8290:3000 dhslrl321/zsmq:dashboard.1.0.1
docker run --rm -d -p 8291:8291 dhslrl321/zsmq:server.1.0.0

messaging server and dashboard's port must be 8290, 8291 ! If you need to change the port, please raise it to issue.

2. gradle dependency

Two dependencies are required to use zsmq.

  1. zola-messaging-core
  2. zola-messaging-spring-sdk

When used with spring framework, You can manually add dependencies one by one.

However, We provide a spring-boot-starter so that you can skip the complicated process and set it up easily.

It can be downloaded from the jitpack repository.

Add the following blocks to build.gradle

repositories {
    // ... other maven repository
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.dhslrl321.zsmq:zola-messaging-spring-boot-starter:${version}'
}

You can manually set bin without using the spring boot starter.

Check the reference guide for more information

3. configure property

Finally, The url of the Zola Messaging Server must be specified in application.yml

zsmq:
  url: http://localhost:8291
  listening: false
  • zsmq.url : The Messaging Server url that manages the MQ.
  • zsmq.listening : Decide whether to register the listening thread automatically or not.
    • The listener thread is used when consuming.

4. Just U.S.E it !

Now you are done with all settings

You have to use it as it is.

1. Open the dashboard, Create a queue. If you are setting properly just go into localhost:8290

image

image

2. write the code in your application

  • If you want to publish a message, please use ZolaQueueMessagingTemplate.
  • If you want to consume a message, please use '@ZolaConsumer' and @ZolaMessageListener

publish message

@RequiredArgsConstructor
public class MessageProducer {

    private final ZolaQueueMessageTemplate template;

    public void send() {
        template.convertAndSend("MY-QUEUE", "foo");
    }
}

consume message

The 'zsmq.listening' attribute must be true when consuming a message.

@Component
@ZolaConsumer
public class MyConsumer {

    @ZolaMessageListener(queueName = "MY-QUEUE", deletionPolicy = DeletionPolicy.ALWAYS)
    public void listen(String message) {
        System.out.println("message = " + message);
    }
}

Check example to see the detailed configuration; there is a simple example using zsmq.

Motivation

One day, I tried to use a message queue simply for studying.

It was not relevant to the message queue.

But I spent most of my time setting up message queues(RabbitMQ, SQS) and building infrastructure.

It was a very tough time just to perform convertAndSend.

So I decided to create a server that has low performance but highly productive message queue.

This is the beginning of zsmq.

zsmq's People

Contributors

dhslrl321 avatar

Stargazers

Kwonkyu avatar Natrix avatar Dr.meteor avatar Lee Saehim avatar μ•ˆμ‹œμ› avatar  avatar Boris Velichko avatar μž₯원읡 (μ•„μ΄λ“€λ‚˜λΌν”Œλž«νΌ) avatar Alan avatar RetroTV avatar Seo JungHan avatar  avatar  avatar  avatar DAEHEE KIM avatar Dennis, Kim avatar JeongSu Park avatar Jaeyeong Yang avatar SeongHoon Park avatar  avatar Sang Jun, Park avatar Kiyeon Cho avatar og-eun avatar yongseok avatar YoonjiKim avatar Kyungyoon Kim avatar Ethan.D.H.Kim avatar appkr avatar iringrad avatar MinHyun Lee avatar Joshua_Kim avatar Wood Hwang avatar Yongbin Lee avatar HeemangHan avatar Sanghun Shin avatar ramirami avatar Juhwan Yun avatar Sigrid Jin (ΰΈ‡'Μ€-'́)ΰΈ‡ oO avatar hope avatar Jaeyeob Jung (Frankle) avatar  avatar simplify-len avatar Hyunjun avatar hyejin avatar Jayden avatar Tate avatar  avatar

Watchers

 avatar  avatar

zsmq's Issues

Queue is empty, but can peek

νλŠ” λΉ„μ–΄μžˆμ§€λ§Œ peek 연산이 κ°€λŠ₯ν•˜λ‹€.

image

image

image

  • 이전에 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ΄ λœ¨λ©΄μ„œ listening processor λ₯Ό λ‘κ°œ μ‹€ν–‰μ‹œν‚¨μ μ΄ νŠΉμ΄μ‚¬ν•­

messages avaliable number is minus

image

ν•˜λ‚˜μ˜ λ©”μ‹œμ§€λ₯Ό λ‘κ°œμ˜ μ»¨μŠˆλ¨Έκ°€ μ»¨μŠ˜ν•˜λ©΄ ν•œλ²ˆμ— λ‘κ°œκ°€ consume λœλ‹€

[core] ZolaHttpClient connection leak warning

image

κ²½κ³ : A connection to http://localhost:8291/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

TPS λŠ” μ–Όλ§ˆμΈκ°€

  • 1,000,000 개의 λ©”μ‹œμ§€λ₯Ό μ²˜λ¦¬ν•˜λŠ”λ° μ–Όλ§ˆλ‚˜ κ±Έλ¦¬λŠ”κ°€
  • μ΄ˆλ‹Ή λͺ‡κ°œμ˜ λ©”μ‹œμ§€λ₯Ό 생성할 수 μžˆλŠ”κ°€

Serializer exception handling

json serializer 의 μ˜ˆμ™Έμ²˜λ¦¬λ₯Ό 쑰금 더 μ§κ΄€μ μ΄κ²Œ ν•œλ‹€.

image

[spring] Running a spring boot test results in an exception that two bean are created

image

Parameter 0 of constructor in com.github.dhslrl321.zsmq.ZsmqAutoconfiguration required a single bean, but 2 were found:
	- zsmqProperty: defined in URL [jar:file:/Users/trevari/Desktop/git_repository/wonik/zsmq/zola-messaging-spring-boot-autoconfigure/build/libs/zola-messaging-spring-boot-autoconfigure-1.0.0.jar!/com/github/dhslrl321/zsmq/ZsmqProperty.class]
	- zsmq-com.github.dhslrl321.zsmq.ZsmqProperty: defined in null

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.