默认
发表评论 6
想开发IM:买成品怕坑?租第3方怕贵?找开源自已撸?尽量别走弯路了... 找站长给点建议
[已解决] 用MobileIMSDK-Netty v3.1版做群聊时记录重复发送,求帮忙解决
在做群发时,调用接口,出现第一次不能发送成功,后面系统自动又发送了一次信息,信息才发送成功,代码看附件,日志:[INFO] - [17:19:30.677][IMCORE-netty] << 收到客户端{uid:22}/127.0.0.1:63429的消息:::{"bridge":false,"type":2,"dataContent":"{\u0027msg_str\u0027:\u0027888888\u0027,\u0027groupId\u0027:\u002711\u0027} ","from":"22","to":"0","fp":"f2725782-e498-4309-8521-5f29e5720618","QoS":true,"typeu":1} | (ServerCoreHandler^messageReceived:95)
[INFO] - [17:19:30.678][IMCORE-netty]<< 收到客户端{uid:22}/127.0.0.1:63429的通用数据发送请求. | (ServerCoreHandler^messageReceived:114)
[INFO] - [17:19:30.678][IMCORE-netty] >> 给客户端:{uid:22}/127.0.0.1:63429的数据->{"bridge":false,"type":4,"dataContent":"f2725782-e498-4309-8521-5f29e5720618","from":"0","to":"22","QoS":false,"typeu":-1},已成功发出[122]. | (LocalSendHelper$1^operationComplete:117)
[DEBUG] - [17:19:30.678][IMCORE-本机QoS!]【QoS_应答_C2S】向22发送f2725782-e498-4309-8521-5f29e5720618的应答包成功了,from=0. | (LogicProcessor$2^update:87)
[DEBUG] - [17:19:30.679]【DEBUG_111111111111111111111111111111回调通知】[typeu=1]收到了客户端22发给服务端的消息:str={'msg_str':'888888','groupId':'11'}  | (ServerEventListenerImpl^onTransBuffer_CallBack:137)
[INFO] - [17:19:30.680]群聊信息发送失败,暂时存到离线信息[{'msg_str':'888888','groupId':'11'} ],from_user_id:[22]touserid:[11] | (ServerEventListenerImpl$1^update:211)
[INFO] - [17:19:30.680][IMCORE-netty] >> 给客户端:{uid:11}/127.0.0.1:63430的数据->{"bridge":false,"type":2,"dataContent":"{\u0027msg_str\u0027:\u0027888888\u0027,\u0027groupId\u0027:\u002711\u0027} ","from":"22","to":"11","fp":"493f3765-d8a1-47ad-8331-863b147a61da","QoS":true,"typeu":1},已成功发出[205]. | (LocalSendHelper$1^operationComplete:117)
[INFO] - [17:19:30.680]群聊信息发送成功[{'msg_str':'888888','groupId':'11'} ],from_user_id:[22]touserid:[11] | (ServerEventListenerImpl$1^update:186)
[INFO] - [17:19:30.690]--------------------------------------------------------- | (ServerCoreHandler^messageReceived:94)
[INFO] - [17:19:30.690][IMCORE-netty] << 收到客户端{uid:33}/127.0.0.1:59118的消息:::{"bridge":false,"type":1,"dataContent":"{}","from":"33","to":"0","QoS":false,"typeu":-1} | (ServerCoreHandler^messageReceived:95)
[INFO] - [17:19:30.690][IMCORE-netty] >> 给客户端:{uid:33}/127.0.0.1:59118的数据->{"bridge":false,"type":51,"dataContent":"{}","from":"0","to":"33","QoS":false,"typeu":-1},已成功发出[89]. | (LocalSendHelper$1^operationComplete:117)
[DEBUG] - [17:19:30.690]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 3, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[INFO] - [17:19:30.690]群聊信息发送失败,暂时存到离线信息[{'msg_str':'888888','groupId':'11'} ],from_user_id:[22]touserid:[33] | (ServerEventListenerImpl$1^update:211)
[INFO] - [17:19:30.690][IMCORE-netty] >> 给客户端:{uid:33}/127.0.0.1:59118的数据->{"bridge":false,"type":2,"dataContent":"{\u0027msg_str\u0027:\u0027888888\u0027,\u0027groupId\u0027:\u002711\u0027} ","from":"22","to":"33","fp":"95dbc24b-3a80-40e6-ace9-147f86b121c6","QoS":true,"typeu":1},已成功发出[205]. | (LocalSendHelper$1^operationComplete:117)
[DEBUG] - [17:19:30.690]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 3, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[INFO] - [17:19:30.690]群聊信息发送成功[{'msg_str':'888888','groupId':'11'} ],from_user_id:[22]touserid:[33] | (ServerEventListenerImpl$1^update:186)
[DEBUG] - [17:19:30.690]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 3, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[DEBUG] - [17:19:30.690]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 3, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[DEBUG] - [17:19:30.700]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 3, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[DEBUG] - [17:19:30.700]acquire test -- pool size: 3; target_pool_size: 6; desired target? 4 | (BasicResourcePool^prelimCheckoutResource:538)
[DEBUG] - [17:19:30.700]awaitAvailable(): com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de | (BasicResourcePool^awaitAvailable:1291)
[DEBUG] - [17:19:30.700]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 3, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[DEBUG] - [17:19:30.700]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 3, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[DEBUG] - [17:19:30.700]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 3, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[INFO] - [17:19:30.700][IMCORE-netty]toSession==null >> id=22的用户尝试发给客户端44的消息:str={'msg_str':'888888','groupId':'11'} 因接收方的id已不在线,此次实时发送没有继续(此消息应考虑作离线处理哦). | (LocalSendHelper^sendData:98)
[DEBUG] - [17:19:30.730]com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager@4ee5c6dc.acquireResource() returning.  | (C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager^acquireResource:217)
[DEBUG] - [17:19:30.730]com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager@4ee5c6dc.acquireResource() returning.  | (C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager^acquireResource:217)
[DEBUG] - [17:19:30.730]com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager@4ee5c6dc.acquireResource() returning.  | (C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager^acquireResource:217)
[DEBUG] - [17:19:30.750]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 4, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[INFO] - [17:19:30.750]群聊信息发送失败,暂时存到离线信息[{'msg_str':'888888','groupId':'11'} ],from_user_id:[22]touserid:[44] | (ServerEventListenerImpl$1^update:211)
[DEBUG] - [17:19:30.750]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 6, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[DEBUG] - [17:19:30.750]decremented pending_acquires: 0 | (BasicResourcePool^decrementPendingAcquires:422)
INFO] - [17:19:30.760]--------------------------------------------------------- | (ServerCoreHandler^messageReceived:94)
[INFO] - [17:19:30.760][IMCORE-netty] << 收到客户端{uid:11}/127.0.0.1:63430的消息:::{"bridge":false,"type":4,"dataContent":"493f3765-d8a1-47ad-8331-863b147a61da","from":"11","to":"22","QoS":false,"typeu":-1} | (ServerCoreHandler^messageReceived:95)
[INFO] - [17:19:30.760][IMCORE-netty]<< 收到客户端{uid:11}/127.0.0.1:63430的ACK应答包发送请求. | (ServerCoreHandler^messageReceived:101)
[DEBUG] - [17:19:30.760]【@】当前在线用户共(3)人-------------------> | (OnlineProcessor^__printOnline:64)
[DEBUG] - [17:19:30.760][IMCORE-本机QoS!]【QoS机制_C2C】11发给22的指纹为493f3765-d8a1-47ad-8331-863b147a61da的应答包已成功转发?false | (LogicProcessor$3^update:131)
[INFO] - [17:19:30.760][IMCORE-netty] >> 给客户端:{uid:22}/127.0.0.1:63429的数据->{"bridge":false,"type":4,"dataContent":"493f3765-d8a1-47ad-8331-863b147a61da","from":"11","to":"22","QoS":false,"typeu":-1},已成功发出[123]. | (LocalSendHelper$1^operationComplete:117)
[DEBUG] - [17:19:30.760]trace com.mchange.v2.resourcepool.BasicResourcePool@101955c5 [managed: 6, unused: 5, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1b264de) | (BasicResourcePool^trace:1644)
[DEBUG] - [17:19:30.760][IMCORE-本机QoS!]【QoS机制_C2C】11发给22的指纹为493f3765-d8a1-47ad-8331-863b147a61da的应答包已成功转发?true | (LogicProcessor$3^update:131)
[INFO] - [17:19:30.776]--------------------------------------------------------- | (ServerCoreHandler^messageReceived:94)
[INFO] - [17:19:30.777][IMCORE-netty] << 收到客户端{uid:33}/127.0.0.1:59118的消息:::{"bridge":false,"type":4,"dataContent":"95dbc24b-3a80-40e6-ace9-147f86b121c6","from":"33","to":"22","QoS":false,"typeu":-1} | (ServerCoreHandler^messageReceived:95)
[INFO] - [17:19:30.777][IMCORE-netty]<< 收到客户端{uid:33}/127.0.0.1:59118的ACK应答包发送请求. | (ServerCoreHandler^messageReceived:101)
[DEBUG] - [17:19:30.777]【@】当前在线用户共(3)人-------------------> | (OnlineProcessor^__printOnline:64)
[DEBUG] - [17:19:30.777][IMCORE-本机QoS!]【QoS机制_C2C】33发给22的指纹为95dbc24b-3a80-40e6-ace9-147f86b121c6的应答包已成功转发?false | (LogicProcessor$3^update:131)
[INFO] - [17:19:30.778][IMCORE-netty] >> 给客户端:{uid:22}/127.0.0.1:63429的数据->{"bridge":false,"type":4,"dataContent":"95dbc24b-3a80-40e6-ace9-147f86b121c6","from":"33","to":"22","QoS":false,"typeu":-1},已成功发出[123]. | (LocalSendHelper$1^operationComplete:117)
[DEBUG] - [17:19:30.778][IMCORE-本机QoS!]【QoS机制_C2C】33发给22的指纹为95dbc24b-3a80-40e6-ace9-147f86b121c6的应答包已成功转发?true | (LogicProcessor$3^update:131)






