Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AtmosphereResource Initial Suspended's uuid is null when using streaming + POST #537

Closed
PavelR577 opened this issue Jul 27, 2012 · 25 comments

Comments

@PavelR577
Copy link

If I use streaming and then do a POST then this:

request.getAttribute("org.atmosphere.cpr.AtmosphereResource.webSocket.handshake") returns null

when it's used with websocket it works fine.

@jfarcand
Copy link
Member

Yes, that value only apply to WebSocket. There is no handshake for HTTP as there is only one AtmosphereResource per connection.

@jfarcand
Copy link
Member

You can use the HeaderConfig.X_ATMOSPHERE_TRACKING_ID to retrieve the UUID that was created for that client (the AtmosphereResource associated with the connection that was suspended)

@PavelR577
Copy link
Author

How can I use the X_ATMOSPHERE_TRACKING_ID to retrieve the UUID? is there a util for this?

@PavelR577
Copy link
Author

I'm not following you - you're saying that the HeaderConfig.X_ATMOSPHERE_TRACKING_ID and the UUID are the same one?

@jfarcand
Copy link
Member

The UUID of the client is always set using the Server's UUID, and passed via the HeaderConfig.X_ATMOSPHERE_TRACKING_ID . I need to document that, I know :-)

@jfarcand
Copy link
Member

To make things simple, I will also set that value for all transport. I will rename to org.atmosphere.cpr.AtmosphereResource.suspended the key value. OK?

@jfarcand jfarcand reopened this Jul 27, 2012
@jfarcand
Copy link
Member

OK unified the processing and now using

ApplicationConfig.SUSPENDED_ATMOSPHERE_RESOURCE_UUID

will always return the first suspended AtmosphereResource's uuid for all transport.

jfarcand added a commit that referenced this issue Jul 27, 2012
jfarcand added a commit that referenced this issue Jul 27, 2012
jfarcand added a commit that referenced this issue Jul 27, 2012
jfarcand added a commit that referenced this issue Jul 27, 2012
@PavelR577
Copy link
Author

Are you sure they should be the same? cause they are different.

this
((AtmosphereResource) request.getAttribute(FrameworkConfig.ATMOSPHERE_RESOURCE)).uuid (from the handshake)
and
the X_ATMOSPHERE_TRACKING_ID on the client side
returns different values
I've tested it with the beta4 not with the fixed you just did.

@PavelR577
Copy link
Author

remind me how do I download the latest version, including your commits? :)
I'll test it right now...

@jfarcand
Copy link
Member

The easiest way is to clone the workspace on github:

%  git clone https://github.com/Atmosphere/atmosphere.git
% cd atmosphere
% mvn -DskipTests=true

or add the following in your ~/.m2/settings.xml

                <repository>
                    <id>oss-snapshot</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>

and use 1.0.0-SNAPSHOT in your project.

@PavelR577
Copy link
Author

already figured that one -
I'm a little bit confused - please see image attached (tested with the commit you just did)

http://s12.postimage.org/eaj4bo7ul/uuid.png

@PavelR577
Copy link
Author

http://postimage.org/image/msskg0ed5/

better image quality :)

@jfarcand
Copy link
Member

Hum...are you setting that value? I don't see that value, but let me denug.

@jfarcand
Copy link
Member

My bad, fixing it.

@PavelR577
Copy link
Author

no problem... let me know when I can test it :)

jfarcand added a commit that referenced this issue Jul 27, 2012
@jfarcand
Copy link
Member

OK, pull again :-)

@PavelR577
Copy link
Author

testing

@PavelR577
Copy link
Author

are you sure you commited it?
I'm checking it here : https://oss.sonatype.org/content/repositories/snapshots/org/atmosphere/atmosphere-runtime/1.0.0-SNAPSHOT/
and I dont see any new commits...

@jfarcand
Copy link
Member

I was under the impression you used the workspace :-) Let me deploy it manually.

@PavelR577
Copy link
Author

I'm not sure but it looks like something is messed up with the uuid in the latest snapshot.
Please see image : http://postimage.org/image/u72s4iwaz/

@jfarcand
Copy link
Member

Grrr. Thanks for the help. Let me test and write test before pushing crappy code.

@jfarcand
Copy link
Member

OK try again.

@PavelR577
Copy link
Author

Can you deploy it manually ? I tried adding it to the pom but it says dependency not found

I've added this:

<repository>
            <id>oss-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>

  <dependency>
         <groupId>org.atmosphere</groupId>
         <artifactId>atmosphere-runtime</artifactId>
         <version>1.0.0-SNAPSHOT</version>
      </dependency>

jfarcand added a commit that referenced this issue Jul 27, 2012
@jfarcand
Copy link
Member

Uploaded, test case added. Bt always wrap your code here using '''

@PavelR577
Copy link
Author

OK - websocket is now working correcty but there's and issue with streaming.
For some reason in when using streaming in the GET
request.getAttribute("org.atmosphere.cpr.AtmosphereResourcesuspended.uuid")
and
resource.uuid
returns different values.
Later on in the POST I'm able to access the suspended resource by the using the second uuid I got in the GET(resource.uuid)

Please see image attached.
http://postimage.org/image/6acq9ervv/

We're almost there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants