Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web services, EIS and state

 
grigoris philippoussis
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I want to wrap an EIS (C++ app) and make it available to J2EE componenets.

The service needs to accept calls to init(), start(), stop(), doStuff() etc - so it needs to maintain state. Ideally, it would sit in the background runnning, waiting for requests.

Would it be correct to wrap it in a web-service? Or should I be looking at using a resource adapter?

Thanks,
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregory,

Please check your private messages.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it be correct to wrap it in a web-service?


Web services are supposed to be stateless - maintaining any kind of state adversely affects scalability of the service. That doesn't mean that you cannot interact with long-running transactions through web services. It simply means that the state is stored somewhere else (like a database) other than the service. To identify which "state" the service is operating on, you have to include a correlation identifier in every message that follows the initial request that initiates the "conversation".

Given what you have outlined I think that the resource connector is the better solution in your case. It should give better performance than a web service and you can always expose the functionality supported by the connector through a web service hosted within the application server. However the connector needs to be designed carefully. If state is stored within the connector then you need server affinity support because all the request of the same "conversation" (with the same correlation identifier) need to be routed to the same server within a cluster. If you can store the state on the EIS any connector instance on any server will do.
 
grigoris philippoussis
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.
Do you know of any good RA resources on the net?
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are some in this topic.
A search on the EJB and Other Java EE Technologies forum may turn up more.
This article Choosing among JCA, JMS, and Web services for EAI might also be of interest.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic