Jul 30th, 2009, 02:10 AM
How to connect to applications with SI in the same VM
i have two web-applications which resides in the same vm. Both starts their own application context. How can i connet the two applications via spring integration, what possibilites exists to connect to a channel in another application context in the same vm?
Jul 30th, 2009, 10:24 AM
Well. . . interesting question and yes you can do it
You need to enable shared (global) application context where you would define channels. This context would become parent for both web applications and then you can use the channel to exchange messages between the two.
Here is the link to a nice blog describing how to enable parent (global) application context.
Also, if you (by any chance) running your web app in the OSGi environment, then each application context is exported as an OSGi service by the DM extender bundle which means you can access any application context as any other OSGi service.
Jul 31st, 2009, 10:50 AM
I don't know if this would violate your design concerns (and I haven't tried it) but I am pretty sure that a static singleton channel (exposed in both contexts using a factory) would do the trick already.