WebSphere Process Server invocation styles

As you author applications in WebSphere Integration Developer, you may find it necessary to set or verify the invocation style that one component will use to call another. Users are often surprised to find that this is not as easy a task as it may seem. This article explains how to determine which invocation style will be used at runtime, based on characteristics of your application.

Sunita Chacko, Managing Consultant, IBM Toronto

Sunita Chacko is a Managing Consultant with Software Services for WebSphere at the IBM Toronto Lab. Sunita divides her time between providing technical expertise to WebSphere Process Server customers and field expertise to the WebSphere development teams. You can reach Sunita at: mailto:schacko@ca.ibm.com.



Jeff Brent, Senior Software Engineer, IBM

Jeff Brent is a Senior Software Engineer for WebSphere Process Server development in West Palm Beach Florida. Jeff is the lead for the WebSphere Process Server SWAT team and spends much if his time working with customers resolving deep technical issues. In his free time, he enjoys spending time with his family at the beach and playing basketball. You can reach Jeff at: jeffb@us.ibm.com.



29 October 2008

Also available in Chinese

Introduction

When authoring applications in IBM® WebSphere® Integration Developer, it is a best practice to explicitly set the invocation style that each of your components use to call each other. At a minimum, you will want to know what invocation styles are used throughout your application while you do performance analysis or develop your error handling strategy. You will certainly need to understand the interactions in your application when you consider/set your transaction boundaries. Users are often surprised to find that setting or determining invocation styles between components is not as easy a task as it may seem. This article explains how to set or determine which invocation style will be used at runtime, based on specific characteristics of your application.

The invocation styles that SCA provides are:

  • Synchronous
  • Asynchronous with callback
  • Asynchronous with deferred response

In general, when considering an interaction from one component (source or client) to another (target), the service client determines what type of invocation will be used. For example, if your source component is a Java™ component, the invocation style from source to target is determined by the particular SCA invocation API you use in the implementation (invoke(), invokeAsync(), or invokeAsyncWithCallback()). Each of the other components provided in WebSphere Process Server has a set of rules that it uses to determine whether an invocation should be synchronous or asynchronous.

Some components/imports are considered "asynchronous":

  • Long running BPEL
  • Human tasks
  • MQ/MQ JMS/Generic JMS/JMS imports

All invocations to components/imports of these types must be asynchronous invocations. If the calling component (or source) initiates the interaction synchronously, SCA will switch the interaction to be asynchronous.

Invocation style depends on the source component

As mentioned, the source component determines what type of invocation will be used. For each component type, there may be multiple properties that you need to set; for example, the Preferred Interaction Style on the target component interface is one of these properties. In the next several sections, you will find details on how to set these property values in WebSphere Integration Developer. Following that, we present the factors that determine interaction style based on component type. If you are familiar with Preferred Interaction Style, the Force Sync attribute, or the Interaction Style performance attribute, you may skip these sections. If you are developing or reviewing an application, you may find it useful to jump to the corresponding component type that represents your client component.

All information in this article pertains to WebSphere Integration Developer V6.1.2 except where explicitly mentioned. Earlier versions of the product have different defaults and characteristics in some cases.


Setting the Preferred interaction style

In most cases, the Preferred interaction style can be set to the desired value. The options available are:

  • Synchronous (default)
  • Asynchronous
  • Any

This is an attribute that can be set on the interface of a component/import/export in the assembly diagram. To locate it, select the component in the assembly editor. Look at the Properties view and select the Details tab. Select an interface. The Preferred interaction style field on the details tab will be displayed:

Figure 1. Setting the Preferred interaction style
Setting the Preferred interaction style

Note that prior to V6.1.2, the default value for Preferred interaction style was "Any".

This property is documented in the WebSphere Integration Developer Information Center, on the following page, under Preferred interaction style.


Setting the 'Force Sync' attribute

For Service Invoke nodes within WebSphere Enterprise Service Bus, you will additionally need to set/check the properties of the node itself. To locate the relevant property (called Force Sync in the table below and in the Information Center), select the node in your mediation flow. Look at the Properties view and select the Details tab. You will see two checkboxes on this page. It is the second one that is relevant here:

Figure 2. Setting the Force Sync attribute on Service Invoke nodes
Setting the Force Sync attribute on Service Invoke nodes

This property is documented in the WebSphere Integration Developer Information Center


Setting the 'Interaction style' performance attribute

For inbound EIS calls (that is, inbound adapter calls), you will need to set/check a different interaction style attribute. It is on the Binding tab of the Export properties page in the assembly diagram. Select the Export, look at the Properties view and select the Binding > Performance attributes tab. You will see the Interaction style field:

Figure 3. Setting the Interaction style performance attribute
Setting the Interaction style performance attribute

Java components

The SCA API that is used in the Java implementation to make the invocation determines what the invocation style will be at runtime:

  • invoke(): Synchronous
  • invokeAsync(): Asynchronous
  • invokeAsyncWithCallback(): Asynchronous

