question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This is confusing

See original GitHub issue

Hi,

Sorry to bother you, but I wanted to give you some feedback. As a noob, the whole tutorial feels rather contrived and far from trivial. Here are a few suggestions how it could be made more “friendlier”.

First, emphasize that it’s not raw websockets, but “STOMP” over websockets. Most of us never heard of STOMP. At least a brief introduction of how STOMP works should be provided …and it would be nice to now if raw websockets are possible.

Secondly, the whole is written upside down. You first write controllers, topic subscriptions, message brokers, endpoints, application destination prefix (do we really need that one?!) without really understanding why, and it’s just confusing.

Here as well, an introduction should first be provided. An overview about the flow and the pupose of each “thing”, before diving into the code. Ideally with a nice picture, to help understand how it all fits together.

Lastly, the HTML / js example is bloated, the only thing you need would be something like:

<body>
    <button id="connect" onclick="connect()">Connect</button>
    <button id="disconnect" onclick="disconnect()" disabled>Disconnect</button>
    <hr/>
    What is your name? <input id="name" /><button onclick="sendName()">Send</button>
    <hr/>
    <pre id="greetings"></pre>
</body>

Best Regards

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dagneliescommented, Jul 11, 2017

Lastly, despite it’s complexity, it leaves big question marks on how to do simple things because of the STOMP abstraction. How whould you:

  • get a list of connected clients
  • how to perform some sort of authentication
  • how to get “session” data

Using something like raw websockets feels much more trivial:

import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
    
@ServerEndpoint("/actions")
public class DeviceWebSocketServer {

    @OnOpen
    public void open(Session session) {
    }

    @OnClose
    public void close(Session session) {
    }

    @OnError
    public void onError(Throwable error) {
    }

    @OnMessage
    public void handleMessage(String message, Session session) {
    }
}    

…I just wonder if it’s well compatible with the rest of spring.

0reactions
dsyercommented, Sep 28, 2020

I added a sentence.

Read more comments on GitHub >

github_iconTop Results From Across the Web

This Is Confusing | Spotify
Listen to This Is Confusing on Spotify. Artist · 1 monthly listeners.
Read more >
It is confusing or it is confused? - TextRanch
NO, it is confusing, as one of the organisations is not registered. It is absolutely true that it is confusing for consumers and...
Read more >
This Is So Confusing GIFs - Tenor
With Tenor, maker of GIF Keyboard, add popular This Is So Confusing animated GIFs to your conversations. Share the best GIFs now >>>...
Read more >
This Is Confusing - Facebook
In honor of the 20th anniversary of Kurt Cobain's death, here is a tribute video we put together featuring our own song "April"...
Read more >
This-is-confusing GIFs - Get the best GIF on GIPHY
Explore and share the best This-is-confusing GIFs and most popular animated GIFs here on GIPHY. Find Funny GIFs, Cute GIFs, Reaction GIFs and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found