Atmosphere fallback not working? - server-sent-events

I am new to atmosphere. So far I have managed to add atmosphere to my existing Tomcat 8 + Spring + Struts2 web application. I used the current version (atmosphere-runtime 2.4.24, atmosphere-spring 2.4.20 and atmosphere.js 2.3.5).
For some sort of simple status page I have already managed to get the SSE transport to work. Using Google Chrome or Mozilla Firefox this works really excellent. I love it!
After having implemeted this I wanted to check the fallback for the browsers uncapable of SSE (Internet Explorer and Edge). In the client logs I can see that atmosphere corretly detects absence of the SSE feature and uses the fallback:
Server Side Events(SSE) is not supported, using request.fallbackTransport (long-polling)
atmosphere.js (3272,21)
Thu May 24 2018 08:54:28 GMT+0200 (Mitteleuropäische Sommerzeit) Atmosphere: ajaxRequest.onreadystatechange, new state: 2
atmosphere.js (3272,21)
Thu May 24 2018 08:54:28 GMT+0200 (Mitteleuropäische Sommerzeit) Atmosphere: ajaxRequest.onreadystatechange, new state: 3
atmosphere.js (3272,21)
Thu May 24 2018 08:54:28 GMT+0200 (Mitteleuropäische Sommerzeit) Atmosphere: ajaxRequest.onreadystatechange, new state: 4
atmosphere.js (3272,21)
Thu May 24 2018 08:54:29 GMT+0200 (Mitteleuropäische Sommerzeit) Atmosphere: ajaxRequest.onreadystatechange, new state: 2
atmosphere.js (3272,21)
Thu May 24 2018 08:54:29 GMT+0200 (Mitteleuropäische Sommerzeit) Atmosphere: Firing onOpen
atmosphere.js (3272,21)
Atmosphere connected using long-polling
utils.js (879,3)
Thu May 24 2018 08:54:29 GMT+0200 (Mitteleuropäische Sommerzeit) Atmosphere: Firing onOpen
atmosphere.js (3272,21)
Thu May 24 2018 08:54:29 GMT+0200 (Mitteleuropäische Sommerzeit) Atmosphere: ajaxRequest.onreadystatechange, new state: 3
atmosphere.js (3272,21)
But even though I can debug the server-side and see the message being written to the AtmosphereResource no data reaches the client.
This is how I initialize the atmosphere connection on client-side:
request = {
url: '<s:url value="/public/sse/ci" />',
contentType: "application/json",
method: 'POST',
logLevel: 'debug',
transport: 'sse',
reconnectInterval: 5000,
fallbackTransport: 'long-polling'
};
Can anyone give me a hint for the right direction?
Kind regards,
Sebastian

Okay.
Finally I got it working. Like in this stackoverflow question I had added the TrackMessageSizeInterceptor in my server configuration but not in the client configuration.
Maybe someone else comes here to read the answer.

Related

firebase deploy hangs without error (firebase tools 3.17.2)

I am attempting to deploy a firebase hosting project and I find it hangs and never progresses. The project has just been created with firebase init and only contains the index.html and 404.html files within the public folder.
The debug output from the command is
C:\VSProjects\wearable>firebase deploy --debug
[2018-01-30T12:34:39.086Z] ----------------------------------------------------------------------
[2018-01-30T12:34:39.093Z] CLI Version: 3.17.2
[2018-01-30T12:34:39.093Z] Platform: win32
[2018-01-30T12:34:39.095Z] Node Version: v9.4.0
[2018-01-30T12:34:39.103Z] Time: Tue Jan 30 2018 23:34:39 GMT+1100 (AUS Eastern Daylight Time)
[2018-01-30T12:34:39.103Z] ----------------------------------------------------------------------
[2018-01-30T12:34:39.129Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase", "https://www.googleapis.com/auth/cloud-platform"]
[2018-01-30T12:34:39.130Z] > authorizing via signed-in user
[2018-01-30T12:34:39.134Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/[project hidden]
Tue Jan 30 2018 23:34:39 GMT+1100 (AUS Eastern Daylight Time)
[2018-01-30T12:34:40.002Z] <<< HTTP RESPONSE 200 server=nginx, date=Tue, 30 Jan 2018 12:34:40 GMT, content-type=application/json; charset=utf-8, content-length=111, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store, via=HTTP/1.1 proxy10730
[2018-01-30T12:34:40.005Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/[project hidden]/tokens
Tue Jan 30 2018 23:34:40 GMT+1100 (AUS Eastern Daylight Time)
[2018-01-30T12:34:41.275Z] <<< HTTP RESPONSE 200 server=nginx, date=Tue, 30 Jan 2018 12:34:41 GMT, content-type=application/json; charset=utf-8, content-length=263, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store, via=HTTP/1.1 proxy10730
I have attempted the following:
a) Logout and login
b) return firebase tools 3.17.2
c) Node 9.3.0
Any assistance you can provide would be greatly appreciated.