即时通讯网 - 即时通讯开发者社区! 来源: - 即时通讯开发者社区!

标签:MobileIMSDK

调用3.png (88.92 KB, 下载次数: 1035)

调用3.png

调用2.png (73.7 KB, 下载次数: 1019)

调用2.png

调用1.png (41.12 KB, 下载次数: 932)

调用1.png
上一篇:[已回复] 关于MobileIMSDK客户端间发送消息成功后服务器回调函数的疑问下一篇:[已回复] 请问下怎么基于MobileIMSDK将好友的在线情况发送给客户端

本帖已收录至以下技术专辑

推荐方案
评论 6
第一次发送都是失败,第二次发送才成功
好奇怪的问题,我按你的代码写一个简单的测,看看什么情况。
引用:JackJiang 发表于 2017-12-27 17:53
好奇怪的问题,我按你的代码写一个简单的测,看看什么情况。

谢谢,麻烦你了
OK,问题找出来了,原因是服务端netty版在v3.1版的的一处bug导致,请下载我附件上的新netty版jar包更新一下,正式新版我稍后发布,你先提前用一下: MobileIMSDKServerX_netty(v3.2_b201712261820).jar (86.73 KB , 下载次数: 5 )

我的测试方法是依照你写的,bug解决后运行正常:
[已解决] 用MobileIMSDK-Netty v3.1版做群聊时记录重复发送,求帮忙解决_111.png

你如果需要本次修改的源码,请下载这几个源码:
ServerLauncher.java (5.51 KB , 下载次数: 3 )
ServerCoreHandler.java (7.9 KB , 下载次数: 2 )
LocalSendHelper.java (7.51 KB , 下载次数: 2 )
[已解决] 用MobileIMSDK-Netty v3.1版做群聊时记录重复发送,求帮忙解决_QQ截图20171228100719.png

点评

JackJiang  说:
最佳答案!  (7 年前)
引用:JackJiang 发表于 2017-12-27 18:13
OK,问题找出来了,稍等。。。

好的  麻烦了
打赏楼主 ×
使用微信打赏! 使用支付宝打赏!

返回顶部