개발자_이훈규
천천히, 빠르게. 개발자의 Repository
개발자_이훈규
전체 방문자
오늘
어제
  • 분류 전체보기 (473)
    • 티스토리 (4)
    • 개발자 뉴스 (2)
    • 소프트웨어 (203)
      • C (7)
      • c++ (25)
      • Objective-C (3)
      • Do it! 반응형 웹디자인 (4)
      • openGL (8)
      • Java (24)
      • Jni (3)
      • Android (9)
      • Wordpress (2)
      • 버그 만난 후 느낀점 (2)
      • Git (3)
      • node js (2)
      • window tablet (1)
      • HTML (3)
      • javascript (3)
      • perl (1)
      • AngularJS (0)
      • JSON (0)
      • Docker (3)
      • python (5)
      • jQuery (1)
      • MFC (4)
      • cocos studio (6)
      • Golang (1)
      • SQLite3 (0)
      • Spring Boot (8)
      • thymeleaf (0)
      • Django (0)
      • iOS (3)
      • skia (0)
      • VBA (0)
      • PHP (2)
      • Oracle (1)
      • JSP (0)
      • R (0)
    • TCP IP (2)
    • 금융 (0)
      • 금융 Study (0)
      • 금융 Archive (0)
      • 금융 Article (0)
    • 개인 프로젝트 (7)
      • gif 홈페이지 만들기 (0)
      • study app만들기 (0)
      • 크롤러 만들기 (1)
      • 카툰 홈페이지 만들기 (1)
      • 외주 홈페이지 만들기 (3)
      • 웹 홈페이지 만들기 (0)
      • 미디어 서버 만들기 (0)
      • 소개팅 어플 만들기 (0)
      • 인스타그램 풀스택 클론 코딩(인강 노트) (0)
      • 주식 모의거래 만들기 (1)
    • html php mysql (0)
    • node.Js (2)
    • 일상 (2)
    • 빈공간 uml 공부 (0)
    • Ubuntu(linux) (12)
    • 맥OS (10)
      • android 설치하기 (2)
    • Programming quizzes (0)
    • IoT (구 유비쿼터스) (16)
      • 라즈베리 파이 (11)
      • 아두이노 (5)
    • 하드웨어 (5)
      • 아수스 비보탭 노트8 asus vivotap no.. (2)
      • 크레마 카르타 (3)
    • 분석할 문장, 구문, 코드 (0)
    • 키보드 (1)
      • 해피해킹 (1)
    • 코드 라이언 (0)
    • 전자기기 (4)
    • Ted (0)
    • NAS (0)
    • 알고리즘 (0)
    • 연합인포맥스 (0)
    • 이벤트 응모함 (4)

블로그 메뉴

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

공지사항

인기 글

태그

  • 개발
  • GIT
  • C
  • 설명
  • Example
  • 라즈베리 파이
  • 우분투
  • ubuntu
  • error
  • install
  • 설치
  • 코드
  • 소스
  • Python
  • 에러
  • C++
  • CODE
  • 방법
  • 예제
  • Java

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
개발자_이훈규

천천히, 빠르게. 개발자의 Repository

카테고리 없음

[spring boot] chat만들기

2017. 5. 20. 19:21

spring boot로 서버를 만들어보자.


db는 mySQL

websocket을 사용한다


동작하는 순서

1. Keyword로 방에 접속한다.

2. 방에 접속이 되면서 해당 세션에 연결이 된다. (대화방 하나당 세션 하나)

2. 접속된 방에 저장된 대화를 전부 갖고 온다.(JSON으로 갖고 와서 client에서 출력한다.)

3. 이제부터 말하는 대화는 서버에 저장이 되고, 세션에 연결된 사람들에게 전부 broad cast된다.

(본인이 전송한 글은 client에서 전달을 하고, 서버에서 fail이 전송되면 재전송 버튼이 생성된다.

서버에선 author와 session의 id가 동일할 경우 전송에서 제외시킨다.)


DB에 대해서

DB에 keyword키도 추가해서 만들면 되겠다.

keyword, author, content, date



Reference

Spring 예제

1. https://spring.io/guides/gs/messaging-stomp-websocket/


2. 세션을 기록하고 세션으로 메세지를 echo하는게 인상적이다.

http://souning.tistory.com/13


Spring boot 예제

1. 도움은 되지만 클래스 하나가 비어있다.

https://code.tutsplus.com/tutorials/build-a-real-time-chat-application-with-modulus-and-spring-boot--cms-22513


session 관리에 대해서

1. http://jinhokwon.tistory.com/22

Redis vs HttpSession

2. http://arahansa.github.io/docs_spring/session.html

뭔가 정리가 많이 되어 있다.


stomp에 대해서

1. 동적으로 destination이 바뀔 경우

https://stackoverflow.com/questions/27047310/path-variables-in-spring-websockets-sendto-mapping


2. js의 send에서 여러 parameter를 전송할 경우


3. registry.addEndpoint를 여러개 추가할 경우

https://stackoverflow.com/questions/26211248/websockets-is-it-possible-to-add-multiple-endpoints-using-sockjs

  1) 하나 추가를 한 뒤에 더 추가할 수 있는지

     -> 실험 결과 여러개를 추가해도 상관없다. 하지만 client가 calling을 하는 방법은 아이디어가 없다.


4. 특정 사람에게만 전달하기

https://stackoverflow.com/questions/27047310/path-variables-in-spring-websockets-sendto-mapping


5. stomp를 사용하지 않고 textsocket?(?)을 사용하는 예제

http://loveiskey.tistory.com/126



내가 구현하려고 했던 내용의 블로그를 찾았다.

https://www.sitepoint.com/implementing-spring-websocket-server-and-client/



세션을 연결하는 것

https://stackoverflow.com/questions/42327780/springwebsocketstomp-message-to-specific-session-not-user



-------------

TextWebSocketHandler를 사용해서 구현하는 방법


1. session에 parameter넣어서 넘기기

hint : http://mobilenweb.tistory.com/174

->우회 방법 : 세션에 넣지 않고 최초에 입력되는 것에 의미를 부여한다. (http://nowonbun.tistory.com/286)


2. date format에 대해서

1) TIMESTAMP annotation은 java->mysql을 할 때 데이터 타입을 변한해준다는 의미이지 실제 데이터를 넣어 준다는 것은 아니다.

(http://sybase.public.powerdesigner.general.narkive.com/BF3dCuW5/ejb3-entity-how-can-i-get-temporal-temporaltype-timestamp)




Client로 안드로이드로 구현하기


안드로이드로 채팅 구현하기

http://bcho.tistory.com/1058


websocket을 구헌한 클래스

https://stackoverflow.com/questions/34131718/what-is-a-simple-way-to-implement-a-websocket-client-in-android-is-the-followin


soft keyboard 이벤트 발생시 background가 뭉개지는 것을 막으려면 background를 thema에 넣어버린다.

https://stackoverflow.com/questions/5965857/how-to-keep-background-image-size-when-software-keyboard-show

저작자표시 (새창열림)
    개발자_이훈규
    개발자_이훈규
    혼자 꽁양꽁양 개발하면서 놀아요~ - 노트같은 블로그

    티스토리툴바