zoukankan      html  css  js  c++  java
  • EasyNetQ笔记

    Each call to Subscribe creates a new queue consumer. If you call Subscribe two times with the same message type and subscription id, you will create two consumers consuming from the same queue. RabbitMQ will then round-robin successive messages to each consumer in turn. This is great for scaling and work-sharing. Say you've created a service that processes a particular message, but it's getting overloaded with work. Simply start a new instance of that service (on the same machine, or a different one) and without having to configure anything, you get automatic scaling.

    If you call Subscribe two times with different subscription ids but the same message type, you will create two queues, each with its own consumer. A copy of each message of the given type will be routed to each queue, so each consumer will get all the messages (of that type). This is great if you've got several different services that all care about the same message type.

    Considerations when writing the subscribe callback delegate

    As messages are received from queues subscribed to via EasyNetQ, they are placed on an in-memory queue. A single thread sits in a loop taking messages from the queue and calling their Action delegates. Since the delegates are processed one at a time on a single thread, you should avoid long-running synchronous IO operations. Return control from the delegate as soon as possible.

  • 相关阅读:
    ACM-ICPC 2018 徐州赛区网络预赛 J. Maze Designer (最大生成树+LCA)
    ACM-ICPC 2018 沈阳赛区网络预赛 F. Fantastic Graph (上下界网络流)
    ACM-ICPC 2018 沈阳赛区网络预赛 G. Spare Tire (容斥原理)
    HDU 3081 Marriage Match II (二分+并查集+最大流)
    ISAP模板
    POJ
    青春
    登高有感
    那年今日
    NOIP200101数的计算
  • 原文地址:https://www.cnblogs.com/lwhkdash/p/11715156.html
Copyright © 2011-2022 走看看