Skip to content

Instantly share code, notes, and snippets.

@firefirer1983
Last active May 6, 2020 03:26
Show Gist options
  • Save firefirer1983/221c36067491b78b5ebbf1a517f07146 to your computer and use it in GitHub Desktop.
Save firefirer1983/221c36067491b78b5ebbf1a517f07146 to your computer and use it in GitHub Desktop.
AMPQ

AMPQ(Advanced Message Queuing Protocol)

高级消息队列协议, 客户端应用和消息broker中间件之间使用此协议进行通讯.

AMOQ Entities:

  1. Exchange
  2. Queue
  3. Binding

Exchanges

Default Exchange(默认交换机)

  • Is a direct exchange
  • Has no name
  • Every queue is automatically bound to it with queue name as routing key

Direct Exchange

  • Is ideal for the unicast routing of messages
  • Often used to distribute tasks between multiple workers

Fanout Exchange

  • Routes messages to all the bound queue.
  • Routing key is ignored
  • Ideal for broadcasting

Topic Exchange

  • Ideal for multicasting
  • Multiple consumer that selectively choose which type of messages they want to receive

Queue

  • Name
  • Durable
  • Exclusive
  • Auto-delete
  • Arguments

Consumer

  • Consumer tags

Every consumer has an identifier that is used by client libraries to determine what handler to invoke for a given delivery

  • single active consumer

Note that without the single active consumer feature enabled, messages would be dispatched to all consumers using round-robin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment