🤔 chatroom/roomA/+/profile로 subscribe를 하면
chatroom/roomA/userA/message (X)
chatroom/roomA/userA/profile (O)
chatroom/roomA/userA/status (X)
chatroom/roomA/userB/message (X)
chatroom/roomA/userB/profile (O)
chatroom/roomA/userB/status (X)
chatroom/roomB/userC/message (X)
chatroom/roomB/userC/profile (X)
chatroom/roomB/userC/status (X)
chatroom/roomB/userD/message (X)
chatroom/roomB/userD/profile (X)
chatroom/roomB/userD/status (X)
👉 roomA와 profile이 있는 topic에 모두 subscribe 한다.
🤔 chatroom/roomA/# 로 subscribe를 하면
chatroom/roomA/userA/message (O)
chatroom/roomA/userA/profile (O)
chatroom/roomA/userA/status (O)
chatroom/roomA/userB/message (O)
chatroom/roomA/userB/profile (O)
chatroom/roomA/userB/status (O)
chatroom/roomB/userC/message (X)
chatroom/roomB/userC/profile (X)
chatroom/roomB/userC/status (X)
chatroom/roomB/userD/message (X)
chatroom/roomB/userD/profile (X)
chatroom/roomB/userD/status (X)
👉 roomA 의 모든 topic을 subscribe 한다.
이제 이것을 응용해 mqtt를 이용한 간단한 채팅앱에 적용해보자!