Announcement Announcement Module
Collapse
No announcement yet.
Example Request: MVC and Integration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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.

      Comment


      • #4
        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

        Comment


        • #5
          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

          Comment


          • #6
            Never mind. Found your read me. Thanks

            Comment


            • #7
              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.

              Comment


              • #8
                Originally posted by [email protected] 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.

                Comment

                Working...
                X