Not logged in. · Lost password · Register
Forum: XMPP Protocol RSS
Avatar
sabarathnam #1
Member since Feb 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: Chat message is not delivered to all users
Hi

I have a windows application which will send the chat messages to multiple ids in a for loop. It works fine but it does not deliver the chage text to couple of id's in random. I would like to know if my approach of sending the chat message to each id in a for loop or should i follow a different logic.

thanks
Rathna Subbu
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
some code snippets would help to find the problem is there is any. In general there is no problem with sending messages in a loop. Some servers have special settings for rate limiting which can cause message drops.
What do you mean with "chage text"?
Avatar
sabarathnam #3
Member since Feb 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
Alex

I am sorry it is typo it should be "Chat Text".

thanks
Rathna Subbu
Avatar
sabarathnam #4
Member since Feb 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
Alex

Below is the code i use to send the message to multiple id's in a loop. Please let me know if you need further information.

  1. objXmpp = New XmppClientConnection
  2. Dim jid As New Jid(txtgTalkID.Text)
  3. objXmpp.Username = jid.User
  4. objXmpp.Server = jid.Server
  5. objXmpp.Password = txtGtalkPassword.Text
  6. objXmpp.AutoResolveConnectServer = True
  7. objXmpp.Open()
  8.  
  9. If cbGChat.Checked Then
  10.    Dim toGChatList() As String = wGTalkIds.Split(",")
  11.    Dim jid As agsXMPP.Jid
  12.    Dim ChatMessage As protocol.client.Message
  13.    For Each usr As String In toGChatList
  14.       jid = New agsXMPP.Jid(usr.Trim)
  15.       ChatMessage = New protocol.client.Message(jid, protocol.client.MessageType.chat, data.Trim)
  16.       objXmpp.Send(ChatMessage)
  17.    Next
  18. End If

thanks
Rathna Subbu
Avatar
sabarathnam #5
Member since Feb 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
Alex

Did you get a chance to check my code?

thanks
Rathna Subbu
Avatar
Alex #6
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I see no errors in the code.
The Open method is async. You should wait until you are really connected before you start sending your messages.

Alex
Avatar
sabarathnam #7
Member since Feb 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
Alex

Thanks for the suggestion. We are logging to gtalk in the application well before sending messages. When we try to send single message to 50+ receipients some of the ids does not receive the message. Is there a way to make sure if the message is delivered?

thanks
Rathna Subbu
Avatar
Alex #8
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by sabarathnam:
Thanks for the suggestion. We are logging to gtalk in the application well before sending messages. When we try to send single message to 50+ receipients some of the ids does not receive the message.

  • can you please try your software on another XMPP server than Google Talk servers? I would suggest a local server.
  • Can you please attach a complete Xml log where we can see the 50+ messages and the responses from the server when there are any.
  • Did you check incoming messages of type error? When a message gets not delivered then the server MUST return it with type=error.

Quote by sabarathnam:
Is there a way to make sure if the message is delivered?
A server MUST deliver the messages. When the server can't deliver them then you get them back with type error. A server SHOULD NOT silently drop any messages. Additionally you can use XEP-0184: Message Receipts.

Alex
Avatar
sabarathnam #9
Member since Feb 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
Alex

I have tried the following and with my limited knowledge with the library, I cannot figure out how to get the response or how to check the type=error. Some code snippets would help me to get the data quickly.

thanks
Rathna Subbu
Avatar
Alex #10
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by sabarathnam:
I have tried the following and with my limited knowledge with the library, I cannot figure out how to get the response or how to check the type=error. Some code snippets would help me to get the data quickly.

in the message event handler check:

  1. If msg.Type = protocol.client.MessageType.error then
  2.    '// its an error message
  3. end if

please use the OnReadXml and OnWriteXml handlers to build the debug Xml and post it here.

Alex
Avatar
sabarathnam #11
Member since Feb 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
Alex

Thanks for your instructions. I am able to capture the error message for the failed chat message delivery. Below is the error let me know if you need further information

<body xmlns="jabber:client">My Message Goes here</body><error xmlns="jabber:client" code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error>

thanks
Rathna Subbu
Avatar
Alex #12
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  1. <error xmlns="jabber:client" code="503" type="cancel">
  2.    <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  3. </error>
normally the above error means that the user id you send the message to is not available.

Is it possible that the user you send the message to is gone offline and the server supports no offline delivery? Or the user changed the resource and is not available the the resource you send the message to anymore? If this is not the problem then please send the complete log.

Alex
Avatar
sabarathnam #13
Member since Feb 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
Alex

I have attached the log we have captured.

thanks
Rathna Subbu
The author has attached one file to this post:
chatLog.txt 197.1 kBytes
You have no permission to open this file.
Avatar
Alex #14
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you get the messages back with type error. I assume that the users are offline when you tried to deliver the message to them.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: