FolkMQ v1.5.2 推出“内嵌版“(可内嵌的消息中间件)

作者 : admin 本文共1408个字,预计阅读时间需要4分钟 发布时间: 2024-06-4 共2人阅读

FolkMQ 是个“新式”的消息中间件。强调:“小而巧”、“简而强”。可内嵌,可单机,可集群(部署包为 9Mb)。

功能简表

角色功能
生产者(客户端)发布普通消息、Qos0消息、定时消息、顺序消息、可过期消息、事务消息、广播消息
消费者(客户端)订阅、取消订阅。消费-ACK(自动、手动)
服务端发布-Confirm、订阅-Confirm、取消订阅-Confirm、派发-Retry、派发-Delayed

客户端语言支持

Java、Python、JavaScript(支持 node.js 后端,web 前端)

传输协议支持

tcp、udp、websocket、kcp

本次更新

  • 新增 folkmq-embedded (带控制台的”内嵌版”)
  • 添加 server-broker 的 folkmq.maxConsumeWaiting 配置支持
  • 优化 server-broker 许可证配置改为可视界面
  • 优化 强制派送条件,对正在派发中或超过1次的消息有效(之前为2次)
  • 优化 强制派空处理
  • socket.d 升为 2.5.3

面向简单编程

1) 启动服务
docker run -p 18602:18602 -p 8602:8602 noearorg/folkmq-server:1.5.2
2) 编写程序
  • 引入一个小依赖
<dependency>
    <groupId>org.noear</groupId>
    <artifactId>folkmq-transport-smartsocket</artifactId>
    <version>1.5.2</version>
</dependency>
  • 写程序喽
public class ClientDemo {
    public static void main(String[] args) throws Exception {
        //创建客户端,并连接
        MqClient client = FolkMQ.createClient("folkmq://127.0.0.1:18602")
                                .nameAs("demoapp")
                                .connect();

        //订阅主题
        client.subscribe("demo.topic", message -> {
            System.out.println(message);
        });

        //发布普通消息
        client.publish("demo.topic", new MqMessage("helloworld!"));
        //发布Qos0消息
        client.publish("demo.topic", new MqMessage("helloworld!").qos(0));
        //发布顺序消息
        client.publish("demo.topic", new MqMessage("helloworld!").sequence(true));
        //发布广播消息
        client.publish("demo.topic", new MqMessage("helloworld!").broadcast(true));
        //发布定时消息(或延时消息)
        client.publish("demo.topic", new MqMessage("helloworld!").scheduled(Datetime.Now().addDay(10)));
        //......等
    }
}

代码仓库

  • http://gitee.com/noear/folkmq
  • http://github.com/noear/folkmq

官网

  • http://folkmq.noear.org
本站无任何商业行为
个人在线分享 » FolkMQ v1.5.2 推出“内嵌版“(可内嵌的消息中间件)
E-->