You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by 王雷 <ma...@gmail.com> on 2013/09/06 23:40:29 UTC

Concurrent Request Messages to One Process Instance

Dear ODEers,


     I have a process designed as the following (in pseudo code), and the
real process design is the following link:
http://snipt.org/Agfhc6


BPEL design of a responder:
<!--------------------------------------------->
          receive (initMsg)
          ... ...
          reply (respMsg)
          while
              condition: 1=1(loop forever)
              pick
                  onMessage(reqMsg)
                       wait (for 8s)
                       reply (respMsg)
                  endOnMessage
              endPick
          endWhile

<!------------------------------------------->
     On the initiator side, I do two things:
     First, I send initMsg message to create a responder instance.
     Second I send two reqMsg (actually multiple messages, more that two).
I use correlation set to make sure the two reqMsgs are correlated to the
same responder instance.


I expect that the messages can be queued on the responder side:
the responder instance receives the two messages, keeps them in the queue.
Each time the responder fetch one message from the queue, waits for 8s,
then replies respMsg. Then the responder instance fetch the second message
from the queue, etc.

However, at runtime, I have the following error from the ODE engine:

23:06:22,841 WARN  [BpelRuntimeContextImpl] A message arrived before a
receive is ready for a request/response pattern. This may be processed to
success. However, you should consider revising your process since a TCP
port and a container thread will be held for a longer time and the process
will not scale under heavy load.
23:06:31,500 WARN  [BpelRuntimeContextImpl] A message arrived before a
receive is ready for a request/response pattern. This may be processed to
success. However, you should consider revising your process since a TCP
port and a container thread will be held for a longer time and the process
will not scale under heavy load.
23:06:31,531 FATAL [BpelRuntimeContextImpl] Engine requested response while
the message exchange hqejbhcnphr8ktwbrepbne was in the state RESPONSE
23:06:31,531 ERROR [PICK] The message exchange seems to be in an
unconsistent state, you're probably missing a reply on a request/response
interaction.
23:06:31,531 INFO  [BpelRuntimeContextImpl] ActivityRecovery: Registering
activity 119, failure reason: org.apache.ode.bpel.iapi.BpelEngineException:
Engine requested response while the message exchange hqejbhcnphr8ktwbrepbne
was in the state RESPONSE on channel 183

Herewith I am asking is it possible to achieve the expected queued behavior
for concurrent incoming message correlated responder process? I need to
simulate a multi-to-one interaction pattern...



      Best Regards



                          Lei Wang

Re: Concurrent Request Messages to One Process Instance

Posted by Sathwik B P <sa...@gmail.com>.
Hi Lei,

The warning message indicates that the message has arrived early before the
process could reach the IMA (Pick) and since you have defined a
request-respone MEP the TCP connection will be blocked for the duration of
your wait activity. ODE can run out of TCP connections very soon.

To answer your question on queued behavior of incoming messages,
Concurrent incoming messages compete for the process instance lock and the
message that gets the lock goes into execution and other messages are
rescheduled to try and acquire the lock.

regards,
sathwik


On Sat, Sep 7, 2013 at 3:10 AM, 王雷 <ma...@gmail.com> wrote:

> Dear ODEers,
>
>
>      I have a process designed as the following (in pseudo code), and the
> real process design is the following link:
> http://snipt.org/Agfhc6
>
>
> BPEL design of a responder:
> <!--------------------------------------------->
>           receive (initMsg)
>           ... ...
>           reply (respMsg)
>           while
>               condition: 1=1(loop forever)
>               pick
>                   onMessage(reqMsg)
>                        wait (for 8s)
>                        reply (respMsg)
>                   endOnMessage
>               endPick
>           endWhile
>
> <!------------------------------------------->
>      On the initiator side, I do two things:
>      First, I send initMsg message to create a responder instance.
>      Second I send two reqMsg (actually multiple messages, more that two).
> I use correlation set to make sure the two reqMsgs are correlated to the
> same responder instance.
>
>
> I expect that the messages can be queued on the responder side:
> the responder instance receives the two messages, keeps them in the queue.
> Each time the responder fetch one message from the queue, waits for 8s,
> then replies respMsg. Then the responder instance fetch the second message
> from the queue, etc.
>
> However, at runtime, I have the following error from the ODE engine:
>
> 23:06:22,841 WARN  [BpelRuntimeContextImpl] A message arrived before a
> receive is ready for a request/response pattern. This may be processed to
> success. However, you should consider revising your process since a TCP
> port and a container thread will be held for a longer time and the process
> will not scale under heavy load.
> 23:06:31,500 WARN  [BpelRuntimeContextImpl] A message arrived before a
> receive is ready for a request/response pattern. This may be processed to
> success. However, you should consider revising your process since a TCP
> port and a container thread will be held for a longer time and the process
> will not scale under heavy load.
> 23:06:31,531 FATAL [BpelRuntimeContextImpl] Engine requested response while
> the message exchange hqejbhcnphr8ktwbrepbne was in the state RESPONSE
> 23:06:31,531 ERROR [PICK] The message exchange seems to be in an
> unconsistent state, you're probably missing a reply on a request/response
> interaction.
> 23:06:31,531 INFO  [BpelRuntimeContextImpl] ActivityRecovery: Registering
> activity 119, failure reason: org.apache.ode.bpel.iapi.BpelEngineException:
> Engine requested response while the message exchange hqejbhcnphr8ktwbrepbne
> was in the state RESPONSE on channel 183
>
> Herewith I am asking is it possible to achieve the expected queued behavior
> for concurrent incoming message correlated responder process? I need to
> simulate a multi-to-one interaction pattern...
>
>
>
>       Best Regards
>
>
>
>                           Lei Wang
>