0

I have three cases:

  1. When the application is shut down, and then a few messages are sent on the topic, after running the application and consuming messages, the Current Offset is not updated.

  2. When the application is running, I'm sending few messages at once. The Current Offset is set for the previous Latest Offset + 1.

Example: Current: 25, Latest: 27. I'm sending three messages. After consumption: Current 28, Latest: 30.

  1. When the application is running, I'm sending one message. The Current Offset is set for Latest Offset.

Example: Current: 25, Latest: 27. I'm sending one message. After consumption: Current 28, Latest: 28.

I think that the proper behavior is in case 3, meaning after consumption, the Current Offset is set to the Latest.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • 1
    Is the application shutdown gracefully, with the bus stopped? Checkpoints happens incrementally, not immediately (that would be super slow if it was the case), but should happen on shutdown. – Chris Patterson Feb 01 '21 at 13:31
  • No, it was turned off by stopping debugging process. The bus is added with `services.AddMassTransitHostedService();`. – Rafał Ryszkowski Feb 01 '21 at 13:34
  • Stopping debugging is not a clean exit, so you can't predict the behavior in that case. – Chris Patterson Feb 01 '21 at 13:41
  • As Chris said, you must be sure you call stop before quit. Other question, could you post your configuration and logs from MT, if you enable Debug level it will show you which offset it commits – NoNameR Feb 01 '21 at 14:12
  • This could be valid only in the first case when the application is shut down. The second and third case happens when the application is working. – Rafał Ryszkowski Feb 01 '21 at 14:26
  • Have you increased changed the `ConcurrencyLimit` value on the topic endpoint? There is a race condition in that code currently. – Chris Patterson Feb 01 '21 at 15:59
  • What is the recommended value for `ConcurrencyLimit `? – Rafał Ryszkowski Feb 01 '21 at 16:12
  • @ChrisPatterson Whether MassTransit performs autocommit? – Rafał Ryszkowski Feb 02 '21 at 12:29
  • There is recommended value, but at 1 the offset tracking works fine. Over 1, there could be a race condition that isn't comparing the offsets that will be fixed in the next release. – Chris Patterson Feb 02 '21 at 12:59

0 Answers0