mrstampy / Stampy

Java implementation of the STOMP 1.2 specification
67 stars 22 forks source link

toStompMessage appends "null" to certain messages #8

Open rworsnop opened 10 years ago

rworsnop commented 10 years ago

If a message doesn't have a body (e.g., "CONNECT"), toStompMessage includes the text "null" in the String.

The line "builder.append(body);" should be surrounded with a null check.

smartrics commented 8 years ago

Hello - when do you think to release Stampy with this fix (if ever)?

teknopaul commented 6 years ago

To workaround I have to override the postHeader() method which actually writes the body??

    gateway.connect();
    Thread.sleep(1000L);
    HostPort hostPort = gateway.getConnectedHostPorts().iterator().next();
    gateway.sendMessage(new ConnectMessage("1.2", "localhost") {
        @Override
        protected String postHeader() {
            return "";
        }
    }, hostPort);

Then I can connect but I don't get message callbacks yet.

rworsnop commented 6 years ago

This is a dead project. No commits since Feb 2013. There's a pull request for this issue, but it was never merged: https://github.com/mrstampy/Stampy/pull/9 I ended up switching to Spring's STOMP support instead - and then noticed some behavior differences that were due to other Stampy bugs.

teknopaul commented 6 years ago

Looks that way. I added the work around in case anyone else was reading this.

Cheers for the Spring heads-up I did not know they had STOMP support.

rworsnop commented 6 years ago

Yep - I was able to do everything I wanted to do using these classes: https://github.com/spring-projects/spring-framework/tree/master/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp