☁ Tencent Cloud IM Server SDK in Java | 腾讯云 IM 服务端 SDK Java 版

Overview

Tencent Cloud IM Server SDK in Java

maven license prs welcome open-source-organization

The Tencent Cloud IM Server SDK for Java enables Java developers to easily work with Tencent Cloud IM.

Requirements

  • Java 8 or later
  • Maven

Installation and Getting Started

1. Maven Configuration

Add the Maven dependency:

<dependency>
  <groupId>io.github.doocs</groupId>
  <artifactId>im-server-sdk-java</artifactId>
  <version>0.0.3</version>
</dependency>

2. Getting Started

Here is a quick teaser of an application using IM SDK in Java:

public class Main {
    public static void main(String[] args) {
        // type your sdkAppId here
        long appId = 1400554812;
        
        // type your adminUserId here
        String identifier = "test";
        
        // type your applicationKey here
        String key = "60c6c5925f3ae52c7325ac5a8ec78e44c056d1dd84d54e12ffa39911267a2a70";
        
        // create ImClient instance
        IMClient client = IMClient.getInstance(appId, identifier, key);

        // import account
        AccountImportRequest request = new AccountImportRequest();
        request.setFaceUrl("https://avatars.githubusercontent.com/u/43716716?s=200&v=4");
        request.setIdentifier("doocs");
        request.setNick("Doocs Community");
        try {
            AccountImportResult result = client.account.accountImport(request);
            System.out.println(result);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Authors

Contributing

Contributions are always welcomed! Please refer to CONTRIBUTING for detailed guidelines.

License

Apache-2.0 License.

Comments
  • 设置用户资料接口中自定义字段设置未生效问题(有时候生效)

    设置用户资料接口中自定义字段设置未生效问题(有时候生效)

    设置用户资料接口现在情况是设置昵称,头像,自定义字段等数据时调用接口返回成功,然后调用拉取资料查询,昵称,头像是更新成功的,但是自定义字段更新未成功,自定义字段是正确的key,因为有时候自定义字段是更新成功的,查看了入参都没发现啥问题
    okhttp request:

    Request{method=POST, url=https://console.tim.qq.com/v4/profile/portrait_set?sdkappid=xxxxx&identifier=administrator&usersig=xxxxx&random=2136887377&contenttype=json, headers=[User-Agent:qcloud-im-server-sdk-java/null(Mac OS X/13.0/aarch64;11.0.14.1)]}

    okhttp requestString: {"From_Account":"xxxxxx","ProfileItem":[{"Tag":"Tag_Profile_IM_Nick","Value":"对对对"},{"Tag":"Tag_Profile_IM_Image","Value":"https:/xxxx.oss-cn-shanghai.aliyuncs.com/dams/47ed6184c7ee4ffeb9b6cabd7.png"},{"Tag":"Tag_Profile_Custom_Data","Value":"{"mobileNo":"13311111111","roleNameList":["SA"]}"}]}

    okhttp response:

    Response{protocol=http/1.1, code=200, message=OK, url=https://console.tim.qq.com/v4/profile/portrait_set?sdkappid=dddd&identifier=administrator&usersig=ddddd*&random=2136887377&contenttype=json}

    多次调用接口都是返回成功的,自定义字段实际未生效, 查看入参都没问题,费解 是有什么要注意的吗 im后台设置的用户自定义字段key是 : Tag_Profile_Custom_Data 大小写是注意到了 没啥问题

    opened by heangping 11
  • 创建群组问题

    创建群组问题

    创建群组时,如果定义了群组自定义字段对象且赋值,im会返回{groupId='null', actionStatus='FAIL', errorInfo='all defined key is invalid', errorCode=10004}参数无效。如果不传自定义字段或者只定义自定义字段对象不赋值则没有问题。将源码的AppDefinedDataItem key字段和value字段改为Key和Value也没有问题。 image image

    opened by gchzz 4
  • 获取群组消息的时候,返回的next超出int最大值报错

    获取群组消息的时候,返回的next超出int最大值报错

    Exception in thread "main" com.fasterxml.jackson.databind.JsonMappingException: Numeric value (9040992949) out of range of int (-2147483648 - 2147483647) 这是源代码 public static void init() throws IOException { long appId = xxxxxxx; String userId = "xxxxxxxxxx"; String key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; ClientConfiguration config = new ClientConfiguration(); config.setExpireTime(7 * 24 * 60 * 60L); config.setAutoRenewSig(false); ImClient client = ImClient.getInstance(appId, userId, key, config); GetAppIdGroupListRequest request = GetAppIdGroupListRequest.builder() .limit(50) .groupType(GroupType.PUBLIC) .next(0) .build(); GetAppIdGroupListResult result = client.group.getAppIdGroupList(request); System.out.println(request); }

    opened by yayanan 3
  • 获取消息列表的接口少了IsPeerRead已读状态字段

    获取消息列表的接口少了IsPeerRead已读状态字段

    "MsgList": [
           {
               "From_Account": "user1",
               "To_Account": "user2",
               "MsgSeq": 549396494,
               "MsgRandom": 2578554,
               "MsgTimeStamp": 1584669680,
               "MsgFlagBits": 0,
               "IsPeerRead": 0,
               "MsgKey": "549396494_2578554_1584669680",
               "MsgBody": [
                   {
                       "MsgType": "TIMTextElem",
                       "MsgContent": {
                           "Text": "msg 1"
                       }
                   }
               ],
               "CloudCustomData": "your cloud custom data"
           }
    ]
    
    opened by eyong4736 2
  • 在设置超时时间的时候,默认都是3s,我上游调用的时候,应该设置多少s才能保证这里sdk一个请求响应已经结束,9s?

    在设置超时时间的时候,默认都是3s,我上游调用的时候,应该设置多少s才能保证这里sdk一个请求响应已经结束,9s?

    ` public class ClientConfiguration { /** * 默认 UA */ public static final String DEFAULT_USER_AGENT = VersionInfoUtil.getDefaultUserAgent();

    /**
     * 默认最大重试次数
     */
    public static final int DEFAULT_MAX_RETRIES = 3;
    
    /**
     * 默认自动更新签名
     */
    public static final boolean DEFAULT_RENEW_SIG = true;
    /**
     * 默认超时时间(毫秒)
     */
    public static final long DEFAULT_CONNECT_TIMEOUT = 3000L;
    public static final long DEFAULT_READ_TIMEOUT = 3000L;
    public static final long DEFAULT_WRITE_TIMEOUT = 3000L;、
    

    ... //其他code `

    opened by mufeng567 2
  • 发送消息的apns对象属性没有更新

    发送消息的apns对象属性没有更新

    "ApnsInfo": { "Sound": "apns.mp3", "BadgeMode": 1, // 这个字段缺省或者为 0 表示需要计数,为 1 表示本条消息不需要计数,即右上角图标数字不增加 "Title":"apns title", // apns title "SubTitle":"apns subtitle", // apns subtitle "Image":"www.image.com" // image url } image 字段不一致

    opened by panlin586 2
  • IMClient 没有自动更新 userSig 的过期时间

    IMClient 没有自动更新 userSig 的过期时间

    这里获取 client instance 后, 从 cache 中获取的 client 的话,是不会更新 userSig 的过期时间的.

        public static IMClient getInstance(Long sdkAppId, String userId, String key) {
            String identify = sdkAppId + "_" + userId;
            if (IM_CLIENT.get(identify) == null) {
                IM_CLIENT.putIfAbsent(identify, new IMClient(sdkAppId, userId, key, 24 * 60 * 60L));
            }
            return IM_CLIENT.get(identify);
        }
    
    opened by vioao 2
  • update IM_BIRTHDAY tencent need int but give a string

    update IM_BIRTHDAY tencent need int but give a string

    // tencent doc Tag_Profile_IM_BirthDay | uint32 | 生日 | 有 | 推荐用法:20190419

    // code profiles.add(ProfileItem.builder().tag(TagProfile.IM_BIRTHDAY).value(birth).build());

    tks for your work. best wishes.

    opened by Asa-Dong 1
Owner
Doocs
📌 GitHub 技术社区 Doocs,致力于打造一个内容完整、持续成长的互联网开发者学习生态圈!非常欢迎对技术、开源有热情的朋友加入我们。
Doocs
An integration solution for Spring Cloud and Tencent middleware - Spring Cloud和腾讯中间件的集成方案

Spring Cloud Tencent English | 简体中文 Introduction Spring Cloud Tencent contains components distributed micro-service applications need during developin

Tencent 2.6k Dec 29, 2022
基于Vert.x的DDNS解决方案。支持的DNS服务商 Alidns(阿里云) Dnspod(腾讯云) Cloudflare 华为云

vertx-ddns 自动获取设备公网 IPv4 或 IPv6 地址或使用自定义的IP地址,并解析到对应的域名服务。 vertx-ddns 功能 系统中使用 Docker中使用 Webhook 响应式布局 开发&自行编译 License 功能 支持Mac、Windows、Linux系统,支持ARM、

zf1976 121 Dec 12, 2022
Tencent Kona JDK17 is a no-cost, production-ready distribution of the Open Java Development Kit (OpenJDK), Long-Term Support(LTS) with quarterly updates.

Tencent Kona JDK17 Tencent Kona JDK17 is a no-cost, production-ready distribution of the Open Java Development Kit (OpenJDK), Long-Term Support(LTS) w

Tencent 59 Nov 30, 2022
Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker.

spring-microservice Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker. Arc

null 4 Sep 13, 2022
A high availability shopping(ecommerce) system using SpringBoot, Spring Cloud, Eureka Server, Spring Cloud Gateway, resillience4j, Kafka, Redis and MySQL.

High-availability-shopping-system A high availability shopping(ecommerce) system using SpringBoot, Spring Cloud, Eureka Server, Spring Cloud Gateway,

LeiH 1 Oct 26, 2022
Alibaba Cloud Dedicated KMS Transfer SDK for Java can help Java developers to migrate from the KMS keys to the Dedicated KMS keys.

Alibaba Cloud Dedicated KMS Transfer SDK for Java Alibaba Cloud Dedicated KMS Transfer SDK for Java can help Java developers to migrate from the KMS k

Alibaba Cloud 3 May 12, 2022
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

Spring 系列教程 该仓库为个人博客https://mrbird.cc中Spring系列源码,包含Spring Boot、Spring Boot & Shiro、Spring Cloud,Spring Boot & Spring Security & Spring Security OAuth2

mrbird 24.8k Jan 6, 2023
一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024

友情提示:因为提供了 50000+ 行示例代码,所以艿艿默认注释了所有 Maven Module。 胖友可以根据自己的需要,修改 pom.xml 即可。 一个涵盖六个主流技术栈的正经仓库: 《Spring Boot 专栏》 《Spring Cloud Alibaba 专栏》 《Spring Clou

芋道源码 15.7k Dec 31, 2022
一套涵盖大部分核心组件使用的Spring Cloud教程,包括Spring Cloud Alibaba及分布式事务Seata,基于Spring Cloud Greenwich及SpringBoot 2.1.7。22篇文章,篇篇精华,32个Demo,涵盖大部分应用场景。

springcloud-learning 简介 一套涵盖大部分核心组件使用的Spring Cloud教程,包括Spring Cloud Alibaba及分布式事务Seata,基于Spring Cloud Greenwich及SpringBoot 2.1.7。22篇文章,篇篇精华,32个Demo,涵盖

macro 5.6k Dec 30, 2022
A spring cloud infrastructure provides various of commonly used cloud components and auto-configurations for high project consistency

A spring cloud infrastructure provides various of commonly used cloud components and auto-configurations for high project consistency.

Project-Hephaestus 2 Feb 8, 2022
💡极致性能的企业级Java服务器框架,RPC,游戏服务器框架,web应用服务器框架。(Extreme fast enterprise Java server framework, can be RPC, game server framework, web server framework.)

?? 为性能而生的万能服务器框架 ?? Ⅰ. zfoo简介 ?? 性能炸裂,天生异步,Actor设计思想,无锁化设计,基于Spring的MVC式用法的万能RPC框架 极致序列化,原生集成的目前二进制序列化和反序列化速度最快的 zfoo protocol 作为网络通讯协议 高可拓展性,单台服务器部署,

null 1k Jan 1, 2023
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)

OpenAPI Generator Master (5.4.x): 6.0.x (6.0.x): ⭐ ⭐ ⭐ If you would like to contribute, please refer to guidelines and a list of open tasks. ⭐ ⭐ ⭐ ‼️

OpenAPI Tools 14.8k Dec 30, 2022
Tuya 37 Dec 26, 2022
Spring boot microservice example with Eureka Server + Eureka Client + Spring Cloud API Gateway + OAuth2.0 + Circuit Breaker + Resilience4J + FeignClient + RestTemplate

Spring boot microservice example Spring boot microservice example with Eureka Server + Eureka Client + Spring Cloud API Gateway + OAuth2.0 + Circuit B

Subhash Lamba 47 Dec 29, 2022
SlimeVR-Server - Server app for SlimeVR ecosystem

SlimeVR Server Server app for SlimeVR ecosystem Server orchestrates communication between multiple sensors and integrations, like SteamVR. Sensors imp

null 362 Dec 31, 2022
React Native wrapper around Indy SDK Java and Objective-C wrappers.

React Native Indy SDK React Native Indy SDK wrapper. Installation with npm: $ npm install indy-sdk-react-native --save with Yarn: $ yarn add indy-sdk-

Hyperledger 21 Dec 5, 2022
A Sentry SDK for Java, Android and other JVM languages.

Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoy

Sentry 912 Dec 28, 2022
SDK java permettant de valider et qualifier un numéro de téléphone calédonien.

❔ phonenumber-validator SDK Java permettant de valider, qualifier un numéro de téléphone calédonien. ⬇️ Import de la dépendance publique Cette dépenda

OPT Nouvelle Caledonie 2 Oct 22, 2022
Java wrapper for Agones client SDK.

agones4j How to Use (Developers) Code final class Server { public static void main( final String[] args ) { final var sdk = new tr.com.in

Infumia LTD 6 Dec 15, 2022