Dec 21st, 2010, 02:52 PM
Spring Integration Message Filtering
I have an existing Spring MVC app that I would like to add instant messaging/chat to. To allow 2 users to message back and forth I would like to use a comet technique and I've been looking at using Atmosphere (http://atmosphere.java.net/). I saw that Jeremy Grelle built a org.springframework.integration.comet.AsyncHttpReq uestHandlingMessageAdapter that works with Atmosphere and Spring Integration. I have a "chatChannel" that seems to feed messages into the AsyncHttpRequestHandlingMessageAdapter and down to the web browser. I'm a long time Spring MVC user, but this is my first try of Spring Integration so I have a couple questions.
1. Is this a proper use of Spring Integration? Should I be using this to pass chat messages between users?
2. How do I route certain messages to certain users? If User A is chatting with User B, I don't want them to get chat messages from User C. Right now all chat messages are being passed on the "chatChannel" and funneling down to every user. Do I filter these in the AsyncHttpRequestHandlingMessageAdapter or is there some slick way of doing it in Spring Integration.
Thanks for the help!