This is explained in more detail in the following article, Exception handling in WebSphere Process Server and WebSphere Enterprise Service Bus, under the section Advanced invocation style determination.


BPEL

When the calling component is a short running process, the preferred interaction style is honored for one-way target operations. However, invocations to request-response operations from a short running process will always be synchronous. All asynchronous invocations are made using the invokeAsyncWithCallback invocation style, never asynchronous deferred response.

Table 1. Invocation styles used by short running processes
Preferred interaction style of target component or importOne-way OperationRequest-response Operation
SynchronousSynchronous invocationSynchronous invocation
AsynchronousAsynchronous invocationSynchronous invocation
AnyAsynchronous invocationSynchronous invocation

This information is documented here in the WebSphere Integration Developer Information Center (see Table 1):

When the calling component is a long running process, the preferred interaction style is always honored. As above, all asynchronous invocations are made using the async with callback invocation style, never asynchronous deferred response.

Table 2. Invocation styles used by long running processes
Preferred interaction style of target component or importOperation TypeInvocation style
SynchronousAnySynchronous
AsynchronousAnyAsynchronous (with callback)
AnyAnyAsynchronous (with callback)

This information is documented here in the WebSphere Integration Developer Information Center (see Table 1):


Human tasks

Table 3. Invocation styles used by invocation tasks
Incoming invocation styleTarget component typeInvocation style used
Synchronous (using the callTask API)To-do taskAsynchronous
any other componentSynchronous
(watch out for an async switch in this scenario)
Asynchronous (using the startTask API)anyAsynchronous

The BPC Explorer uses an asynchronous invocation style (via the HTM API). The Preferred interaction style on the target component is always ignored.

This information is documented in the WebSphere Integration Developer Information Center:


Interface maps

Table 4. Invocation styles used by interface maps
Incoming invocation styleSource operation typeTarget operation typePreferred interaction style of target component or importInvocation style used
SynchronousanyanySynchronousSynchronous
one-wayrequest-responseAsynchronousAsynchronous (with callback)
request-responseanyAsynchronousSynchronous
anyanyAnySynchronous
AsynchronousanyanySynchronousSynchronous
anyone-wayAsynchronousAsynchronous
anyrequest-responseAsynchronousAsynchronous (with callback)
anyone-wayAnyAsynchronous
anyrequest-responseAnyAsynchronous (with callback)

If the interface map was called asynchronously, the preferred interaction style is honored. If the map was called synchronously the preferred interaction style is ignored, except when the source operation is a one-way operation. Like BPEL, interface maps always use the invokeAsyncWithCallback invocation style for asynchronous request-response invocations.

The invocation behavior of interface maps has changed from version to version. The information above applies to V6.1.x.


Callout nodes and service invoke nodes

The invocation styles used by callout nodes and service invoke nodes are documented at the following two links in the WebSphere Integration Developer Information Center:

The term Force Sync in the Service Invoke Table refers to a setting on the service invoke properties page. This property is described in the Setting the 'Force Sync' Attribute section.

In earlier releases (V6.0.2), the Preferred interaction style is ignored for all callout node invocations. All one-way operations are invoked asynchronously, and all request-response operations are invoked synchronously. The only exception to this rule is when a mediation flow component is called using the invokeAsyncWithCallback invocation style. In this case, the callout node invocation will also be made using invokeAsyncWithCallback invocation style.

Service invoke nodes were introduced in V6.1


Business rules and selectors

Both Business Rules and Selectors always use synchronous invocations. You should be wary of using these in combination with components that must be invoked asynchronously (for example, long running processes and human tasks), as this will lead to an async switch between the Business Rule or Selector and the asynchronous target.


Business state machines

The runtime artifacts for business state machines are long running processes, so the invocation behavior is the same for both.

Table 5. Invocation styles used by business state machines
Preferred interaction style of target component or importOperation TypeInvocation style
SynchronousAnySynchronous
AsynchronousAnyAsynchronous (with callback)
AnyAnyAsynchronous (with callback)

Export bindings

The invocation style used by SCA exports and Standalone References depends on the style used by the invoker.

Table 6. Invocation styles used by export bindings
Export binding typeOperation TypePerformance attributes > Interaction StyleInvocation style
EISone-wayAsynchronousAsynchronous (default)
one-waySynchronousSynchronous
request-responseanySynchronous
HTTPanyn/aSynchronous
MQ
MQ JMS
JMS
one-wayn/aAsynchronous
request-responsen/aAsynchronous (with callback)
Web services (soap/http or soap/jms)anyn/aSynchronous

Conclusion

In this article, we have provided a single point of reference for each the different interaction styles used by WebSphere Process Server and WebSphere ESB components. Use the information here to ensure that your application uses the appropriate invocation style based on your service endpoints, performance requirements, and so forth.

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Business process management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere
ArticleID=347888
ArticleTitle=WebSphere Process Server invocation styles
publish-date=10292008