-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AMQ-8354] Add helper methods needed for replica plugin. #953
base: main
Are you sure you want to change the base?
[AMQ-8354] Add helper methods needed for replica plugin. #953
Conversation
activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
Outdated
Show resolved
Hide resolved
activemq-broker/src/main/java/org/apache/activemq/broker/scheduler/SchedulerBroker.java
Outdated
Show resolved
Hide resolved
@@ -2387,8 +2495,8 @@ private QueueMessageReference getMatchingMessage(MessageDispatchNotification mes | |||
messages.reset(); | |||
while (messages.hasNext()) { | |||
MessageReference node = messages.next(); | |||
messages.remove(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of this change is to delete only the message that we are looking for. Because deleting all messages up to the one we need prevents reading them in future. Basically if we delete them here, we will not be able to get them anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And? That's now unneeded change in behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why. this method is used to "deliver" a specific message by id to a specific consumer. we still want to have the access to all other messages. in case we want to "deliver" them too, or in case there is a real consumer
This reverts commit a32ab41.
…r_internal Conflicts: activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
c9c863d
to
e8d92fe
Compare
AMQ-8354
extracted internal changes from #848 to make it easier to review.
Added some new methods that will be used only in replica plugin.
Updated
processDispatchNotification
and related methods to work correctly(it's not been used since pure master-slave feature was deleted). it will also be used in the pluginList of changes:
ConnectionContext#setUserName
to be able to differentiate replication context(the context we use to interact with the broker) from every other to prevent replication of replicated events. ( shouldn't impact the broker)queuePurged
method to notify about a queue being purged. needed for queue purge replication. (new method, it shouldn't impact the broker anyhow)getDispatched
method to be able to fetch the list of message we are acknowledging, so we can correctly replicate acks(new method, it shouldn't impact the broker anyhow)getMatchingMessages
method to be able to get messages by selector when the consumer is full. needed for message compaction(new method, it shouldn't impact the broker anyhow)processDispatchNotification
,getMatchingMessage
andprocessMessageDispatchNotification
to be able to replicate acks correctly. basically a bug fix. (it's not been used since pure master-slave feature was deleted. it shouldn't impact the broker anyhow)