rabbitmq

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

amq-rabbit

AMQ 使用示例

使用 amq 消息模型进行通信的服务,需要一个实现了 amq.Processor 接口的类用于监听,处理特定消息。

msg.SetType 所指定的类型会被相同类型的 Procosser 处理。

通知消息

适用于简单收发消息场景,见 notice-message 给出的示例代码。

运行示例:

cd example
make run_notice_sender
make run_notice_receiver

单向事务消息

此消息模型可用于实现异步应答机制。 simplex-message 包含一个简单单向事务消息示例,其模型如下图: image

运行示例代码:

cd example
# 运行发送方示例,使用 ctrl+C 退出
make run_simplex_sender
# 运行接受者示例,使用 ctrl+C 退出
make run_simplex_receiver

双向事务消息

消息模型如下图 image

运行示例代码:

cd example
# 运行发送方示例,使用 ctrl+C 退出
make run_dup_sender
# 运行接受者示例,使用 ctrl+C 退出
make run_dup_receiver

广播消息

Fan-out 模式

参见 example/fan-out 示例

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DestroyQueueName

func DestroyQueueName(name string) (string, string, string)

*

  • 使用当前客户端分解一个AMQ消息的队列名称,{name}名称满足格式:sys_amq_{systemId}_{node}或者sys_amq_{systemId}_{node}_p{partition}
  • 其中{systemId}为目标系统的四位数数字ID,{node}为目标系统监听的AMQ节点标示(参考{@link AMQNode}。 *
  • @param name AMQ消息的队列名称
  • @return "sys_amq","{systemId}",["{node}","p{partition}"]

Types

This section is empty.

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL