Khanderao on Emerging And Integration Technologies

Tuesday, July 07, 2009

Event vs Services to initiate a BPEL process in AS11

Since As11 supports both events and services to initiate a SOA composite ( may be having a BPEL process within it), there is always a question around when to use events and when to use service invocation to start the process.

The decision can be based on the following understanding of the events and service patterns.

Events
  • Events are suitable for a decoupled integration.
  • Events are one way messaging (no request response pattern and correlation)
  • The publisher does not know about the subscribers (there might not be subscribers too)
  • The publisher is not blocked for the execution of the subscriptions
  • Events support 1:n fan out (multiple subscribers for the same event)
Service invocations
  • Service invocation is a tight integrations with the service provider
  • Service invocation supports request response patterns (sync or async)
  • Synchronous service invocation is blocked till the execution of the service completes.
  • Async Request response pattern is often supported via WS-adderessing and correlation

Labels: , , , , ,

Add to Technorati Favorites

Save This Page on del.icio.us

Sunday, February 25, 2007

JSR-311 Java API for REST approved ballot after a Mixed reactions from developers:

JSR proposal http://jcp.org/en/jsr/detail?id=311


JCP formed a JSR expert group to publish an API for RESTful services. JSR-311 is in ballot review period in this month (till Feb 26). Software companies like Apache, BEA, Google,JBoss and Sun Microsystems are on the board. Individuals like Jerom Louvel (RESTlet framework) and Douge Lea are also on board of it. However, according to others, Roy Fielding whose dissertations documented the REST pattern, seems to be unhappy about Sun using REST as a name.

According to this request, this JSR intends to provide a high level easy to use API for developers to write RESTful web services that would run on top of the Java EE or the Java SE platforms. The JSR would provide API with declarative style of programming using annotations for developers. It would also enable low level access in cases where needed by the application.

Sun's lead on this specification, Marc Hadley, outlined following conceptual model:
@UriTemplate("widgets/{widgetid}")
@ConsumeMime("application/widgets+xml")
@ProduceMime("application/widgets+xml")
public class Widget {

@HttpMethod(GET)
public Representation getWidget(@UriParam("widgetid") String id) {
String replyStr = getWidgetAsXml(id);
return new StringRepresentation(replyStr,
"application/widgets+xml");
}

@HttpMethod(PUT)
public void updateWidget(@UriParam("widgetid") String id,
Representation update) {
updateWidgetFromXml(id, update);
}

@LastModified
public Date getChangeDate(@UriParam("widgetid") String id) {
return getLastChanged(id);
}
}

Interestingly, the JSR furthers states " The specification will define
how RESTful services are deployed as JAX-WS (Java API for XML Web
Services) endpoints or Servlets." The API will be packaged as javax.ws.rest.
I assume there could be WSDL representation of this using HTTP binding type defined in WSDL1.1 where
get,put, post etc can be captured as "verb" e.g. http:binding verb="GET

While REST based services may fit into a broader definition of webservices, a SOAP centric RPC styled
definition of Webservices is not suitable for RESTful services. Following page
compares SOAP and REST.
http://rest.blueoxen.net/cgi-bin/wiki.pl?HowSoapComparesToRest

Anyway, a comment suggesting a direction of using JAX-WS and a reference to "DL based on annotations" has stirred the developers
community. Particularly on a background where WS vs REST battle is still not yet completely
settled.

W3Consortium has published a presentation on reconciling Webservices and REST.
http://www.w3.org/2005/Talks/1115-hh-k-ecows/#(1)



(Unofficial)Develoeprs Polls at
http://java.net/pub/pq/146 as of Feb 25th
Approve 126 34%
Disapprove 67 17%
no opinion 99 25%
wait and see 95 24%
other 7

Latest News: The JSR
The Executive Committee for SE/EE has approved this ballot.

http://jcp.org/en/jsr/results?id=4168

The next (tentative schedule)schedule:
February 2007 Expert group formed
June 2007 First expert draft
August 2007 Early Draft review
November 2007 Public Review
January 2008
Proposed final draft
March 2008
Final release.


Refereces:
1. JSR-311: http://jcp.org/en/jsr/detail?id=311
2. JAX-WS: http://java.sun.com/webservices/jaxws/
3. Restlest API: http://www.restlet.org/tutorial
4. Marc Hadley http://weblogs.java.net/blog/mhadley/
5. W3c on WS and REST: http://www.w3.org/2005/Talks/1115-hh-k-ecows/#(1)
6. SOAP and REST: http://rest.blueoxen.net/cgi-bin/wiki.pl?HowSoapComparesToRest




Labels: , , , ,

Add to Technorati Favorites

Save This Page on del.icio.us