hubot shell not loading scripts and packages

Hubot works when I have an adapter, but when I try to do local development using Shell none of the scripts or packages are loaded.
This works:
root#dev:~/hubot# bin/hubot forever start -w --watchDirectory ${PWD} --watchIgnore ${PWD}/*.log --pidfile ${PWD}/hubot.pid -l ${PWD}/hubot.log -a -c coffee node_modules/.bin/hubot --adapter slack
Strangely, when I try to do local development and testing with:
root#dev:~/hubot# bin/hubot
[Thu Apr 07 2016 00:33:10 GMT+0000 (UTC)] INFO hubot-redis-brain: Using default redis on localhost:6379
eve>
eve> help
usage:
history
exit, \q - close shell and exit
help, \? - print this usage
clear, \c - clear the terminal screen
None of my scripts or modules are showing when I type help in shell. But when I do this in slack, I see all the available scripts and modules:
eve <user> doesn't have <role> role - Removes a role from a user
eve <user> has <role> role - Assigns a role to a user
eve adapter - Reply with the adapter
eve delete reminder <action> - Delete reminder matching <action> (exact match required)
eve deploy <gitsha> to production - Runs Jenkins Phase 1 deployment.
eve echo <text> - Reply back with <text>
eve flip production pools - Flips the yin and yang production pools
eve help - Displays all of the help commands that Hubot knows about.
eve help <query> - Displays all help commands that match <query>.
eve list jobs - List current cron jobs
eve new job "<crontab format>" <message> - Schedule a cron job to say something
eve new job <crontab format> "<message>" - Ditto
eve new job <crontab format> say <message> - Ditto
eve ping - Reply with pong
** Update 1: I turned on debug level logging, and I can see the scripts are being parsed, but the scripts aren't available to me when executing their commands :(**
[Thu Apr 07 2016 00:46:44 GMT+0000 (UTC)] DEBUG Loading adapter shell
eve> [Thu Apr 07 2016 00:46:44 GMT+0000 (UTC)] DEBUG Loading scripts
from /root/hubot/scripts [Thu Apr 07 2016 00:46:44 GMT+0000 (UTC)]
DEBUG Parsing help for /root/hubot/scripts/example.coffee [Thu Apr 07
2016 00:46:44 GMT+0000 (UTC)] DEBUG Parsing help for
/root/hubot/scripts/prod_deploy.coffee [Thu Apr 07 2016 00:46:44
GMT+0000 (UTC)] DEBUG Parsing help for
/root/hubot/scripts/remindme.coffee [Thu Apr 07 2016 00:46:44 GMT+0000
(UTC)] DEBUG Parsing help for /root/hubot/scripts/team_tools.coffee
[Thu Apr 07 2016 00:46:44 GMT+0000 (UTC)] DEBUG Parsing help for
/root/hubot/scripts/update.coffee [Thu Apr 07 2016 00:46:44 GMT+0000
(UTC)] DEBUG Loading scripts from /root/hubot/src/scripts [Thu Apr 07
2016 00:46:44 GMT+0000 (UTC)] DEBUG Loading hubot-scripts from
/root/hubot/node_modules/hubot-scripts/src/scripts [Thu Apr 07 2016
00:46:44 GMT+0000 (UTC)] DEBUG Loading external-scripts from npm
packages [Thu Apr 07 2016 00:46:45 GMT+0000 (UTC)] DEBUG Parsing help
for /root/hubot/node_modules/hubot-diagnostics/src/diagnostics.coffee
[Thu Apr 07 2016 00:46:45 GMT+0000 (UTC)] INFO hubot-redis-brain:
Using default redis on localhost:6379 [Thu Apr 07 2016 00:46:45
GMT+0000 (UTC)] DEBUG Parsing help for
/root/hubot/node_modules/hubot-redis-brain/src/redis-brain.coffee [Thu
Apr 07 2016 00:46:45 GMT+0000 (UTC)] DEBUG Parsing help for
/root/hubot/node_modules/hubot-auth/src/auth.coffee [Thu Apr 07 2016
00:46:45 GMT+0000 (UTC)] DEBUG Parsing help for
/root/hubot/node_modules/hubot-help/src/help.coffee [Thu Apr 07 2016
00:46:45 GMT+0000 (UTC)] DEBUG Parsing help for
/root/hubot/node_modules/hubot-cron/src/scripts/cron.coffee
Update 2: I realized part of my problem was that in the bin/hubot file explicitly has my bot name as eve, while I have been trying it with evedev, my development hubot name. However, I'm still wondering why the help command does not show all the available commands, but when I'm in Slack, it does.
As answer to your Update 2, you need to put the bot's name before you type help, like this:
myhubot> help
usage:
history
exit, \q - close shell and exit
help, \? - print this usage
clear, \c - clear the terminal screen
vs
myhubot> myhubot help
myhubot> Shell: myhubot adapter - Reply with the adapter
myhubot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
myhubot echo <text> - Reply back with <text>
myhubot help - Displays all of the help commands that Hubot knows about.
myhubot help <query> - Displays all help commands that match <query>.
myhubot image me <query> - The Original. Queries Google Images for <query> and returns a random top result.
myhubot map me <query> - Returns a map view of the area returned by `query`.
myhubot mustache me <url|query> - Adds a mustache to the specified URL or query result.
myhubot ping - Reply with pong
myhubot pug bomb N - get N pugs
myhubot pug me - Receive a pug
myhubot the rules - Make sure hubot still knows the rules.
myhubot time - Reply with current time
myhubot translate me <phrase> - Searches for a translation for the <phrase> and then prints that bad boy out.
myhubot translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
ship it - Display a motivation squirrel
You can check your current robot name in bin/hubot
Looks like exec node_modules/.bin/hubot --name "botname" "$#"
With above setting the bot name will be botname

