thogadam
thogadam

Reputation: 61

Notification Mechanism Using Spring

I have currently two wars files in which one war has to send notification to other war file using spring.Both of the wars are implemented using spring and web service. My requirement is first war has to send notifications to other war file. Could you please provide some pointers to implement the same using spring ?

Upvotes: 1

Views: 823

Answers (3)

Mr.Eddart
Mr.Eddart

Reputation: 10273

You can use RMI to export your beans and make them visible from other modules, better than other alternatives in this case because:

  • JMS is asynchronous and needs a middleware.
  • Webservice are less efficient (since it is mostly conceived to communicate heterogeneous platforms).

Take a look here on how to do it:

http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/remoting.html#remoting-rmi

But I would first of all review the architecture you are using, in case you can refactor it for a better integration of business logic.

Upvotes: 0

AlexR
AlexR

Reputation: 115408

I do not know exactly your requirements but I'd suggest you to use RestFull web service for this notification. Spring has a perfect support of this kind of services.

Internally the first application will send HTTP POST (or GET) request like http://thehost/webapp2/mynotification

Other way is to communicate using JMS. This way is good if you have to make the communication asynchronous. Spring supports JMS using JMS templates.

Upvotes: 1

Bozho
Bozho

Reputation: 597422

You can use:

  • JMS
  • a webservice (or spring http invoker) in the target app and invoke it from the notifier

Upvotes: 0

Related Questions