Hi Lutz,
Interesting case. I'll leave it to Thorben to dig into the detail. Meanwhile, a few thoughts come to mind.
You could serialize access externally, ie lock a row in an external table etc, but I suspect you don't want to do that. A technique which comes to mind using BPMN constructs;
Let me assume you have message_A and message_B. You want to serialize access, but you don't know in advance the order.
Hence set up an inline subprocess and wait to receive a 'none' event (ie an event which will never occur). Put two interrupting boundary events on the subprocess, one for event A and one for event B. On each transition path, perform the business logic and then enter a receive state for the event which has not yet occured.
Hence if the events arrive in any order, but far enough apart, all is fine. If the events arrive concurrently, you will have a race condition in the engine. However, only one execution will succeed and the other fail in an optimistic locking exception, thus the engine will rollback the path which fails. However, onece this occurs, your process will no longer be waiting on either event, it should only be waiting on the event which just failed with the optimistic locking exception. Hence retry the event and you should end up with the equivalent of serial delivery.
At least thats what I would expect...
regards
Rob