cloudControl deploys same build several times

I'm running a Spring-Boot application on cloudControl and a simple Jenkins task to check every 10 minutes whether the application is still available or not. So it occurs every couple days that the check-alive fails, but it is available again only minutes later. The cloudControl log says there was a deployment in these times, but the hash value of the build is the same as no changes were made.
Why are these (IMHO unnecessary) deployments happening?
[Wed Sep 10 12:20:16 2014] lb-101 INFO Routing requests to new version
[Wed Sep 10 12:20:44 2014] lb-102 INFO Routing requests to new version
[Wed Sep 10 16:43:50 2014] lxc-1752 INFO Deploying ...
[Wed Sep 10 16:44:03 2014] lxc-1752 INFO Deployed version: b6a4eb94702f9a9aaeb9baa367d7a74c8d1c75e8
[Wed Sep 10 16:44:03 2014] lb-97 INFO Routing requests to new version
[Wed Sep 10 16:44:03 2014] lb-98 INFO Routing requests to new version
...
[Mon Sep 15 08:44:01 2014] lxc-1767 INFO Deploying ...
[Mon Sep 15 08:44:16 2014] lxc-1767 INFO Deployed version: b6a4eb94702f9a9aaeb9baa367d7a74c8d1c75e8
[Mon Sep 15 08:44:16 2014] ngx-72 INFO Routing requests to new version
[Mon Sep 15 08:44:16 2014] lb-120 INFO Routing requests to new version
If a deployments is in the free tier its containers are hibernated to free up resources if not used. If hibernated deployments get a request a new container is started to serve that request. This is the behaviour you are seeing.
To avoid having your application hibernated simply scale the deployment up or out.

Meteor deploy only half works, with no error messages

