Skip to content

Conversation

jlabedo
Copy link
Contributor

@jlabedo jlabedo commented Sep 23, 2025

Why is this change proposed?

Since Ecotone 1.260.0 and #499 , the behavior of in memory channel regarding retries has changed.

Here is a test case passing on 1.259.3 and failing since 1.260.0

Is this the wanted behavior (silently dropping failing messages) ?

Pull Request Contribution Terms

  • I have read and agree to the contribution terms outlined in CONTRIBUTING.

@jlabedo jlabedo requested a review from dgafka September 23, 2025 12:27
// The exception should cause the message to be retried
self::expectException(Exception::class);

$ecotoneTestSupport->run('async', ExecutionPollingMetadata::createWithTestingSetup());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the wanted behavior (silently dropping failing messages) ?

Hmm, that should happen only in case we do have strategy set for IGNORE (ignoring failing messages).
The default for in memory is resend, therefore in case of failure it will be simply send over again to the original channel without exception.

Are you sure Messages are lost? (This test will fail because no errors will be thrown, however Message should still be available in the Channel)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for in memory queue channel message are lost. This is because of this line:

if ($acknowledgementCallback->getFailureStrategy() === FinalFailureStrategy::STOP || $pollingMetadata->isStoppedOnError()) {

$pollingMetadata->isStoppedOnError() is true when testing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will happen due to ExecutionPollingMetadata::createWithTestingSetup() which sets up polling metadata to stop on error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but I would expect the message to be sent back to the channel for retry. This was the behavior before.
Without sending back to the channel, you have different behavior with acknowledgeable channel and non acknowledgeable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of stop, we don't either ack or nack those Messages in the Broker, as for some implementation like Kafka it would mean skipping over that Message. However for In Memory, it will mean that Message is lost, because it's removed the Queue Channel right away.

We would have to change the implementation of Queue Channel for receive, as currently it simply drop the Message from the Queue right away.
image
Meaning when it reaches the consumer stop, Message is already gone.

This means that InMemoryAcknowledgeCallback would have to drop that Message on accept/reject/resend, instead of doing that right away on receive.
Are you happy to adjust the implementation for this (but it may require some work)? I am happy to approve such change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants