1

Let's say I want my corporate server to communicate with Google App Engine and vice versa. I know that GAE does not support JMS,RMI etc. What is the best alternative for this kind of communication? Use task queue? (I think HTTP get() is not suitable for this kind of communication).

Both my corporate server and GAE application use Spring framework.

APC
  • 144,005
  • 19
  • 170
  • 281
cometta
  • 35,071
  • 77
  • 215
  • 324

3 Answers3

2

XMPP is a powerful and flexible messaging protocol, and this article shows how to do the GAE side of it in both Java and Python. For XMPP implementations (in Java and others) outside of GAE, see this SO question.

For accessing from GAE a lot of bulky secure data that lives behind your corporate firewall, Google recommends implementing the Secure Data Connector (I'm pointing specifically to the URL of the Java tutorial for SDC with GAE).

Community
  • 1
  • 1
Alex Martelli
  • 854,459
  • 170
  • 1,222
  • 1,395
1

Use any of a number of HTTP based RPC protocols: REST, JSONRPC, SOAP, etc.

You say "I think http get() is not suitable for this kind of communication" - why not?

Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
  • @Nick, slow. let say i need very frequent calls in 1 seconds, would be better to use jms compared to http get right? – cometta Mar 29 '10 at 11:14
  • No. There's nothing slow about RPCs over HTTP. They're extremely optimized, in fact, since users are very time sensitive and fetch pages over HTTP all the time. – Nick Johnson Mar 29 '10 at 13:05
0

Yes, task queue. It does the same that JMS does.

You can also use Google Cloud Pub/Sub or any other similar service.

What you going to do is basically configure a WebServlet and implement the HttpServlet doPost method. In specific for Google Cloud Pub/Subm you should use the url pattern /_ah/push-handlers

Here the example from the docs of AppEngine for the receiver:

// The Enqueue servlet should be mapped to the "/enqueue" URL.
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
@WebServlet(
    name = "TaskEnque",
    description = "taskqueue: Enqueue a job with a key",
    urlPatterns = "/taskqueues/enqueue"
)
public class Enqueue extends HttpServlet {

  protected void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    String key = request.getParameter("key");

    // Add the task to the default queue.
    Queue queue = QueueFactory.getDefaultQueue();
    queue.add(TaskOptions.Builder.withUrl("/worker").param("key", key));

    response.sendRedirect("/");
  }
}
Allan Veloso
  • 5,823
  • 1
  • 38
  • 36