I'm using meteor deploy with a little test app, and I'm finding that it sort of works, but doesn't complain about anything in the logs, so I'm not sure what to do next.
For example, the home page doesn't render, while accounts-entry is able to render only the password field of the sign-up page (not the email one)! It's really quite weird.
I'm using the npm package to include a node module, however removing this doesn't seem to make any difference.
I'm not sure where to look next to debug this?
The code is here:
https://github.com/jimmytidey/observatory
The app is here:
http://test_observatory.meteor.com
The logs look absolutely normal I think:
[Sun Jan 05 2014 11:07:59 GMT+0000 (UTC)] INFO HIT / 46.65.36.129
[Sun Jan 05 2014 11:07:59 GMT+0000 (UTC)] INFO HIT /f1db89943c1358003f76977ed6df57e9adf2aaa2.css 46.65.36.129
[Sun Jan 05 2014 11:07:59 GMT+0000 (UTC)] INFO HIT /537d85f650bdfb82439bc7d0c9e073f7b16684d6.js 46.65.36.129
[Sun Jan 05 2014 11:07:59 GMT+0000 (UTC)] INFO HIT /f1db89943c1358003f76977ed6df57e9adf2aaa2.css 46.65.36.129
[Sun Jan 05 2014 11:08:00 GMT+0000 (UTC)] INFO HIT /537d85f650bdfb82439bc7d0c9e073f7b16684d6.js 46.65.36.129
[Sun Jan 05 2014 11:08:48 GMT+0000 (UTC)] INFO HIT / 46.65.36.129
[Sun Jan 05 2014 11:08:53 GMT+0000 (UTC)] INFO HIT /sign-in 46.65.36.129
[Sun Jan 05 2014 11:08:59 GMT+0000 (UTC)] INFO HIT /sign-up 46.65.36.129
[Sun Jan 05 2014 11:09:34 GMT+0000 (UTC)] INFO HIT / 46.65.36.129
[Sun Jan 05 2014 11:09:39 GMT+0000 (UTC)] INFO HIT /sign-up 46.65.36.129
[Sun Jan 05 2014 11:10:51 GMT+0000 (UTC)] INFO HIT /_GALAXY_ 46.65.36.129
The errors seem to be on the client side, see the javascript console on your browser while visiting the page.
Errors with meteor logs only display the errors on the server side
The error seems to be a misspelling in Template.coffee for the word Template. (See https://github.com/jimmytidey/Observatory/blob/master/client/views/home/home.coffee#L1). I sent you a PR too.
This syntax error stops all of the code after it from running. This is why the router does not register its routes and nothing appears on the screen.
Silly typo ;-)

flex amf request not sent out anymore in AIR on Windows

I have a Flex application that runs in the browser and as standalone application with AIR. In our application, you can download a zip file which is generated at the server side containing a report. This zip file can be quite big (multiple GB) and takes a while to download. Basically, we do a HTTP POST from the client side:
m_file = new FileReference();
m_file.download( request, filename );
On the other hand, we send a ping from the client to the server each 15 seconds, to make sure the server is still there. The server responds to the ping with his name. When we do not get a response back in 30 seconds, we show the user a message that the server is down.
Now, the actual problem is that the ping request to the server never gets send while we are downloading the report. The strange thing is that this only happens in Adobe AIR on Windows. It is not a problem on Firefox on Windows. It is also not a problem with AIR on Mac OS X.
I have put some logging around the ping operation to show it:
[trace] 1: Mon Jul 16 16:00:20 GMT+0200 2012
[trace] return : 1: Mon Jul 16 16:00:20 GMT+0200 2012
[trace] 2: Mon Jul 16 16:00:35 GMT+0200 2012
[trace] return : 2: Mon Jul 16 16:00:35 GMT+0200 2012
[trace] 3: Mon Jul 16 16:00:50 GMT+0200 2012
[trace] return : 3: Mon Jul 16 16:00:50 GMT+0200 2012
[trace] 4: Mon Jul 16 16:01:05 GMT+0200 2012
[trace] 5: Mon Jul 16 16:01:20 GMT+0200 2012
[trace] 6: Mon Jul 16 16:01:35 GMT+0200 2012
[trace] 7: Mon Jul 16 16:01:50 GMT+0200 2012
[trace] fault 4: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] fault 5: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] fault 6: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] fault 7: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] 8: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] fault 8: Mon Jul 16 16:02:20 GMT+0200 2012
[trace] 9: Mon Jul 16 16:02:21 GMT+0200 2012
Player session terminated
[AIR Debug Launcher]: Process finished with exit code 1
You can see that operation 1, 2 and 3 ran fine and returned immediately. At that point, we start the report download. Notice how operation 4 does not return immediately. After 15 seconds, operation 5 starts, then 6 and 7, each 15 seconds apart.
Then suddenly, exactly after 1 minute, operation 4 returns into the fault handler as does all the other requests that where started during that 1 minute.
Note that in the background, the HTTP POST keeps running as long as the AIR app keeps running (checked with Charles). The ping request itself does not show up in charles, nor do I see them in the BlazeDS debug loggin if I enable that. It is like the AIR application never even tries to do the ping request on the server.
Is there anybody who has an idea what might be wrong? Any additional things I can check/debug?
I am using Flex SDK 4.5 and Adobe AIR 3.3
Maybe this is due to a HTTP connection limit on Windows. I found this post that describes a similar issue: Adobe AIR HTTP Connection Limit

Resources