[esb-issues] [JBoss JIRA] Created: (JBESB-695) ESBActionHandler needs to refactored to allow for async calls

Burr Sutter (JIRA) jira-events at lists.jboss.org
Sat Jul 14 19:06:15 EDT 2007


ESBActionHandler needs to refactored to allow for async calls
-------------------------------------------------------------

                 Key: JBESB-695
                 URL: http://jira.jboss.com/jira/browse/JBESB-695
             Project: JBoss ESB
          Issue Type: Task
      Security Level: Public (Everyone can see)
          Components: BPM
    Affects Versions: 4.2 Milestone Release 2
            Reporter: Burr Sutter
         Assigned To: Mark Little
             Fix For: 4.2


>From Jeff Delong, this feedback is based on the quickstarts as well as a flaw in the ESBActionHandler

If the ActionHandler does the work of the node (i.e., it invokes the service that does the work of the node), then it should be configured on an action of that node, not on an event. Events are for performing actions that are ancillary to the node, not it's main purpose.

Now this raises and issue with the current design of the ESBActionHander. If the service at the node executes asynchronously, then the ESBActionHandler should not signal; instead the service should signal back through the ESB SignalAction. However, if the service should execute synchronously, then the ESBAcionHandler should propogate the token (i.e., do token.signal()).

I.e., modify the following code in ESBActionHandler


if (null==millisToWaitForResponse || millisToWaitForResponse < 1)
{ // ASYNC
Invoker.invoke(request,esbCategoryName, esbServiceName);
return;
}
Message response = null;
if ("MOCK_CATEGORY".equals(esbCategoryName)
&& "MOCK_SERVICE".equals(esbServiceName))
response = request;
else
Invoker.invokeAndAwaitResponse (request,esbCategoryName, esbServiceName, millisToWaitForResponse);
if (null!=response)
varsFromResponse(response);
token.signal(); // this is required since the response is sync
}

Putting the ESBActionHandler on the node-enter, the token will always go on to the next node; since there is no action configured on the node, it moves on by default. Thus the current code will work for sync when configured on a node-enter event, but not work for async on a node-enter event. The current code will NOT work for sync when moved to a node action, but will work for async.

In order to make both async and sync work, but the ESBActionHandler on a node action, and add token.signal() to the synch logic. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the esb-issues mailing list