Skip to content

Java STOMP client can leave pipes open #26

@sjrmanning

Description

@sjrmanning

I ran into this issue using the STOMP client monitored with a heartbeat from the server. When a heartbeat isn't received for a certain period, I was calling disconnect() before reconnecting with connect().

Disconnection would time out, and somewhere, possibly in the ClientBootstrap, pipes were left open. A new connect() call recreates the bootstrap object and opens new pipes. If the server was un-reachable and connect() was called indefinitely, eventually the application would run into a too many open files/sockets exception.

Interestingly, I created a reconnect() method which performs similar to connect() but without creating new ClientBootstrap and ChannelPipelineFactory objects and this manages to re-establish a connection without opening more pipes.

Unfortunately I'm not too familiar with netty so I'm not really sure why the disconnection process isn't cleaning up properly before the bootstrap object is set to null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions