Results 1 to 8 of 8

Thread: Example Request: MVC and Integration

  1. #1

    Default Example Request: MVC and Integration

    I have been looking to find an example application combined creating a request in Spring MVC, passing it through the Integration architecture, and retrieving the results back via the MVC system. Currently, I am doing with with a polling mechanism.

    I am researching SEDA architectures for web applications, I can't seem to find a good example for best practices. Any examples/documents that the community can recommend?

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    You can inject a Spring Integration MessageChannel into your MVC Controller instance and send Messages to it (or use MessagingTemplate's convertAndSend() method where you can send any Object to become the payload).

    Alternatively, if your web tier is only for getting Messages into Spring Integration, you can use the HTTP inbound adapters.

  3. #3

    Default

    Thanks for the reply.

    I think my lack of knowledge is that once my mvc has involked a send() to the channel, I need to wait for the response to come back on the reply channel. Today, i have to poll with the client.

    Ideally, some sort of non-blocking way to monitor the reply channel would be best, instead of polling. I am wanting to keep load and network traffic to a minimum between the browser and the controller. I looked into reverse AJAX with DWR, but it "appears" that this my not be supported well in all reverse_proxy situations.

  4. #4
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    It sounds like what you're looking for is Comet and/or WebSockets. I've been working on some prototype code for a Spring Integration adapter that exposes a MessageChannel over Comet/WebSocket, using the Spring MVC infrastructure for request handling and content negotiation, and using Atmosphere (https://atmosphere.dev.java.net/) as the underlying technology for abstracting away the details of suspending/resuming long-lived connections and handling of the varying levels of support across Servlet containers.

    This code will be find a home in the Spring Integration sandbox very shortly, but for now, you can find it at:
    http://git.springsource.org/greenhouse/html5-showcase
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  5. #5
    Join Date
    Oct 2009
    Location
    Minneapolis, MN
    Posts
    137

    Default

    Quote Originally Posted by jeremyg484 View Post
    It sounds like what you're looking for is Comet and/or WebSockets. I've been working on some prototype code for a Spring Integration adapter that exposes a MessageChannel over Comet/WebSocket, using the Spring MVC infrastructure for request handling and content negotiation, and using Atmosphere (https://atmosphere.dev.java.net/) as the underlying technology for abstracting away the details of suspending/resuming long-lived connections and handling of the varying levels of support across Servlet containers.

    This code will be find a home in the Spring Integration sandbox very shortly, but for now, you can find it at:
    http://git.springsource.org/greenhouse/html5-showcase
    Was interested in your prototype. how do i get the pom dependency resolved for closure-templates. It doesnt appear to be in any repo. Thanks for posting

  6. #6
    Join Date
    Oct 2009
    Location
    Minneapolis, MN
    Posts
    137

    Default

    Never mind. Found your read me. Thanks

  7. #7

    Default

    Quote Originally Posted by jeremyg484 View Post
    It sounds like what you're looking for is Comet and/or WebSockets. I've been working on some prototype code for a Spring Integration adapter that exposes a MessageChannel over Comet/WebSocket, using the Spring MVC infrastructure for request handling and content negotiation, and using Atmosphere (https://atmosphere.dev.java.net/) as the underlying technology for abstracting away the details of suspending/resuming long-lived connections and handling of the varying levels of support across Servlet containers.

    This code will be find a home in the Spring Integration sandbox very shortly, but for now, you can find it at:
    http://git.springsource.org/greenhouse/html5-showcase
    It looks like they now have dependency injection in Atmosphere now, hopefully making it easier to integrate with Spring. I'm still looking into how this will all work, but I thought I would pass it along in case this helps you with your greenhouse example. Atmosphere 0.7-snapshot is available. I'd love to see how you'd use this in your greenhouse example.

  8. #8
    Join Date
    Aug 2008
    Location
    Phoenix, AZ
    Posts
    76

    Default

    Quote Originally Posted by kenyoung@solutionary.com View Post
    Thanks for the reply.

    I think my lack of knowledge is that once my mvc has involked a send() to the channel, I need to wait for the response to come back on the reply channel. Today, i have to poll with the client.

    Ideally, some sort of non-blocking way to monitor the reply channel would be best, instead of polling. I am wanting to keep load and network traffic to a minimum between the browser and the controller. I looked into reverse AJAX with DWR, but it "appears" that this my not be supported well in all reverse_proxy situations.
    You could use an SI gateway to implement this.
    Enterprise Software Consultant
    http://www.christianposta.com/blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •