SpringBoot集成極光推送完整實(shí)現(xiàn)代碼
工作中經(jīng)常會(huì)遇到服務(wù)器向App推送消息的需求,一般企業(yè)中選擇用極光推送的比較多,在集成極光時(shí)發(fā)現(xiàn)極光的文檔并不完整,網(wǎng)上的文章也很多不能直接使用,這里列出我在工作中集成極光的全部代碼,只需要按照如下代碼保證一次性實(shí)現(xiàn)。
1.pom.xml
<!-- 極光推送 begin --> <dependency> <groupId>cn.jpush.api</groupId> <artifactId>jpush-client</artifactId> <version>3.3.10</version> </dependency> <dependency> <groupId>cn.jpush.api</groupId> <artifactId>jiguang-common</artifactId> <version>1.1.4</version> </dependency> <!-- 極光推送 end -->
2.application.yml
jpush: appKey: xxx masterSecret: xxxx apnsProduction: false # 是否生成環(huán)境,true表示生成環(huán)境
3.MyJPushClient
import cn.jiguang.common.resp.APIConnectionException; import cn.jiguang.common.resp.APIRequestException; import cn.jpush.api.JPushClient; import cn.jpush.api.push.PushResult; import cn.jpush.api.push.model.Message; import cn.jpush.api.push.model.Options; import cn.jpush.api.push.model.Platform; import cn.jpush.api.push.model.PushPayload; import cn.jpush.api.push.model.audience.Audience; import cn.jpush.api.push.model.notification.AndroidNotification; import cn.jpush.api.push.model.notification.IosNotification; import cn.jpush.api.push.model.notification.Notification; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.util.List; /** * 極光推送客戶(hù)端 * * @author Mengday Zhang * @version 1.0 * @since 2019-04-01 */ @Component public class MyJPushClient { @Value("${jpush.appKey}") private String appKey; @Value("${jpush.masterSecret}") private String masterSecret; @Value("${jpush.apnsProduction}") private boolean apnsProduction; private static JPushClient jPushClient = null; private static final int RESPONSE_OK = 200; private static final Logger logger = LoggerFactory.getLogger(MyJPushClient.class); public JPushClient getJPushClient() { if (jPushClient == null) { jPushClient = new JPushClient(masterSecret, appKey); } return jPushClient; } /** * 推送到alias列表 * * @param alias 別名或別名組 * @param notificationTitle 通知內(nèi)容標(biāo)題 * @param msgTitle 消息內(nèi)容標(biāo)題 * @param msgContent 消息內(nèi)容 * @param extras 擴(kuò)展字段 */ public void sendToAliasList(List<String> alias, String notificationTitle, String msgTitle, String msgContent, String extras) { PushPayload pushPayload = buildPushObject_all_aliasList_alertWithTitle(alias, notificationTitle, msgTitle, msgContent, extras); this.sendPush(pushPayload); } /** * 推送到tag列表 * * @param tagsList Tag或Tag組 * @param notificationTitle 通知內(nèi)容標(biāo)題 * @param msgTitle 消息內(nèi)容標(biāo)題 * @param msgContent 消息內(nèi)容 * @param extras 擴(kuò)展字段 */ public void sendToTagsList(List<String> tagsList, String notificationTitle, String msgTitle, String msgContent, String extras) { PushPayload pushPayload = buildPushObject_all_tagList_alertWithTitle(tagsList, notificationTitle, msgTitle, msgContent, extras); this.sendPush(pushPayload); } /** * 發(fā)送給所有安卓用戶(hù) * * @param notificationTitle 通知內(nèi)容標(biāo)題 * @param msgTitle 消息內(nèi)容標(biāo)題 * @param msgContent 消息內(nèi)容 * @param extras 擴(kuò)展字段 */ public void sendToAllAndroid(String notificationTitle, String msgTitle, String msgContent, String extras) { PushPayload pushPayload = buildPushObject_android_all_alertWithTitle(notificationTitle, msgTitle, msgContent, extras); this.sendPush(pushPayload); } /** * 發(fā)送給所有IOS用戶(hù) * * @param notificationTitle 通知內(nèi)容標(biāo)題 * @param msgTitle 消息內(nèi)容標(biāo)題 * @param msgContent 消息內(nèi)容 * @param extras 擴(kuò)展字段 */ public void sendToAllIOS(String notificationTitle, String msgTitle, String msgContent, String extras) { PushPayload pushPayload = buildPushObject_ios_all_alertWithTitle(notificationTitle, msgTitle, msgContent, extras); this.sendPush(pushPayload); } /** * 發(fā)送給所有用戶(hù) * * @param notificationTitle 通知內(nèi)容標(biāo)題 * @param msgTitle 消息內(nèi)容標(biāo)題 * @param msgContent 消息內(nèi)容 * @param extras 擴(kuò)展字段 */ public void sendToAll(String notificationTitle, String msgTitle, String msgContent, String extras) { PushPayload pushPayload = buildPushObject_android_and_ios(notificationTitle, msgTitle, msgContent, extras); this.sendPush(pushPayload); } private PushResult sendPush(PushPayload pushPayload) { logger.info("pushPayload={}", pushPayload); PushResult pushResult = null; try { pushResult = this.getJPushClient().sendPush(pushPayload); logger.info("" + pushResult); if (pushResult.getResponseCode() == RESPONSE_OK) { logger.info("push successful, pushPayload={}", pushPayload); } } catch (APIConnectionException e) { logger.error("push failed: pushPayload={}, exception={}", pushPayload, e); } catch (APIRequestException e) { logger.error("push failed: pushPayload={}, exception={}", pushPayload, e); } return pushResult; } /** * 向所有平臺(tái)所有用戶(hù)推送消息 * * @param notificationTitle * @param msgTitle * @param msgContent * @param extras * @return */ public PushPayload buildPushObject_android_and_ios(String notificationTitle, String msgTitle, String msgContent, String extras) { return PushPayload.newBuilder() .setPlatform(Platform.android_ios()) .setAudience(Audience.all()) .setNotification(Notification.newBuilder() .setAlert(notificationTitle) .addPlatformNotification(AndroidNotification.newBuilder() .setAlert(notificationTitle) .setTitle(notificationTitle) // 此字段為透?jìng)髯侄?,不?huì)顯示在通知欄。用戶(hù)可以通過(guò)此字段來(lái)做一些定制需求,如特定的key傳要指定跳轉(zhuǎn)的頁(yè)面(value) .addExtra("androidNotification extras key", extras) .build() ) .addPlatformNotification(IosNotification.newBuilder() // 傳一個(gè)IosAlert對(duì)象,指定apns title、title、subtitle等 .setAlert(notificationTitle) // 直接傳alert // 此項(xiàng)是指定此推送的badge自動(dòng)加1 .incrBadge(1) // 此字段的值default表示系統(tǒng)默認(rèn)聲音;傳sound.caf表示此推送以項(xiàng)目里面打包的sound.caf聲音來(lái)提醒, // 如果系統(tǒng)沒(méi)有此音頻則以系統(tǒng)默認(rèn)聲音提醒;此字段如果傳空字符串,iOS9及以上的系統(tǒng)是無(wú)聲音提醒,以下的系統(tǒng)是默認(rèn)聲音 .setSound("default") // 此字段為透?jìng)髯侄?,不?huì)顯示在通知欄。用戶(hù)可以通過(guò)此字段來(lái)做一些定制需求,如特定的key傳要指定跳轉(zhuǎn)的頁(yè)面(value) .addExtra("iosNotification extras key", extras) // 此項(xiàng)說(shuō)明此推送是一個(gè)background推送,想了解background看:http://docs.jpush.io/client/ios_tutorials/#ios-7-background-remote-notification // .setContentAvailable(true) .build() ) .build() ) // Platform指定了哪些平臺(tái)就會(huì)像指定平臺(tái)中符合推送條件的設(shè)備進(jìn)行推送。jpush的自定義消息, // sdk默認(rèn)不做任何處理,不會(huì)有通知提示。建議看文檔http://docs.jpush.io/guideline/faq/的 // [通知與自定義消息有什么區(qū)別?]了解通知和自定義消息的區(qū)別 .setMessage(Message.newBuilder() .setMsgContent(msgContent) .setTitle(msgTitle) .addExtra("message extras key", extras) .build()) .setOptions(Options.newBuilder() // 此字段的值是用來(lái)指定本推送要推送的apns環(huán)境,false表示開(kāi)發(fā),true表示生產(chǎn);對(duì)android和自定義消息無(wú)意義 .setApnsProduction(apnsProduction) // 此字段是給開(kāi)發(fā)者自己給推送編號(hào),方便推送者分辨推送記錄 .setSendno(1) // 此字段的值是用來(lái)指定本推送的離線(xiàn)保存時(shí)長(zhǎng),如果不傳此字段則默認(rèn)保存一天,最多指定保留十天,單位為秒 .setTimeToLive(86400) .build()) .build(); } /** * 向所有平臺(tái)單個(gè)或多個(gè)指定別名用戶(hù)推送消息 * * @param aliasList * @param notificationTitle * @param msgTitle * @param msgContent * @param extras * @return */ private PushPayload buildPushObject_all_aliasList_alertWithTitle(List<String> aliasList, String notificationTitle, String msgTitle, String msgContent, String extras) { // 創(chuàng)建一個(gè)IosAlert對(duì)象,可指定APNs的alert、title等字段 // IosAlert iosAlert = IosAlert.newBuilder().setTitleAndBody("title", "alert body").build(); return PushPayload.newBuilder() // 指定要推送的平臺(tái),all代表當(dāng)前應(yīng)用配置了的所有平臺(tái),也可以傳android等具體平臺(tái) .setPlatform(Platform.all()) // 指定推送的接收對(duì)象,all代表所有人,也可以指定已經(jīng)設(shè)置成功的tag或alias或該應(yīng)應(yīng)用客戶(hù)端調(diào)用接口獲取到的registration id .setAudience(Audience.alias(aliasList)) // jpush的通知,android的由jpush直接下發(fā),iOS的由apns服務(wù)器下發(fā),Winphone的由mpns下發(fā) .setNotification(Notification.newBuilder() // 指定當(dāng)前推送的android通知 .addPlatformNotification(AndroidNotification.newBuilder() .setAlert(notificationTitle) .setTitle(notificationTitle) // 此字段為透?jìng)髯侄?,不?huì)顯示在通知欄。用戶(hù)可以通過(guò)此字段來(lái)做一些定制需求,如特定的key傳要指定跳轉(zhuǎn)的頁(yè)面(value) .addExtra("androidNotification extras key", extras) .build()) // 指定當(dāng)前推送的iOS通知 .addPlatformNotification(IosNotification.newBuilder() // 傳一個(gè)IosAlert對(duì)象,指定apns title、title、subtitle等 .setAlert(notificationTitle) // 直接傳alert // 此項(xiàng)是指定此推送的badge自動(dòng)加1 .incrBadge(1) // 此字段的值default表示系統(tǒng)默認(rèn)聲音;傳sound.caf表示此推送以項(xiàng)目里面打包的sound.caf聲音來(lái)提醒, // 如果系統(tǒng)沒(méi)有此音頻則以系統(tǒng)默認(rèn)聲音提醒;此字段如果傳空字符串,iOS9及以上的系統(tǒng)是無(wú)聲音提醒,以下的系統(tǒng)是默認(rèn)聲音 .setSound("default") // 此字段為透?jìng)髯侄?,不?huì)顯示在通知欄。用戶(hù)可以通過(guò)此字段來(lái)做一些定制需求,如特定的key傳要指定跳轉(zhuǎn)的頁(yè)面(value) .addExtra("iosNotification extras key", extras) // 此項(xiàng)說(shuō)明此推送是一個(gè)background推送,想了解background看:http://docs.jpush.io/client/ios_tutorials/#ios-7-background-remote-notification // 取消此注釋?zhuān)⑼扑蜁r(shí)ios將無(wú)法在鎖屏情況接收 // .setContentAvailable(true) .build()) .build()) // Platform指定了哪些平臺(tái)就會(huì)像指定平臺(tái)中符合推送條件的設(shè)備進(jìn)行推送。jpush的自定義消息, // sdk默認(rèn)不做任何處理,不會(huì)有通知提示。建議看文檔http://docs.jpush.io/guideline/faq/的 // [通知與自定義消息有什么區(qū)別?]了解通知和自定義消息的區(qū)別 .setMessage(Message.newBuilder() .setMsgContent(msgContent) .setTitle(msgTitle) .addExtra("message extras key", extras) .build()) .setOptions(Options.newBuilder() // 此字段的值是用來(lái)指定本推送要推送的apns環(huán)境,false表示開(kāi)發(fā),true表示生產(chǎn);對(duì)android和自定義消息無(wú)意義 .setApnsProduction(apnsProduction) // 此字段是給開(kāi)發(fā)者自己給推送編號(hào),方便推送者分辨推送記錄 .setSendno(1) // 此字段的值是用來(lái)指定本推送的離線(xiàn)保存時(shí)長(zhǎng),如果不傳此字段則默認(rèn)保存一天,最多指定保留十天; .setTimeToLive(86400) .build()) .build(); } /** * 向所有平臺(tái)單個(gè)或多個(gè)指定Tag用戶(hù)推送消息 * * @param tagsList * @param notificationTitle * @param msgTitle * @param msgContent * @param extras * @return */ private PushPayload buildPushObject_all_tagList_alertWithTitle(List<String> tagsList, String notificationTitle, String msgTitle, String msgContent, String extras) { //創(chuàng)建一個(gè)IosAlert對(duì)象,可指定APNs的alert、title等字段 //IosAlert iosAlert = IosAlert.newBuilder().setTitleAndBody("title", "alert body").build(); return PushPayload.newBuilder() // 指定要推送的平臺(tái),all代表當(dāng)前應(yīng)用配置了的所有平臺(tái),也可以傳android等具體平臺(tái) .setPlatform(Platform.all()) // 指定推送的接收對(duì)象,all代表所有人,也可以指定已經(jīng)設(shè)置成功的tag或alias或該應(yīng)應(yīng)用客戶(hù)端調(diào)用接口獲取到的registration id .setAudience(Audience.tag(tagsList)) // jpush的通知,android的由jpush直接下發(fā),iOS的由apns服務(wù)器下發(fā),Winphone的由mpns下發(fā) .setNotification(Notification.newBuilder() // 指定當(dāng)前推送的android通知 .addPlatformNotification(AndroidNotification.newBuilder() .setAlert(notificationTitle) .setTitle(notificationTitle) //此字段為透?jìng)髯侄?,不?huì)顯示在通知欄。用戶(hù)可以通過(guò)此字段來(lái)做一些定制需求,如特定的key傳要指定跳轉(zhuǎn)的頁(yè)面(value) .addExtra("androidNotification extras key", extras) .build()) // 指定當(dāng)前推送的iOS通知 .addPlatformNotification(IosNotification.newBuilder() // 傳一個(gè)IosAlert對(duì)象,指定apns title、title、subtitle等 .setAlert(notificationTitle) // 直接傳alert // 此項(xiàng)是指定此推送的badge自動(dòng)加1 .incrBadge(1) // 此字段的值default表示系統(tǒng)默認(rèn)聲音;傳sound.caf表示此推送以項(xiàng)目里面打包的sound.caf聲音來(lái)提醒, // 如果系統(tǒng)沒(méi)有此音頻則以系統(tǒng)默認(rèn)聲音提醒;此字段如果傳空字符串,iOS9及以上的系統(tǒng)是無(wú)聲音提醒,以下的系統(tǒng)是默認(rèn)聲音 .setSound("default") // 此字段為透?jìng)髯侄?,不?huì)顯示在通知欄。用戶(hù)可以通過(guò)此字段來(lái)做一些定制需求,如特定的key傳要指定跳轉(zhuǎn)的頁(yè)面(value) .addExtra("iosNotification extras key", extras) // 此項(xiàng)說(shuō)明此推送是一個(gè)background推送,想了解background看:http://docs.jpush.io/client/ios_tutorials/#ios-7-background-remote-notification // 取消此注釋?zhuān)⑼扑蜁r(shí)ios將無(wú)法在鎖屏情況接收 // .setContentAvailable(true) .build()) .build()) // Platform指定了哪些平臺(tái)就會(huì)像指定平臺(tái)中符合推送條件的設(shè)備進(jìn)行推送。jpush的自定義消息, // sdk默認(rèn)不做任何處理,不會(huì)有通知提示。建議看文檔http://docs.jpush.io/guideline/faq/的 // [通知與自定義消息有什么區(qū)別?]了解通知和自定義消息的區(qū)別 .setMessage(Message.newBuilder() .setMsgContent(msgContent) .setTitle(msgTitle) .addExtra("message extras key", extras) .build()) .setOptions(Options.newBuilder() // 此字段的值是用來(lái)指定本推送要推送的apns環(huán)境,false表示開(kāi)發(fā),true表示生產(chǎn);對(duì)android和自定義消息無(wú)意義 .setApnsProduction(apnsProduction) // 此字段是給開(kāi)發(fā)者自己給推送編號(hào),方便推送者分辨推送記錄 .setSendno(1) // 此字段的值是用來(lái)指定本推送的離線(xiàn)保存時(shí)長(zhǎng),如果不傳此字段則默認(rèn)保存一天,最多指定保留十天; .setTimeToLive(86400) .build()) .build(); } /** * 向android平臺(tái)所有用戶(hù)推送消息 * * @param notificationTitle * @param msgTitle * @param msgContent * @param extras * @return */ private PushPayload buildPushObject_android_all_alertWithTitle(String notificationTitle, String msgTitle, String msgContent, String extras) { return PushPayload.newBuilder() // 指定要推送的平臺(tái),all代表當(dāng)前應(yīng)用配置了的所有平臺(tái),也可以傳android等具體平臺(tái) .setPlatform(Platform.android()) // 指定推送的接收對(duì)象,all代表所有人,也可以指定已經(jīng)設(shè)置成功的tag或alias或該應(yīng)應(yīng)用客戶(hù)端調(diào)用接口獲取到的registration id .setAudience(Audience.all()) // jpush的通知,android的由jpush直接下發(fā),iOS的由apns服務(wù)器下發(fā),Winphone的由mpns下發(fā) .setNotification(Notification.newBuilder() // 指定當(dāng)前推送的android通知 .addPlatformNotification(AndroidNotification.newBuilder() .setAlert(notificationTitle) .setTitle(notificationTitle) // 此字段為透?jìng)髯侄危粫?huì)顯示在通知欄。用戶(hù)可以通過(guò)此字段來(lái)做一些定制需求,如特定的key傳要指定跳轉(zhuǎn)的頁(yè)面(value) .addExtra("androidNotification extras key", extras) .build()) .build() ) // Platform指定了哪些平臺(tái)就會(huì)像指定平臺(tái)中符合推送條件的設(shè)備進(jìn)行推送。jpush的自定義消息, // sdk默認(rèn)不做任何處理,不會(huì)有通知提示。建議看文檔http://docs.jpush.io/guideline/faq/的 // [通知與自定義消息有什么區(qū)別?]了解通知和自定義消息的區(qū)別 .setMessage(Message.newBuilder() .setMsgContent(msgContent) .setTitle(msgTitle) .addExtra("message extras key", extras) .build()) .setOptions(Options.newBuilder() // 此字段的值是用來(lái)指定本推送要推送的apns環(huán)境,false表示開(kāi)發(fā),true表示生產(chǎn);對(duì)android和自定義消息無(wú)意義 .setApnsProduction(apnsProduction) // 此字段是給開(kāi)發(fā)者自己給推送編號(hào),方便推送者分辨推送記錄 .setSendno(1) // 此字段的值是用來(lái)指定本推送的離線(xiàn)保存時(shí)長(zhǎng),如果不傳此字段則默認(rèn)保存一天,最多指定保留十天,單位為秒 .setTimeToLive(86400) .build()) .build(); } /** * 向ios平臺(tái)所有用戶(hù)推送消息 * * @param notificationTitle * @param msgTitle * @param msgContent * @param extras * @return */ private PushPayload buildPushObject_ios_all_alertWithTitle(String notificationTitle, String msgTitle, String msgContent, String extras) { return PushPayload.newBuilder() // 指定要推送的平臺(tái),all代表當(dāng)前應(yīng)用配置了的所有平臺(tái),也可以傳android等具體平臺(tái) .setPlatform(Platform.ios()) // 指定推送的接收對(duì)象,all代表所有人,也可以指定已經(jīng)設(shè)置成功的tag或alias或該應(yīng)應(yīng)用客戶(hù)端調(diào)用接口獲取到的registration id .setAudience(Audience.all()) // jpush的通知,android的由jpush直接下發(fā),iOS的由apns服務(wù)器下發(fā),Winphone的由mpns下發(fā) .setNotification(Notification.newBuilder() // 指定當(dāng)前推送的android通知 .addPlatformNotification(IosNotification.newBuilder() // 傳一個(gè)IosAlert對(duì)象,指定apns title、title、subtitle等 .setAlert(notificationTitle) // 直接傳alert // 此項(xiàng)是指定此推送的badge自動(dòng)加1 .incrBadge(1) // 此字段的值default表示系統(tǒng)默認(rèn)聲音;傳sound.caf表示此推送以項(xiàng)目里面打包的sound.caf聲音來(lái)提醒, // 如果系統(tǒng)沒(méi)有此音頻則以系統(tǒng)默認(rèn)聲音提醒;此字段如果傳空字符串,iOS9及以上的系統(tǒng)是無(wú)聲音提醒,以下的系統(tǒng)是默認(rèn)聲音 .setSound("default") // 此字段為透?jìng)髯侄?,不?huì)顯示在通知欄。用戶(hù)可以通過(guò)此字段來(lái)做一些定制需求,如特定的key傳要指定跳轉(zhuǎn)的頁(yè)面(value) .addExtra("iosNotification extras key", extras) // 此項(xiàng)說(shuō)明此推送是一個(gè)background推送,想了解background看:http://docs.jpush.io/client/ios_tutorials/#ios-7-background-remote-notification // .setContentAvailable(true) .build()) .build() ) // Platform指定了哪些平臺(tái)就會(huì)像指定平臺(tái)中符合推送條件的設(shè)備進(jìn)行推送。jpush的自定義消息, // sdk默認(rèn)不做任何處理,不會(huì)有通知提示。建議看文檔http://docs.jpush.io/guideline/faq/的 // [通知與自定義消息有什么區(qū)別?]了解通知和自定義消息的區(qū)別 .setMessage(Message.newBuilder() .setMsgContent(msgContent) .setTitle(msgTitle) .addExtra("message extras key", extras) .build()) .setOptions(Options.newBuilder() // 此字段的值是用來(lái)指定本推送要推送的apns環(huán)境,false表示開(kāi)發(fā),true表示生產(chǎn);對(duì)android和自定義消息無(wú)意義 .setApnsProduction(apnsProduction) // 此字段是給開(kāi)發(fā)者自己給推送編號(hào),方便推送者分辨推送記錄 .setSendno(1) // 此字段的值是用來(lái)指定本推送的離線(xiàn)保存時(shí)長(zhǎng),如果不傳此字段則默認(rèn)保存一天,最多指定保留十天,單位為秒 .setTimeToLive(86400) .build()) .build(); } public static void main(String[] args) { // MyJPushClient jPushUtil = new MyJPushClient(); // List<String> aliasList = Arrays.asList("239"); // String notificationTitle = "notificationTitle"; // String msgTitle = "msgTitle"; // String msgContent = "msgContent"; // jPushUtil.sendToAliasList(aliasList, notificationTitle, msgTitle, msgContent, "exts"); } }
4.test
@RunWith(SpringRunner.class) @SpringBootTest public class JPushApplicationTests { @Autowired private MyJPushClient jPushClient; @Test public void testJPush() { List<String> aliasList = Arrays.asList("239"); String notificationTitle = "notification_title"; String msgTitle = "msg_title"; String msgContent = "msg_content"; jPushClient.sendToAliasList(aliasList, notificationTitle, msgTitle, msgContent, "exts"); } }
到此這篇關(guān)于SpringBoot集成極光推送完整實(shí)現(xiàn)代碼的文章就介紹到這了,更多相關(guān)SpringBoot集成極光推送內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
IDEA創(chuàng)建web項(xiàng)目出現(xiàn)404錯(cuò)誤解決方法
今天先來(lái)搭建一個(gè)web工程,工程搭建好運(yùn)行時(shí)發(fā)現(xiàn)404,本文主要介紹了IDEA創(chuàng)建web項(xiàng)目出現(xiàn)404錯(cuò)誤解決方法,具有一定的參考價(jià)值,感興趣的可以了解一下2023-09-09sms4j?2.0?全新來(lái)襲功能的調(diào)整及maven變化詳解
這篇文章主要介紹了sms4j?2.0?全新來(lái)襲功能的調(diào)整及maven變化詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-04-04InterProcessMutex實(shí)現(xiàn)zookeeper分布式鎖原理
本文主要介紹了InterProcessMutex實(shí)現(xiàn)zookeeper分布式鎖原理,文中根據(jù)實(shí)例編碼詳細(xì)介紹的十分詳盡,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-03-03Java中的Set接口實(shí)現(xiàn)類(lèi)HashSet和LinkedHashSet詳解
這篇文章主要介紹了Java中的Set接口實(shí)現(xiàn)類(lèi)HashSet和LinkedHashSet詳解,Set接口和java.util.List接口一樣,同樣繼承自Collection接口,它與Collection接口中的方法基本一致,并沒(méi)有對(duì)Collection接口進(jìn)行功能上的擴(kuò)充,只是比Collection接口更加嚴(yán)格了,需要的朋友可以參考下2024-01-01RestTemplate未使用線(xiàn)程池問(wèn)題的解決方法
今天給大家?guī)?lái)的是關(guān)于Springboot的相關(guān)知識(shí),文章圍繞著RestTemplate未使用線(xiàn)程池展開(kāi),文中有非常詳細(xì)的介紹及代碼示例,需要的朋友可以參考下2021-06-06詳解如何在低版本的Spring中快速實(shí)現(xiàn)類(lèi)似自動(dòng)配置的功能
這篇文章主要介紹了詳解如何在低版本的Spring中快速實(shí)現(xiàn)類(lèi)似自動(dòng)配置的功能,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2019-05-05詳解Java虛擬機(jī)管理的內(nèi)存運(yùn)行時(shí)數(shù)據(jù)區(qū)域
這篇文章主要介紹了詳解Java虛擬機(jī)管理的內(nèi)存運(yùn)行時(shí)數(shù)據(jù)區(qū)域的相關(guān)資料,需要的朋友可以參考下2017-03-03簡(jiǎn)單了解Java編程中線(xiàn)程的創(chuàng)建與守護(hù)線(xiàn)程
這篇文章主要介紹了Java編程中線(xiàn)程的創(chuàng)建與守護(hù)線(xiàn)程,是Java多線(xiàn)程并發(fā)編程的基礎(chǔ),需要的朋友可以參考下2015-11-11Java最簡(jiǎn)單的DES加密算法實(shí)現(xiàn)案例
下面小編就為大家?guī)?lái)一篇Java最簡(jiǎn)單的DES加密算法實(shí)現(xiàn)案例。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-06-06