Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6854721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:40:09+00:00 2026-05-27T01:40:09+00:00

I succeeded to make simple and small example which integrates between Spring MVC and

  • 0

I succeeded to make simple and small example which integrates between Spring MVC and Atmosphere framework. It works very well, but it behaves the way I’m failing to understand:

In my try example i’m trying to broadcust Date string every 10 seconds, so If I start my app at 10:10:20 the next message will be 10:10:30, etc….

but instead of it I have 4 callbacks within this period of time so my message flow looks like this: 10:10:20, 10:10:21, 10:10:22, 10:24, 10:10:30. This behavior occurs sequentially with the same perion of time:

Why do I have 4 callbacks in 10 seconds instead of single one every 10 seconds?

My relevant code is:

 @RequestMapping(value="/websockets", method=RequestMethod.GET)
 @ResponseBody
 public void websockets(final AtmosphereResource<HttpServletRequest,HttpServletResponse> event) {

      final HttpServletRequest  req = event.getRequest();
        final HttpServletResponse res = event.getResponse();
        event.suspend();

        final Broadcaster bc = event.getBroadcaster();
        bc.scheduleFixedBroadcast(new Callable<String>() {

            public String call() throws Exception {

                return (new Date()).toString();
            }
        }, 10, TimeUnit.SECONDS);
 }

and on my client code I’m doing the following:

<script type="text/javascript">
$(document).ready(function() {
     var callbackAdded = false;

          function callback(response)
          {

              $.atmosphere.log('info', ["response.state: " + response.state]);
              $.atmosphere.log('info', ["response.transport: " + response.transport]);

              if (response.transport != 'polling' && response.state != 'connected' && response.state != 'closed') {
                  $.atmosphere.log('info', ["response.responseBody: " + response.responseBody]);
                  if (response.status == 200) {
                      var data = response.responseBody;

                      if (data) {
                          $("#date").text(data);
                      }
                  }
              }
          }
          $.atmosphere.subscribe("websockets",
                  !callbackAdded? callback : null,
          $.atmosphere.request = {transport: 'websocket'});
          connectedEndpoint = $.atmosphere.response;
          callbackAdded = true;
});
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:40:09+00:00Added an answer on May 27, 2026 at 1:40 am

    After adding the Non-Blocking support I get the following message from the web application:

    60347 [http-nio-8080-exec-1] WARN org.atmosphere.cpr.AtmosphereServlet - failed
    using comet support: org.atmosphere.container.TomcatCometSupport, error: Tomcat
    failed to detect this is a Comet application because context.xml is missing or t
    he Http11NioProtocol Connector is not enabled.
    If that's not the case, you can also remove META-INF/context.xml and WEB-INF/lib
    /atmosphere-compat-tomcat.jar
    60348 [http-nio-8080-exec-1] WARN org.atmosphere.cpr.AtmosphereServlet - Using B
    lockingIOCometSupport.
    60401 [http-nio-8080-exec-1] INFO com.hillert.atmosphere.HomeController - Welcom
    e home!
    

    And after this message I get the timeout errors like before.
    You can see from the log now the Server is using http-nio-8080.
    What should I do now ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple function which takes in a matching bitfield, a grid,
Yesterday, I tried to make some simple apps which can download xml files from
I've got a route setup which handles {Object}/{Operation}/{Name} . Routing works perfectly if I
I'm trying to implement a very simple XML schema constraint. The idref attribute on
I'm trying to make jQuery's ajax calls always return as if they succeeded, e.g.
I'm trying to make DuplicateHandle() for a file that another process writes. I succeeded,
I am trying to develop a simple map application, which will display a map
I need to perform a very simple operation on the database - put some
I am trying to make a simple layout like this: --------- - - -
I wrote a simple script which mails out svn activity logs nightly to our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.