单个 Chronicle Queue 定制处理程序可以将不同的消息附加到同一个 Queue 吗?
Is it ok for a SingleChronicleQueue tailer handler to append a different message to the same Queue?
我有 1 个 SingleChronicleQueue
通过 methodWriter 代理附加了不同的消息 API。
我的 reader 处理程序处理 'message1' 并追加一条不同的消息 'message2' 以便同一处理程序通过不同的方法 (message2()) 进行处理。
Flow is:
Append: proxy appends message1 to Q
Tailer: handler1 reads message1 and
appends using proxy message2 to same Q
Tailer: handler1 reads message2
好吗?
或者,tailer 是否应该始终写入不同的 'Out' 队列并让其位于中间?
这种方法控制对共享状态的非锁定访问的原因。
最简单的解决方案是为所有事件设置一个队列,并让 reader(s) 忽略他们不关心的事件。
有充分的理由有更多的队列,但是,我会从一个开始,然后从那里开始。
注意:对于单个队列,tailer 将看到所有消息,即使是使用 tailer 写入的线程也是如此。
我有 1 个 SingleChronicleQueue
通过 methodWriter 代理附加了不同的消息 API。
我的 reader 处理程序处理 'message1' 并追加一条不同的消息 'message2' 以便同一处理程序通过不同的方法 (message2()) 进行处理。
Flow is:
Append: proxy appends message1 to Q
Tailer: handler1 reads message1 and
appends using proxy message2 to same Q
Tailer: handler1 reads message2
好吗?
或者,tailer 是否应该始终写入不同的 'Out' 队列并让其位于中间?
这种方法控制对共享状态的非锁定访问的原因。
最简单的解决方案是为所有事件设置一个队列,并让 reader(s) 忽略他们不关心的事件。
有充分的理由有更多的队列,但是,我会从一个开始,然后从那里开始。
注意:对于单个队列,tailer 将看到所有消息,即使是使用 tailer 写入的线程也是如此。