Ravi,

Using the sample code, I am able to get above 10 messages a minute. What
happens when you add your application in GTalk instead of your custom
client?  Here's the code I'm using. It's basically an XMPP echo server:

import java.io.IOException;
import javax.servlet.http.*;

import com.google.appengine.api.xmpp.*;

@SuppressWarnings("serial")
public class XMPPReceiverServlet extends HttpServlet {
    public void doPost(HttpServletRequest req, HttpServletResponse res)
            throws IOException {
        XMPPService xmpp = XMPPServiceFactory.getXMPPService();
        Message message = xmpp.parseMessage(req);

        JID fromJid = message.getFromJid();
        String body = message.getBody();
        String msgBody = "Received message: " + body;
        Message msg = new MessageBuilder()
                .withRecipientJids(fromJid)
                .withBody(msgBody)
                .build();

        boolean messageSent = false;
        if (xmpp.getPresence(fromJid).isAvailable()) {
            SendResponse status = xmpp.sendMessage(msg);
            messageSent = (status.getStatusMap().get(fromJid) ==
SendResponse.Status.SUCCESS);
        }

        if (!messageSent) {
            // Do something, log an error
        }
    }


On Tue, Dec 1, 2009 at 7:35 AM, Ravi <ping2r...@gmail.com> wrote:

> Hi Ikai L/Google App Team,
> Did you get a chance to look at this problem?
>
> Thanks,
> Ravi
>
> On Nov 30, 8:19 pm, Ravi Sharma <ping2r...@gmail.com> wrote:
> > Hi,
> > Thanks for looking into it.I am sending the small code which i am using.
> I
> > am using smack library.
> > This behaviour is not consistant. Once i was able to send messges at
> every 5
> > seconds(and sent around 4000) and once i had to make it 15 seconds for
> each
> > message.
> >
> > i use the following class as
> > GaeClientMessanger m = new GaeClientMessanger();
> > m.initConnection();
> > for(some loop condiiton)
> > {
> > ..
> > m.sendToGae(message);}
> >
> > m.disconnect();
> >
> > public class GaeClientMessanger{
> >     private ConnectionConfiguration config;
> >     private XMPPConnection connection;
> >     private static LocalDefaultMessageController messgageHandler;
> >     protected Logger logger = Logger.getLogger(this.getClass());
> >
> >     public void initConnection() throws XMPPException
> >     {
> >         config = new ConnectionConfiguration("talk.google.com",
> >                             5222,
> >                             "gmail.com");
> >
> >         connection = new XMPPConnection(config);
> >         connection.connect();
> >         connection.login("gmailu...@gmail.com", "password");
> >
> >         Roster roster = connection.getRoster();
> >
> >         roster.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
> >         Collection<RosterEntry> entries = roster.getEntries();
> >
> >     }
> > public void sendToGae(String message) throws XMPPException,
> MessageException
> >     {
> >
> >         Chat chat = connection.getChatManager().createChat("
> > ap...@appspot.com", messgageHandler);
> > //messageHandler will receive the message back from server, if i receive
> the
> > same mesage back that means my message did not reach server.If i receive
> > success, that means my message reached
> >
> >         chat.sendMessage(messageXml);
> >
> >     }
> >     public void disconnect() throws XMPPException
> >     {
> >         connection.disconnect();
> >
> >     }}
> >
> > On Mon, Nov 30, 2009 at 8:00 PM, Ikai L (Google) <ika...@google.com>
> wrote:
> >
> > > Ravi,
> >
> > > Do you have any sample code? I'd like to take a look at this.
> >
> > > On Fri, Nov 27, 2009 at 2:43 AM, Ravi <ping2r...@gmail.com> wrote:
> >
> > >> Hi Googlers,
> > >> Did you get a chance to look at my problem
> > >> Quota page says 3000 calls/min can be handled by App Engine.
> > >> But when I send a message every 5 second from a client(outside app
> > >> engine), it stop responding after 10 messages.
> > >> I increased the time one second each time and now for 10 seconds
> > >> difference between each call is working fine. That is really really a
> > >> big problem. I need to make almost 20000 calls now and then may be
> > >> more, so to do that I might need
> > >> 20000/6 = 3333 minutes(6 calls per minutes) or 55 hours or two and
> > >> half day. Am I suppose to keep running my program for 2 and half days
> > >> to make those 20000 calls.
> > >> I really need some help here.
> >
> > >> Thanks in Advance
> > >> Ravi.
> >
> > >> On Nov 25, 9:50 pm, Ravi Sharma <ping2r...@gmail.com> wrote:
> > >> > Hi Googlers,
> > >> > Can i have some reply on my problem, its really a stopper for our
> > >> > application.
> >
> > >> > *Now one bigger problem we are seeing.*
> > >> > I send 25(testing with 25 just a number) XMPP message to GAE
> Application
> > >> > from my desktop XMPP client
> > >> > First 10 messages goes and delivered to GAE Application and GAE
> > >> application
> > >> > reply it by saying Mesage delivered.
> >
> > >> > but 11th and onwards message never reach to GAE application(i can
> see it
> > >> in
> > >> > my logs, that my XMPP controller never received the messgae), and
> but my
> > >> > client do get a reply from GAE(my application i...@appspot.com)
> which
> > >> is same
> > >> > message as what i sent. This is really weird and big problem. Why my
> > >> > messages are being returned back to me?. Usally in chat client it
> > >> happens
> > >> > when someone is offline. So does it mean that my GAE chat bot has
> gone
> > >> > offline? or too busy to respond? or any other problem?
> >
> > >> > And i ran this test now almost 7-8 times and everytime only first 10
> > >> > messages are getting delivered.
> >
> > >> > Then i thought may be its the number of request per seconds, so i
> > >> started
> > >> > sending one message per 5 seconds but still no success.Still only 10
> > >> > messages reaching GAE.
> >
> > >> > Can any one from google check this problem and give some guidence
> what
> > >> is
> > >> > wrong here
> >
> > >> > Thanks in advance,
> > >> > Ravi.
> >
> > >> > On Wed, Nov 25, 2009 at 9:33 AM, Ravi Sharma <ping2r...@gmail.com>
> > >> wrote:
> > >> > > Hi,
> > >> > > I am trying to write a XMPP Client. When i send a mesage from
> Client
> > >> to GAE
> > >> > > application, it always reach the server and then server reply
> back.
> > >> When i
> > >> > > ran the client first time it worked for 3-4 times. but then now i
> am
> > >> not
> > >> > > receiving any message on client side. I checked the server logs
> and it
> > >> says
> > >> > > that Message sent succesfully.
> >
> > >> > > I am using my gmail id on client side to connect to
> > >> talk.google.comserver.And i logged out my self from all google client
> like
> > >> gmail, gtalk
> > >> > > etc, as i was thinking may be message is being sent to another
> client.
> > >> > > Intrestingky when i am logged in to Gtalk at the time when i am
> > >> running my
> > >> > > client, Gtalk recive the response from server. I am using smack
> > >> libraries
> > >> > > forXMPP client.
> >
> > >> > > 1) Can you please suggest what can be a problem here.
> > >> > > 2) Is XMPP communication is 100% delivery system. Is there chance
> that
> > >> my
> > >> > > message will get lost once on server or client i see that message
> has
> > >> been
> > >> > > sent.
> >
> > >> > > Thanks,
> > >> > > Ravi.
> >
> > >> --
> >
> > >> You received this message because you are subscribed to the Google
> Groups
> > >> "Google App Engine for Java" group.
> > >> To post to this group, send email to
> > >> google-appengine-j...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> <google-appengine-java%2bunsubscr...@googlegroups.com<google-appengine-java%252bunsubscr...@googlegroups.com>
> >
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-appengine-java?hl=en.
> >
> > > --
> > > Ikai Lan
> > > Developer Programs Engineer, Google App Engine
> >
> > >  --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Google App Engine for Java" group.
> > > To post to this group, send email to
> > > google-appengine-j...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> <google-appengine-java%2bunsubscr...@googlegroups.com<google-appengine-java%252bunsubscr...@googlegroups.com>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.


Reply via email to