The first point is covered by PETALSCDK-135 and PETALSCDK-90.
The second one is meant to ensure the DeliveryChannel is never full.
Frankly, disk is cheap, you have to correctly dimension your system to run a system when such a situation can arise.
It is still a valid point and it is not covered by this issue, we should create another one or complete this one, but I don't know yet what to do: I mean, there is always a point when nothing can be done anymore.
The error is one solution yes, but if you don't have nor disk nor memory (because if things are persisted to disk it is because there is no more memory), how do you want your JVM to actually answer an exchange? A solution would be to find a way to always have some memory available (i.e., the DeliveryChannel persistence fails earlier than when there is no more memory).
Nevertheless, the case of remote container is interesting and we didn't think yet about it either. I guess it should be returned in error to the sending container.
Finally, when talking of persistence, I'm at the container level, so I don't really care which MEP is used (InOnly in your example), it is not an optional (i.e. per exchange) guaranty, but a per-container guaranty: if you disable it, it is at the container level, so it is not reserved to InOnly or whatever.
I personally think it is possible to achieve as good performance than currently (and maybe better…) WHILE having persistence, so this should come by default.
Also, the main idea, maybe not explicitly expressed here, is that no message should be lost if we can avoid it without a loss of performance.
And the next step is to be able to keep messages in error somewhere and give the possibility to the administrator to replay them.
It is related to PETALSCDK-136 )that you just commented
and PETALSDISTRIB-144.
One possible library we could use for persistence is Chronicle Queue.
See https://groups.google.com/forum/#!topic/java-chronicle/4-cOUnWQKnE for a discussion with the author to see if it can fit our needs.
It's quite low+level, but then it makes sense for it to be low-level since we are implementing an ESB where this kind of feature is critical.
Main open questions with it are:
PETALSESBCONT-327, in particular when messages and attachment are cached!).Also, this kind of behaviour can open interesting questions about replay (since we store all messages, before they are being processed AND after they are sent back, in two different queues!).
- Message are indefinitely stored on the disk (the queue is read with an index): some strategy must exist to remove old files, there is already a rotation strategy so it is easy to identify the file to remove.
- It means serializing every messages that have to be transferred, but that's the cost of robustness and not losing messages (and this question is related, in a way, to
- When recovering from a crash, the index has to be found again (but that can be done quite quickly and only once, or the index could have been stored also on disk).
Also, this kind of behaviour can open interesting questions about replay (since we store all messages, before they are being processed AND after they are sent back, in two different queues!).PETALSESBCONT-327, in particular when messages and attachment are cached!).