[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FD0B6WHZRE3CSP0V730CY8":3,"skill-same:01M6FD0B6WHZRE3CSP0V730CY8":50},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":23,"linkOnly":24,"markdownContent":25,"markdownBody":25,"frontMatter":26,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M6FD0B6WHZRE3CSP0V730CY8","azure-communication-chat-java",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-communication-chat-java\u002FSKILL.md",[],[18,19,20,21,22],"azure","azure communication chat java","communication","java","chat","2026-11-10 10:12:30",false,"# Azure Communication Chat (Java)\n\nBuild real-time chat applications with thread management, messaging, participants, and read receipts.\n\n## Installation\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>com.azure\u003C\u002FgroupId>\n    \u003CartifactId>azure-communication-chat\u003C\u002FartifactId>\n    \u003Cversion>1.6.0\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\n## Client Creation\n\n```java\nimport com.azure.communication.chat.ChatClient;\nimport com.azure.communication.chat.ChatClientBuilder;\nimport com.azure.communication.chat.ChatThreadClient;\nimport com.azure.communication.common.CommunicationTokenCredential;\n\n\u002F\u002F ChatClient requires a CommunicationTokenCredential (user access token)\nString endpoint = \"https:\u002F\u002F\u003Cresource>.communication.azure.com\";\nString userAccessToken = \"\u003Cuser-access-token>\";\n\nCommunicationTokenCredential credential = new CommunicationTokenCredential(userAccessToken);\n\nChatClient chatClient = new ChatClientBuilder()\n    .endpoint(endpoint)\n    .credential(credential)\n    .buildClient();\n\n\u002F\u002F Async client\nChatAsyncClient chatAsyncClient = new ChatClientBuilder()\n    .endpoint(endpoint)\n    .credential(credential)\n    .buildAsyncClient();\n```\n\n## Key Concepts\n\n| Class | Purpose |\n|-------|---------|\n| `ChatClient` | Create\u002Fdelete chat threads, get thread clients |\n| `ChatThreadClient` | Operations within a thread (messages, participants, receipts) |\n| `ChatParticipant` | User in a chat thread with display name |\n| `ChatMessage` | Message content, type, sender info, timestamps |\n| `ChatMessageReadReceipt` | Read receipt tracking per participant |\n\n## Create Chat Thread\n\n```java\nimport com.azure.communication.chat.models.*;\nimport com.azure.communication.common.CommunicationUserIdentifier;\nimport java.util.ArrayList;\nimport java.util.List;\n\n\u002F\u002F Define participants\nList\u003CChatParticipant> participants = new ArrayList\u003C>();\n\nChatParticipant participant1 = new ChatParticipant()\n    .setCommunicationIdentifier(new CommunicationUserIdentifier(\"\u003Cuser-id-1>\"))\n    .setDisplayName(\"Alice\");\n\nChatParticipant participant2 = new ChatParticipant()\n    .setCommunicationIdentifier(new CommunicationUserIdentifier(\"\u003Cuser-id-2>\"))\n    .setDisplayName(\"Bob\");\n\nparticipants.add(participant1);\nparticipants.add(participant2);\n\n\u002F\u002F Create thread\nCreateChatThreadOptions options = new CreateChatThreadOptions(\"Project Discussion\")\n    .setParticipants(participants);\n\nCreateChatThreadResult result = chatClient.createChatThread(options);\nString threadId = result.getChatThread().getId();\n\n\u002F\u002F Get thread client for operations\nChatThreadClient threadClient = chatClient.getChatThreadClient(threadId);\n```\n\n## Send Messages\n\n```java\n\u002F\u002F Send text message\nSendChatMessageOptions messageOptions = new SendChatMessageOptions()\n    .setContent(\"Hello, team!\")\n    .setSenderDisplayName(\"Alice\")\n    .setType(ChatMessageType.TEXT);\n\nSendChatMessageResult sendResult = threadClient.sendMessage(messageOptions);\nString messageId = sendResult.getId();\n\n\u002F\u002F Send HTML message\nSendChatMessageOptions htmlOptions = new SendChatMessageOptions()\n    .setContent(\"\u003Cstrong>Important:\u003C\u002Fstrong> Meeting at 3pm\")\n    .setType(ChatMessageType.HTML);\n\nthreadClient.sendMessage(htmlOptions);\n```\n\n## Get Messages\n\n```java\nimport com.azure.core.util.paging.PagedIterable;\n\n\u002F\u002F List all messages\nPagedIterable\u003CChatMessage> messages = threadClient.listMessages();\n\nfor (ChatMessage message : messages) {\n    System.out.println(\"ID: \" + message.getId());\n    System.out.println(\"Type: \" + message.getType());\n    System.out.println(\"Content: \" + message.getContent().getMessage());\n    System.out.println(\"Sender: \" + message.getSenderDisplayName());\n    System.out.println(\"Created: \" + message.getCreatedOn());\n    \n    \u002F\u002F Check if edited or deleted\n    if (message.getEditedOn() != null) {\n        System.out.println(\"Edited: \" + message.getEditedOn());\n    }\n    if (message.getDeletedOn() != null) {\n        System.out.println(\"Deleted: \" + message.getDeletedOn());\n    }\n}\n\n\u002F\u002F Get specific message\nChatMessage message = threadClient.getMessage(messageId);\n```\n\n## Update and Delete Messages\n\n```java\n\u002F\u002F Update message\nUpdateChatMessageOptions updateOptions = new UpdateChatMessageOptions()\n    .setContent(\"Updated message content\");\n\nthreadClient.updateMessage(messageId, updateOptions);\n\n\u002F\u002F Delete message\nthreadClient.deleteMessage(messageId);\n```\n\n## Manage Participants\n\n```java\n\u002F\u002F List participants\nPagedIterable\u003CChatParticipant> participants = threadClient.listParticipants();\n\nfor (ChatParticipant participant : participants) {\n    CommunicationUserIdentifier user = \n        (CommunicationUserIdentifier) participant.getCommunicationIdentifier();\n    System.out.println(\"User: \" + user.getId());\n    System.out.println(\"Display Name: \" + participant.getDisplayName());\n}\n\n\u002F\u002F Add participants\nList\u003CChatParticipant> newParticipants = new ArrayList\u003C>();\nnewParticipants.add(new ChatParticipant()\n    .setCommunicationIdentifier(new CommunicationUserIdentifier(\"\u003Cnew-user-id>\"))\n    .setDisplayName(\"Charlie\")\n    .setShareHistoryTime(OffsetDateTime.now().minusDays(7))); \u002F\u002F Share last 7 days\n\nthreadClient.addParticipants(newParticipants);\n\n\u002F\u002F Remove participant\nCommunicationUserIdentifier userToRemove = new CommunicationUserIdentifier(\"\u003Cuser-id>\");\nthreadClient.removeParticipant(userToRemove);\n```\n\n## Read Receipts\n\n```java\n\u002F\u002F Send read receipt\nthreadClient.sendReadReceipt(messageId);\n\n\u002F\u002F Get read receipts\nPagedIterable\u003CChatMessageReadReceipt> receipts = threadClient.listReadReceipts();\n\nfor (ChatMessageReadReceipt receipt : receipts) {\n    System.out.println(\"Message ID: \" + receipt.getChatMessageId());\n    System.out.println(\"Read by: \" + receipt.getSenderCommunicationIdentifier());\n    System.out.println(\"Read at: \" + receipt.getReadOn());\n}\n```\n\n## Typing Notifications\n\n```java\nimport com.azure.communication.chat.models.TypingNotificationOptions;\n\n\u002F\u002F Send typing notification\nTypingNotificationOptions typingOptions = new TypingNotificationOptions()\n    .setSenderDisplayName(\"Alice\");\n\nthreadClient.sendTypingNotificationWithResponse(typingOptions, Context.NONE);\n\n\u002F\u002F Simple typing notification\nthreadClient.sendTypingNotification();\n```\n\n## Thread Operations\n\n```java\n\u002F\u002F Get thread properties\nChatThreadProperties properties = threadClient.getProperties();\nSystem.out.println(\"Topic: \" + properties.getTopic());\nSystem.out.println(\"Created: \" + properties.getCreatedOn());\n\n\u002F\u002F Update topic\nthreadClient.updateTopic(\"New Project Discussion Topic\");\n\n\u002F\u002F Delete thread\nchatClient.deleteChatThread(threadId);\n```\n\n## List Threads\n\n```java\n\u002F\u002F List all chat threads for the user\nPagedIterable\u003CChatThreadItem> threads = chatClient.listChatThreads();\n\nfor (ChatThreadItem thread : threads) {\n    System.out.println(\"Thread ID: \" + thread.getId());\n    System.out.println(\"Topic: \" + thread.getTopic());\n    System.out.println(\"Last message: \" + thread.getLastMessageReceivedOn());\n}\n```\n\n## Pagination\n\n```java\nimport com.azure.core.http.rest.PagedResponse;\n\n\u002F\u002F Paginate through messages\nint maxPageSize = 10;\nListChatMessagesOptions listOptions = new ListChatMessagesOptions()\n    .setMaxPageSize(maxPageSize);\n\nPagedIterable\u003CChatMessage> pagedMessages = threadClient.listMessages(listOptions);\n\npagedMessages.iterableByPage().forEach(page -> {\n    System.out.println(\"Page status code: \" + page.getStatusCode());\n    page.getElements().forEach(msg -> \n        System.out.println(\"Message: \" + msg.getContent().getMessage()));\n});\n```\n\n## Error Handling\n\n```java\nimport com.azure.core.exception.HttpResponseException;\n\ntry {\n    threadClient.sendMessage(messageOptions);\n} catch (HttpResponseException e) {\n    switch (e.getResponse().getStatusCode()) {\n        case 401:\n            System.out.println(\"Unauthorized - check token\");\n            break;\n        case 403:\n            System.out.println(\"Forbidden - user not in thread\");\n            break;\n        case 404:\n            System.out.println(\"Thread not found\");\n            break;\n        default:\n            System.out.println(\"Error: \" + e.getMessage());\n    }\n}\n```\n\n## Message Types\n\n| Type | Description |\n|------|-------------|\n| `TEXT` | Regular chat message |\n| `HTML` | HTML-formatted message |\n| `TOPIC_UPDATED` | System message - topic changed |\n| `PARTICIPANT_ADDED` | System message - participant joined |\n| `PARTICIPANT_REMOVED` | System message - participant left |\n\n## Environment Variables\n\n```bash\nAZURE_COMMUNICATION_ENDPOINT=https:\u002F\u002F\u003Cresource>.communication.azure.com\nAZURE_COMMUNICATION_USER_TOKEN=\u003Cuser-access-token>\n```\n\n## Best Practices\n\n1. **Token Management** - User tokens expire; implement refresh logic with `CommunicationTokenRefreshOptions`\n2. **Pagination** - Use `listMessages(options)` with `maxPageSize` for large threads\n3. **Share History** - Set `shareHistoryTime` when adding participants to control message visibility\n4. **Message Types** - Filter system messages (`PARTICIPANT_ADDED`, etc.) from user messages\n5. **Read Receipts** - Send receipts only when messages are actually viewed by user\n\n## Trigger Phrases\n\n- \"chat application Java\", \"real-time messaging Java\"\n- \"chat thread\", \"chat participants\", \"chat messages\"\n- \"read receipts\", \"typing notifications\"\n- \"Azure Communication Services chat\"\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fmicrosoft\u002Fskills\u002Fazure-communication-chat-java",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill azure-communication-chat-java",{"tool":42,"command":43},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill azure-communication-chat-java",{"tool":45,"command":46},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill azure-communication-chat-java","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-communication-chat-java\u002FSKILL.md",true,[],[51,65,75,84,90,97],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":61,"publishedAt":23},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[56],{"categoryNo":57,"categoryName":58,"taxonomyType":59,"taxonomyTypeDesc":60},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[62,63,64],"model","model hierarchy","model hierarchy skill",{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":71,"publishedAt":23},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[70],{"categoryNo":57,"categoryName":58,"taxonomyType":59,"taxonomyTypeDesc":60},[72,73,74],"MCP","zoom","zoom mcp",{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":23},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[81,82,83,73],"sdk","zoom apps sdk","apps",{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":23},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[86],{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":96,"publishedAt":23},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[95],{"categoryNo":57,"categoryName":58,"taxonomyType":59,"taxonomyTypeDesc":60},[92],{"skillNo":98,"name":99,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":23},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[99]]