[spring boot] chat¸¸µé±â
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ÇÏ´Â°Ô ÀλóÀûÀÌ´Ù.
Spring boot ¿¹Á¦
1. µµ¿òÀº µÇÁö¸¸ Ŭ·¡½º Çϳª°¡ ºñ¾îÀÖ´Ù.
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¸¦ ¿©·¯°³ Ãß°¡ÇÒ °æ¿ì
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/
¼¼¼ÇÀ» ¿¬°áÇÏ´Â °Í
-------------
TextWebSocketHandler¸¦ »ç¿ëÇؼ ±¸ÇöÇÏ´Â ¹æ¹ý
1. session¿¡ parameter³Ö¾î¼ ³Ñ±â±â
hint : http://mobilenweb.tistory.com/174
->¿ìȸ ¹æ¹ý : ¼¼¼Ç¿¡ ³ÖÁö ¾Ê°í ÃÖÃÊ¿¡ ÀԷµǴ °Í¿¡ Àǹ̸¦ ºÎ¿©ÇÑ´Ù. (http://nowonbun.tistory.com/286)
2. date format¿¡ ´ëÇؼ
1) TIMESTAMP annotationÀº java->mysqlÀ» ÇÒ ¶§ µ¥ÀÌÅÍ Å¸ÀÔÀ» º¯ÇÑÇØÁشٴ ÀǹÌÀÌÁö ½ÇÁ¦ µ¥ÀÌÅ͸¦ ³Ö¾î Áشٴ °ÍÀº ¾Æ´Ï´Ù.
Client·Î ¾Èµå·ÎÀ̵å·Î ±¸ÇöÇϱâ
¾Èµå·ÎÀ̵å·Î äÆà ±¸ÇöÇϱâ
websocketÀ» ±¸ÇåÇÑ Å¬·¡½º
soft keyboard À̺¥Æ® ¹ß»ý½Ã background°¡ ¹¶°³Áö´Â °ÍÀ» ¸·À¸·Á¸é background¸¦ thema¿¡ ³Ö¾î¹ö¸°´Ù.
Ãâó: http://devkyu.tistory.com/711 [õõÈ÷, ºü¸£°Ô. °³¹ßÀÚÀÇ Repository]