Apusic文档中心
首页
  • 应用服务器 AAS
  • 负载均衡器 ALB
  • 分布式消息队列 ADMQ
  • 分布式缓存 AMDC
  • 分布式配置中心 ADCC
  • Java开发工具包软件 AJDK
  • 搜索引擎 ASE
  • 中间件云平台 ACP
  • 统一管理平台 AUMP
  • 云原生中间件管理 ACMP
  • DevOps平台 ADOP
  • 许可授权中心 ACLS
  • Copilot智能问答系统 ACS
  • 监控平台 AMP
  • 智能日志 AILP
  • 应用性能管理 AAPM
  • 智能告警 AAlarm
  • 主数据管理 AMDM
  • 数据交换平台 ADXP
  • 企业服务总线 AESB
  • 数据智脑 ADPR
  • 服务治理 ASGP
  • 统一身份管理 AIDM
  • 标准模板
  • Markdown教程 (opens new window)
  • VuePress官方社区 (opens new window)
  • 帮助
贡献文档 (opens new window)
首页
  • 应用服务器 AAS
  • 负载均衡器 ALB
  • 分布式消息队列 ADMQ
  • 分布式缓存 AMDC
  • 分布式配置中心 ADCC
  • Java开发工具包软件 AJDK
  • 搜索引擎 ASE
  • 中间件云平台 ACP
  • 统一管理平台 AUMP
  • 云原生中间件管理 ACMP
  • DevOps平台 ADOP
  • 许可授权中心 ACLS
  • Copilot智能问答系统 ACS
  • 监控平台 AMP
  • 智能日志 AILP
  • 应用性能管理 AAPM
  • 智能告警 AAlarm
  • 主数据管理 AMDM
  • 数据交换平台 ADXP
  • 企业服务总线 AESB
  • 数据智脑 ADPR
  • 服务治理 ASGP
  • 统一身份管理 AIDM
  • 标准模板
  • Markdown教程 (opens new window)
  • VuePress官方社区 (opens new window)
  • 帮助
贡献文档 (opens new window)
文档中心
  • 金蝶Apusic应用服务器

  • 金蝶Apusic负载均衡器

  • 金蝶Apusic分布式消息队列

    • 产品白皮书
    • 产品更新说明
    • V2.0.6

    • V2.0.6_for_kafka

    • V2.0.5

    • V2.0.4

    • V2.0.3

      • 发版说明
      • 产品简介
      • 功能清单
      • 快速入门
      • 安装部署
      • 开发手册
      • 用户手册
      • 国产化适配
      • 插件说明
      • 性能参数
      • 常见问题
  • 金蝶Apusic分布式缓存

  • 金蝶Apusic分布式配置中心

  • 金蝶Apusic Java开发工具包软件

  • 金蝶Apusic全文检索

快速入门

# 前提准备

ADMQ安装包(包含管控台和引擎两个安装包)

license授权文件(license.xml)

1台Linux虚拟机(ADMQ集群至少需要三个节点)

jdk1.8及以上的环境

# 管控台安装流程

把安装包放到指定目录解压

mv admq-manager-V2.3.tar.gz /opt/
tar -zxvf admq-manager-V2.3.tar.gz
1
2

拷贝license授权文件到管控台目录

cp license.xml /opt/admq-manager-V2.3/licenses
1

启动程序

cd /opt/admq-manager-V2.3/
bin/admq-manager start
1
2

停止程序

cd /opt/admq-manager/
bin/admq-manager stop
1
2

访问管控台页面

在浏览器输入:https://IP:12306,访问界面:

密码默认:11111111,首次登录需修改。

# 单机或集群部署流程

为了简单测试ADMQ的基本功能,您可以找一台服务器单独部署程序,部署完成后即可通过客户端发布和接收消息。

新增服务器

进入【系统配置】>【服务器管理】,在服务器管理页面点击左上角【新增】按钮,新增服务器信息。

上传软件包

进入【系统配置】>【软件包管理】,点击左上角的【上传】按钮,点击【上传】按钮或拖动软件包文件进来,可上传软件包信息。

创建单机或集群

进入【集群管理】,在集群管理页面左上角点击【新增】按钮,新增集群信息。(部署模式可选择集群模式或者单机模式)

# 客户端简单使用

public class Global {
    public static String clusterUrl = "pulsar://ip:6650";
    public static String defaultTopic = "persistent://租户/命名空间/主题";
}
1
2
3
4
public class GetPulsarClient {
    public static PulsarClient get(){
        try{
            PulsarClient pulsarClient;
            pulsarClient=PulsarClient
                    .builder()
                    .serviceUrl(Global.clusterUrl)
                    .authentication(AuthenticationFactory.token("token值"))
                    .build();
            return pulsarClient;
        }catch(Exception e){
            System.out.println(e);
            return null;
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public class simpleConsumer {
    public static void main(String[] args) {
        try{
            receiveSync();
        }catch (Exception e){
            System.out.println(e);
        }
    }
    public static void receiveSync() throws PulsarClientException {
        Consumer<byte[]> simpleConsumer= GetPulsarClient.get().newConsumer()
                .topic(Global.defaultTopic)
                .subscriptionName("admqSub3")
                .subscribe();
        while(true){
            //System.out.println("simpleConsumerSync received: ");
            Message msg = simpleConsumer.receive();
            //System.out.println("simpleConsumerSync received: "+new String(msg.getData()));
            try{
                System.out.println("simpleConsumerSync received: "+new String(msg.getData()));
                simpleConsumer.acknowledge(msg);
                System.out.println("this msg is acked!!!");
            }catch(Exception e){
                System.out.println(e);
                simpleConsumer.negativeAcknowledge(msg);
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public class simpleProducer {
    public static void main(String[] args){
        try{
            sendSimpleMessageSync();
        }catch(Exception e){
            e.printStackTrace();
            System.err.println(e);
        }

    }
    public static void sendSimpleMessageSync() throws PulsarClientException, InterruptedException {
        PulsarClient pulsarClient= GetPulsarClient.get();
        Producer<byte[]> simpleProducer=pulsarClient.newProducer()
                .topic(Global.defaultTopic)
                .producerName("simplePulsarProducer")
                .compressionType(CompressionType.SNAPPY)
                .sendTimeout(0, TimeUnit.SECONDS)
                .create();
        for(int i=0;i<100;i++){
            String msg="Hello simpleProducerSync!"+i;
            simpleProducer.send(msg.getBytes());
            System.out.println(msg);
            //Thread.sleep(100);
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

# 具体操作步骤

参考文档

编辑页面 (opens new window)
#快速入门

← 功能清单 安装部署→

  • 浅色模式