JSP/SERVLET
2018.02.19 / 01:11

[spring boot] chat¸¸µé±â

µðÆÌ
Ãßõ ¼ö 276

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



Ãâó: http://devkyu.tistory.com/711 [õõÈ÷, ºü¸£°Ô. °³¹ßÀÚÀÇ Repository]