개발자 Q&A

개발하다 막혔다면? 여기서 질문하세요! 초보부터 고수까지, 함께 고민하고 해결하는 공간입니다. 누구나 자유롭게 질문하고 답변을 남겨보세요!

2025.05.08 02:07

Stomp::send 메서드 사용 시 오류가 발생하는 이유를 알려주세요.

목록
  • 웹앱구루 26일 전 2025.05.08 02:07 인기
  • 265
    1
제가 Stomp::send 메서드를 사용하여 메시지를 보낼 때, 다음과 같은 오류가 발생합니다.

php

$connection = new Stomp('ws://localhost:61614');

$connection->connect();

$connection->send('/queue/test', 'Hello, World!');



오류 메시지는 다음과 같습니다.



Error: Stomp::send failed: Connection is closed



왜 이러한 오류가 발생하고, 어떻게 해결할 수 있는지 알려주세요.

    댓글목록

    profile_image
    나우호스팅  26일 전



    Stomp::send 메서드 사용 시 오류가 발생하는 이유는 연결이 끊어졌기 때문입니다.

    오류 메시지에 Connection is closed라는 문구가 포함되어 있기 때문에, 연결이 끊어진 것으로 추정할 수 있습니다.

    이러한 오류를 해결하기 위해서는 연결이 끊어지기 전에 메시지를 전송해야 합니다.

    한 가지 방법은 connect 메서드와 send 메서드를 동시에 호출하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connectAndSend('/queue/test', 'Hello, World!');
    
    


    또는 connect 메서드를 호출한 후 send 메서드를 호출하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    


    이러한 방법을 통해 연결이 끊어지기 전에 메시지를 전송할 수 있습니다.

    또한, 오류 메시지를 확인하여 더 자세한 정보를 얻을 수 있습니다. 오류 메시지에 Connection is closed라는 문구가 포함되어 있기 때문에, 연결이 끊어진 것으로 추정할 수 있습니다.

    이러한 오류를 해결하기 위해서는 연결을 유지하는 방법을 찾아야 합니다.

    한 가지 방법은 연결을 유지하기 위한 keep-alive 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/keep-alive', 'keep-alive');
    
    


    또는 연결을 유지하기 위한 heartbeat 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/heartbeat', 'heartbeat');
    
    


    이러한 방법을 통해 연결을 유지할 수 있습니다.

    또한, 오류 메시지를 확인하여 더 자세한 정보를 얻을 수 있습니다. 오류 메시지에 Connection is closed라는 문구가 포함되어 있기 때문에, 연결이 끊어진 것으로 추정할 수 있습니다.

    이러한 오류를 해결하기 위해서는 연결을 유지하는 방법을 찾아야 합니다.

    한 가지 방법은 연결을 유지하기 위한 keep-alive 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/keep-alive', 'keep-alive');
    
    


    또는 연결을 유지하기 위한 heartbeat 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/heartbeat', 'heartbeat');
    
    


    이러한 방법을 통해 연결을 유지할 수 있습니다.

    또한, 오류 메시지를 확인하여 더 자세한 정보를 얻을 수 있습니다. 오류 메시지에 Connection is closed라는 문구가 포함되어 있기 때문에, 연결이 끊어진 것으로 추정할 수 있습니다.

    이러한 오류를 해결하기 위해서는 연결을 유지하는 방법을 찾아야 합니다.

    한 가지 방법은 연결을 유지하기 위한 keep-alive 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/keep-alive', 'keep-alive');
    
    


    또는 연결을 유지하기 위한 heartbeat 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/heartbeat', 'heartbeat');
    
    


    이러한 방법을 통해 연결을 유지할 수 있습니다.

    또한, 오류 메시지를 확인하여 더 자세한 정보를 얻을 수 있습니다. 오류 메시지에 Connection is closed라는 문구가 포함되어 있기 때문에, 연결이 끊어진 것으로 추정할 수 있습니다.

    이러한 오류를 해결하기 위해서는 연결을 유지하는 방법을 찾아야 합니다.

    한 가지 방법은 연결을 유지하기 위한 keep-alive 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/keep-alive', 'keep-alive');
    
    


    또는 연결을 유지하기 위한 heartbeat 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/heartbeat', 'heartbeat');
    
    


    이러한 방법을 통해 연결을 유지할 수 있습니다.

    또한, 오류 메시지를 확인하여 더 자세한 정보를 얻을 수 있습니다. 오류 메시지에 Connection is closed라는 문구가 포함되어 있기 때문에, 연결이 끊어진 것으로 추정할 수 있습니다.

    이러한 오류를 해결하기 위해서는 연결을 유지하는 방법을 찾아야 합니다.

    한 가지 방법은 연결을 유지하기 위한 keep-alive 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/keep-alive', 'keep-alive');
    
    


    또는 연결을 유지하기 위한 heartbeat 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/heartbeat', 'heartbeat');
    
    


    이러한 방법을 통해 연결을 유지할 수 있습니다.

    또한, 오류 메시지를 확인하여 더 자세한 정보를 얻을 수 있습니다. 오류 메시지에 Connection is closed라는 문구가 포함되어 있기 때문에, 연결이 끊어진 것으로 추정할 수 있습니다.

    이러한 오류를 해결하기 위해서는 연결을 유지하는 방법을 찾아야 합니다.

    한 가지 방법은 연결을 유지하기 위한 keep-alive 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/keep-alive', 'keep-alive');
    
    


    또는 연결을 유지하기 위한 heartbeat 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/heartbeat', 'heartbeat');
    
    


    이러한 방법을 통해 연결을 유지할 수 있습니다.

    또한, 오류 메시지를 확인하여 더 자세한 정보를 얻을 수 있습니다. 오류 메시지에 Connection is closed라는 문구가 포함되어 있기 때문에, 연결이 끊어진 것으로 추정할 수 있습니다.

    이러한 오류를 해결하기 위해서는 연결을 유지하는 방법을 찾아야 합니다.

    한 가지 방법은 연결을 유지하기 위한 keep-alive 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/keep-alive', 'keep-alive');
    
    


    또는 연결을 유지하기 위한 heartbeat 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/heartbeat', 'heartbeat');
    
    


    이러한 방법을 통해 연결을 유지할 수 있습니다.

    또한, 오류 메시지를 확인하여 더 자세한 정보를 얻을 수 있습니다. 오류 메시지에 Connection is closed라는 문구가 포함되어 있기 때문에, 연결이 끊어진 것으로 추정할 수 있습니다.

    이러한 오류를 해결하기 위해서는 연결을 유지하는 방법을 찾아야 합니다.

    한 가지 방법은 연결을 유지하기 위한 keep-alive 메시지를 전송하는 것입니다.

    #hostingforum.kr
    php
    
    $connection = new Stomp('ws://localhost:61614');
    
    $connection->connect();
    
    $connection->send('/queue/test', 'Hello, World!');
    
    $connection->send('/queue/keep-alive', 'keep-alive');
    
    


    또는 연결을 유지하기 위한 heartbeat 메시지를 전송하는 것입니다.

    ```php
    $connection = new Stomp('ws://localhost:61614');
    $connection->connect();
    $connection->send('/queue/test', 'Hello, World!');
    $connection

    2025-05-08 02:08

  • 개발자 Q&A 포인트 정책
      글쓰기
      50P
      댓글
      10P
  • 전체 24,689건 / 436 페이지

검색

게시물 검색